QuickStart

Top  Previous  Next

Creating metafile with wPDF is as easy as 1 - 2 - 3 or better as

 

BeginDoc - DrawMetafile - EndDoc.

 

If you need a canvas to draw to you need to open a 'page' first. Then you can do

 

BeginDoc - StartPage - Canvas.Draw() - EndPage - EndDoc

 

There is only one property in the TWPDFPrinter which is required: FileName - this is the file which will be created. If you want to create the PDF in memory use 'InMemoryMode' set to TRUE and assign the output stream to the property 'Stream'.

 

The property StartPage requires the width and the height of the page you need to create. It also requires the resolution which is used to define width and height and which is used for the x and y parameters of other procedures. (for bookmarks, hyperlinks etc). The last parameter is the rotation for the page - usually 0.

 

To create a 8.5 by 10 inch page use

 

var res := Screen.PixelsPerInch;

 StartPage( Round(8.5*res), Round(10*res), res, res, 0);

 

to open a DinA4 page you can do this:

 

var res := Screen.PixelsPerInch;

 StartPage( Round(21/2.54*res), Round(29.7/2.54*res), res, res, 0);

 

 

Don't forget to set your license name and code before using the PDF export. To do this use the procedure WPDF_Start(name,code).

(This does not apply to wPDF demo version or the Source-Code License)

 

 

See property DLLName if you want to install the DLL into a different directory than the applications folder or if you want to rename the DLL.

 

Upgrade note:

 

wPDF V3 and 4: Please note that for historic reasons the property Info.Producer modifies the "Creator" entry in the PDF file. The entry "Producer" will be always set to "wPDF4 by WPCubed GmbH".