PDF Library for Android

PDF Library for Android

Delphi and C++ Builder library for creating, processing and rendering PDF documents.
  • uses PdfBox-Android library
  • available for Delphi/C++ Builder 10 - 10.4
  • royalty free distribution in applications

Download and order

FAQ

Why "java.io.FileNotFoundException: open failed: EACCESS (Permission denied)" exception is raised when opening existing PDF file?
You have to request permissions to external storage before using the PDF file:
uses System.Permissions, Androidapi.JNI.Os, ...
...
  PermissionsService.RequestPermissions([JStringToString(TJManifest_permission.JavaClass.READ_EXTERNAL_STORAGE)],
    procedure(const APermissions: TArray; const AGrantResults: TArray)
    var PermissionGranted: Boolean;
    begin
      PermissionGranted := (Length(AGrantResults) = 1) and (AGrantResults[0] = TPermissionStatus.Granted);
      ...
    end);
...
							
How can I specify page size when creating new page?
Page := Document.AddPage(TPdfPageSize.A4);
							
How can I change page size?
Page.MediaBox := TPdfPageSize.A4;
							
How can I retrieve text from PDF document?
var
  Stripper: JPDFTextStripper;
  Text: string;

Stripper := TJPDFTextStripper.JavaClass.init;
Text := JStringToString(Stripper.getText(Document.Document)); 
							

Related links