Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

PDFium – PDF Engine for your Delphi/C++ Builder FireMonkey Applications

Intro

PDFium Component Suite for FireMonkey has so many capabilities to handle PDF documents. It uses PDFium open-source PDF rendering engine and supports Windows, macOS, iOS, and Android.

PDFium itself is used by the Chromium project. So, you can understand that “ium” comes from Chromium! This is a fully open-source project and you can contribute to that here.

Installation

Since this is a component suite and supports different operating systems, it has its installation file. But, if you are in doubt, you can follow a short video on how to install the PDFium Component Suite for FireMonkey.

Overview

When you successfully install you will get two components on your Palette.

TFPdf handles PDF documents. With that component, you can create and process PDF documents.

TFPdfView is the component that shows the PDF documents in your FireMonkey applications.

What you can do with the PDFium Suite?

Development

Let’s investigate how the PDFium Suite converting PDF documents to Jpg image files.

On Form Create this will get the pixels per inch by using the GetDisplayMetrics function.

[crayon-6741ce0a7f974735851197/]

The Convertor button starts the operation. It starts from page number 0, from the beginning. And with the RenderPage procedure, you can render the pages. And finally, you can save them to the TBitmap based data to files.

[crayon-6741ce0a7f97c849145101/]

Extracting Images from PDF document

Taking file name and path and setting the initial point of the process is similar, but when you want to get images from PDF document. You can just iterate over the TFPdf using the BitmapCount and you can receive the images by its index.

[crayon-6741ce0a7f97e752948134/]

Extracting Text

By calling Text function you can fetch the text from PDF documents and save the content to a text file:

[crayon-6741ce0a7f980471121120/]

Be sure to check out the demo action video that shows all the demo projects in action.

Head over and check out the full WINSOFT PDFium for FireMonkey Library

Like what you see? You can get PDFium for FireMonkey and over 100 other fantastic WinSoft components with our Enterprise Component Pack. For a limited time, when you purchase RAD Studio Enterprise or Architect Edition at special Upgrade Pricing, you will also get this package of third-party software worth over $13,000, including the full WinSoft Component Library, at NO EXTRA COST! Step up to RAD Studio 10.4.1 today!

Exit mobile version