

That’s the level of control you get with PDFtoolkit. If it were an image, then you can get hold of its coordinates, scaling factor, and the actual image in the form of a TGraphic object. If the page element returned by the method is a text element, then its properties expose details such as location, font, and color. This method returns a list of PDF page elements from a specified page. TgtPDFElementType = (etText, etImage, etPath, etFormField) MMUnit: TgtMeasurementUnit): TgtPDFPageElementList The TgtPDFDocument.GetPageElements() is another example of a very capable PDFtoolkit method. From this information, it is easy to calculate the location of the center of the page.Īs you can see, PDFtoolkit provides an elegant interface that hides the complexities imposed by the format specification. This method returns a TgtPageSize record, whose fields TgtPageSize.Width and TgtPageSize.Height provide the dimensions of the specified page. = (muPixels, muPoints, muInches, muMM, muTwips) MMUnit: TgtMeasurementUnit): TgtPageSize

To obtain the location of the center of the page, we first call TgtPDFDocument.GetPageSize(). The formatted string is written at the center of the last page. Y-coordinate GetPagesize(gtPDFDocument1.PageCount, muPixels). X-coordinate GetPageSize(gtPDFDocument1.PageCount, muPixels). IntToStr(gtPDFDocument1.PageCount), // Page range ' Hello, World!', // HTML-formatted string Write formatted text at the center of the last page Set document measurement units to pixels The number of the last page is obtained from the property TgtPDFDocument.PageCount(). Next, a HTML-formatted string is written on the last page.
ACTIVE PDF TOOLKIT ERROR 998 CODE
In the next code snippet, we first specify the measurement unit that will be used when rendering elements on a PDF page. LoadFromFile('sample_doc.pdf') Īfter a PDF document has been loaded, document contents and their properties can be read and modified using the properties and methods of TgtPDFDocument object. GtPDFDocument1 := TgtPDFDocument.Create(Nil) Create a TgtPDFDocument object, load a document, and we are ready to roll. Reading a PDF document is straightforward, as shown in the code snippet below.

Last but not the least, PDF is an open format.įor these reasons, PDF has become a part of our technology-oriented lives. PDF is also liked for its features such as font embedding, bookmarks, thumbnails, attachments, watermarks, annotations, encryption, and digital signatures. That is why PDF is a popular choice for making invoices and user manuals, and also for transmitting documents over the Internet. It is also a final form document format in that people do not expect PDF documents to undergo further change. PDF is best known for its ability to retain high fidelity on all platforms.
