wPDF is a PDF maker which is optimized for greater compatibility with most drawing commands commonly found in Windows applications. Used alone, with your own component or linked with WPTools, wPDF instantly creates PDF files. wPDF is compatible with WPTools, WPForm, QuickReport and HTMLView, to name just a few possibilities. This component provides you with a compatible ‘canvas’ property which you can use for direct drawing.
wPDF converts enhanced metafiles to PDF while preserving the vector and text information. This results in small PDF files which can be printed at high resolution, thus making wPDF superior to other solutions which convert embedded metafiles into bitmaps. wPDF supports the usual PDF features, including compression and 128 bit encryption and it was the first Delphi library to allow embedding of font subsets to reduce file size even further.
The code needed for to create a PDF file is very similar to that needed for printing:
const Resolution = 72;
WPPDFPrinter1.BeginDoc; // Starts a new document
WPPDFPrinter1.StartPage( // start a page of a certain page
Round(8.5*Resolution), 5*Resolution, Resolution, Resolution, 0);
DrawPage(WPPDFPrinter1.Canvas); // subprocedure to draw to the TCanvas
WPPDFPrinter1.EndPage; // close the page
WPPDFPrinter1.EndDoc; // close the document
If you are using WPTools file creation can be done with just one line of code: