WPCubed Product Support

Using the pdfPrintW-Function

Ah, das habe ich mir nämlich gedacht. Wir arbeiten hier immer mit PDF-Dateien aus Blob-Feldern die dann als memorystream

geladen werden (pdf.Loadfromstream(Blob-Feld....)).

Das war der entscheidende Hinweis: memorystream.Memory !!! Damit funktionierts!

var

sWideOption : WideString;

oStream : TMemoryStream;

….

sWideOption := '"HEADERR='+dateTimetostr(now)+'"';

if lDuplex then

sWideOption := sWideOption + ','+'"DUPLEX=2"';

……
pdfPrintW('','',

PWideChar(WPViewPDF_LicName), PWideChar(WPViewPDF_LicKey), WPViewPDF_LicCode,

PWideChar(sOption),

oStream.Memory, oStream.Size);

Danke!

#5 ♥ 0
5.9k Views 2 users read 2 min
wpsupport

data und datalen spezifiziert einen Speicherbereich falls data nicht nil ist.

Ansonsten wird aus dem angegebenen "filename" geladen.

Falls filename angegeben ist, also nicht '' wird dieser zuerst geladen und dann die PDF daten aus dem speicherbereich data/datalen.

Zur übergaben eignet sich ein memorystream, also

memorystream.Memory, memorystream.Size für data, datalen.

#4 ♥ 0

Sorry, the documentation says (Site 183):

pdfPrintW has two additional parameters data and datalen. If not 0, a buffer

with PDF data is expected which is loaded or, if a file was also specified, appended

prior to printing.

How can i understand this???

#3 ♥ 0
wpsupport

There is a misunderstanding pdfPrint does not print the loaded PDF file it internally creates a PDF engine, loads the file, prints it and destroy the PDF engine.

To print the PDF loaded in a WPViewPDF use a command or the Print procedure.

#2 ♥ 0

How am I able to print the loaded PDF with the Function pdfPrintW?

My Code:

TfrmMain = class(TForm)

PDF: TWPViewPDF;

……
function pdfPrintW(filename: PWideChar; password: PWideChar;

licname, lickey: PWideChar; liccode: Cardinal;

options: PWideChar;

data: Pointer; datalen: Integer): Integer; stdcall;

external 'wPDFViewPlus04.dll' name 'pdfPrintW';

pdfPrintW('','',

PWideChar(WPViewPDF_LicName),

PWideChar(WPViewPDF_LicKey),

WPViewPDF_LicCode,

PWideChar(sOption),

PDF,100000);

I get an exception with "Unknown file Format" !

Is there a Delphi-sample?

Best regards

Bernd

#1 ♥ 0