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.3
  • royalty free distribution in applications

Library API

  EPdfLibraryError = class(Exception);

  TPdfLineCapStyle = (lcButt, lcRound, lsSquare);
  TPdfLineJoinStyle = (ljMiter, ljRound, ljBevel);
  TPdfRotation = (ro0 = 0, ro90 = 90, ro180 = 180, ro270 = 270);

  TPdfDocument = class
    constructor Create;
    constructor Create(const FileName: string);

    function AddPage: TPdfPage;
    function AddPage(const MediaBox: TRectF): TPdfPage;
    function ImportPage(Page: TPdfPage): TPdfPage;
    procedure RemovePage(Page: TPdfPage);
    procedure RemovePage(Index: Integer);
    function RenderPage(Index: Integer): TBitmap;
    procedure Save(const FileName: string);

    property Author: string read write;
    property CreationDate: TDateTime read write;
    property Creator: string read write;
    property CustomMetadata[const FieldName: string]: string read write;
    property Document: JPDDocument read;
    property Encrypted: Boolean read;
    property Id: Int64 read write;
    property Information: JPDDocumentInformation read;
    property Keywords: string read write;
    property ModificationDate: TDateTime read write;
    property PageCount: Integer read;
    property Pages[Index: Integer]: TPdfPage read;
    property Producer: string read write;
    property Subject: string read write;
    property Title: string read write;
    property Version: Single read write;

  TPdfPage = class
    function CreateContentStream: TPdfPageContentStream;

    property ArtBox: TRectF read write;
    property BleedBox: TRectF read write;
    property CropBox: TRectF read write;
    property Document: TPdfDocument read;
    property MediaBox: TRectF read write;
    property Page: JPDPage read;
    property Rotation: TPdfRotation read write;
    property TrimBox: TRectF read write;

  TPdfPageContentStream = class
    procedure BeginText;
    procedure Clip;
    procedure ClipEvenOdd;
    procedure Close;
    procedure CloseAndStroke;
    procedure ClosePath;
    procedure CurveTo(X1, Y1, X2, Y2, X3, Y3: Single);
    procedure CurveTo(const Point1, Point2, Point3: TPointF);
    procedure CurveTo1(X1, Y1, X3, Y3: Single);
    procedure CurveTo1(const Point1, Point3: TPointF);
    procedure CurveTo2(X2, Y2, X3, Y3: Single);
    procedure CurveTo2(const Point2, Point3: TPointF);
    procedure EndText;
    procedure Fill;
    procedure FillEvenOdd;
    procedure Font(Font: TPdfFont; Size: Single);
    procedure Image(const FileName: string; X, Y: Single);
    procedure Image(const FileName: string; const Point: TPointF);
    procedure Image(const FileName: string; const Rect: TRectF);
    procedure MoveTo(X, Y: Single);
    procedure MoveTo(const Point: TPointF);
    procedure NewLine;
    procedure NewLineAtOffset(OffsetX, OffsetY: Single);
    procedure Leading(Leading: Double);
    procedure LineCapStyle(LineCapStyle: TPdfLineCapStyle);
    procedure LineJoinStyle(LineJoinStyle: TPdfLineJoinStyle);
    procedure LineTo(X, Y: Single);
    procedure LineTo(const Point: TPointF);
    procedure LineWidth(Width: Single);
    procedure NonStrokingColor(Color: TAlphaColor);
    procedure Rectangle(const Rect: TRectF);
    procedure RestoreGraphicsState;
    procedure SaveGraphicsState;
    procedure Stroke;
    procedure StrokingColor(Color: TAlphaColor);
    procedure Text(const Text: string);

    property Page: TPdfPage read;
    property Stream: JPDPageContentStream read;

  TPdfFont = class
    property Font: JPDFont read FFont;

    class property Courier: TPdfFont read;
    class property CourierBold: TPdfFont read;
    class property CourierBoldOblique: TPdfFont read;
    class property CourierOblique: TPdfFont read;
    class property Helvetica: TPdfFont read;
    class property HelveticaBold: TPdfFont read;
    class property HelveticaBoldOblique: TPdfFont read;
    class property HelveticaOblique: TPdfFont read;
    class property Symbol: TPdfFont read;
    class property TimesBold: TPdfFont read;
    class property TimesBoldItalic: TPdfFont read;
    class property TimesItalic: TPdfFont read;
    class property TimesRoman: TPdfFont read;
    class property ZapfDingbats: TPdfFont read;

  TPdfPageSize = class
    class property A0: TRectF read;
    class property A1: TRectF read;
    class property A2: TRectF read;
    class property A3: TRectF read;
    class property A4: TRectF read;
    class property A5: TRectF read;
    class property A6: TRectF read;
    class property Legal: TRectF read;
    class property Letter: TRectF read;

Download and order

Related links