Delphi 7 to 13 & C++ Builder No DLLs

sgcPDF, a Pure Pascal PDF Library for Delphi & C++ Builder

Create, edit, view, render, extract, encrypt, sign, redact and validate PDF files with components written entirely in Object Pascal. There is no DLL to deploy and no external PDF engine: the parser, writer, fonts, image decoders, renderers and cryptography are compiled into your application. The core runs on Windows, Linux, macOS, iOS and Android, with a VCL viewer control, a FireMonkey viewer and a raster renderer for servers. Full source code is included.

Full source code
Windows, Linux, macOS, iOS & Android
Delphi 7 → 13, C++ Builder
Zero External Dependencies
15 components sgcPDF_*.pas PDF 1.0 to 2.0, read and write, in pure Object Pascal.
Create TsgcPDFDocument
Edit TsgcPDFEditor
View TsgcPDFViewerControl
Extract TsgcPDFTextExtractor
Sign PAdES B-B to B-LTA
PDF/A & PDF/UA TsgcPDFAValidator
Redact TsgcPDFRedactor
15 Palette components Document, editor, viewers, extractors, signing
0 DLLs to deploy Parser, renderer, fonts and crypto in Pascal
5 Operating systems Windows, Linux, macOS, iOS, Android
6 PDF/A conformance levels PDF/A-1, 2 and 3, levels a and b, plus PDF/UA-1

Three Things Worth Knowing First

Nothing to install on the target machine

sgcPDF does not wrap PDFium, Ghostscript, a COM server or any other native library. Parsing, writing, font embedding and subsetting, image decoding, rendering, encryption and signing are implemented in the sgcPDF_*.pas units, so your executable is the whole deployment.

The core units have no VCL or FMX dependency, so the same code runs in a console tool, a Windows service, a Linux daemon or a web server.

Platform scope

Which parts run where

Creation, editing, text and image extraction, forms, encryption, signatures, redaction, PDF/A and the raster renderer compile for Windows and Linux64, and for macOS, iOS and Android. The GDI renderer, the exporter and the VCL viewer controls are Windows only, and TsgcPDFViewerFMX covers Windows, macOS, iOS and Android.

Advanced signatures

PAdES through sgcSign, basic signing built in

sgcPDF signs and verifies PDF files on its own with a PFX certificate. For PAdES baseline levels B-B, B-T, B-LT and B-LTA, and for keys held in smart cards, the Windows certificate store or cloud HSMs, the optional TsgcPDFPAdESSigner bridge uses the key providers of sgcSign, which is licensed separately.

One Library for the Whole PDF Lifecycle

From the first page you write to the signed, archived and redacted file you hand over, every step runs in the same Object Pascal code base.

Create: Documents from code, HTML or a canvas

Pages, text in the 14 standard fonts or embedded and subset TrueType and OpenType fonts, images (JPEG, PNG, BMP, TIFF), lines, curves, gradients, tables that flow across pages, barcodes and QR codes, annotations, bookmarks and optional content layers. TsgcPDFHTMLRenderer turns HTML with CSS into paginated PDF, and TsgcPDFCanvas and EMF playback convert existing drawing code.

See the features →

Edit: Change files you did not write

Watermarks, headers, footers, page numbers and stamps, merge and split, extract, insert, delete, rotate and reorder pages. Incremental save appends a new revision to the original file, which keeps earlier signatures valid.

See the features →

View & render: VCL and FMX viewers, plus a server renderer

A VCL viewer control with thumbnails, outline, text selection, search, form filling and printing, a FireMonkey viewer for Windows, macOS, iOS and Android, and a pure Pascal raster renderer that turns pages into PNG on Windows and Linux servers with no GDI.

See the features →

Extract: Text, positions and images

Plain text per page or for the whole document, text fragments with coordinates, font and size, and the images of a page decoded to PNG, JPEG or BMP. Decoders cover Flate, LZW, ASCII85, RunLength, JPEG (baseline and progressive), JPEG 2000, CCITT G3/G4 and JBIG2.

See the features →

Secure & sign: Encryption, signatures, redaction

RC4 40/128, AES-128 and AES-256 password encryption, certificate (public key) encryption, digital signatures with visible fields and timestamps, PAdES B-B, B-T, B-LT and B-LTA through the sgcSign bridge, signature verification, and true redaction that removes content instead of covering it.

See the features →

Comply: PDF/A, PDF/UA, tagged PDF, Factur-X

PDF/A-1, PDF/A-2 and PDF/A-3 output in levels a and b with a built in validator, tagged PDF with a structure tree and alternate text, PDF/UA-1 checks, embedded files with PDF/A-3 relationships, and Factur-X, ZUGFeRD and XRechnung e-invoice embedding.

See the features →

A Few Lines of Delphi

Every sample on this page is taken from a program that was compiled against the sgcPDF sources and run. Coordinates are in PDF points (1/72 inch) with the origin at the bottom left corner of the page.

procedure CreateHelloPDF(const AFileName: string);
var
  oPDF: TsgcPDFDocument;
  oPage: TsgcPDFPage;
begin
  oPDF := TsgcPDFDocument.Create;
  try
    oPDF.Info.Title := 'Hello sgcPDF';
    // A4 portrait: 595 x 842 points, origin at the bottom left corner
    oPage := oPDF.AddPage(595, 842);
    oPage.DrawTextColor('Hello sgcPDF', 50, 780, sfHelveticaBold, 24, 0, 0.2, 0.6);
    oPage.DrawLine(50, 770, 545, 770, 1.5);
    oPage.DrawText('A PDF written in pure Pascal.', 50, 740, sfHelvetica, 12);
    oPDF.SaveToFile(AFileName);
  finally
    oPDF.Free;
  end;
end;
procedure StampExistingPDF(const AInput, AOutput: string);
var
  oEditor: TsgcPDFEditor;
  oWatermark: TsgcPDFWatermarkOptions;
begin
  oEditor := TsgcPDFEditor.Create;
  try
    oEditor.LoadFromFile(AInput);
    oWatermark.Text := 'CONFIDENTIAL';
    oWatermark.Font := sfHelveticaBold;
    oWatermark.FontSize := 48;
    oWatermark.Rotation := 45;
    oWatermark.Opacity := 0.3;
    oWatermark.R := 0.5;
    oWatermark.G := 0.5;
    oWatermark.B := 0.5;
    oEditor.AddWatermarkAllPages(oWatermark);
    oEditor.AddPageNumbers(sfHelvetica, 10, 'Page %d of %d');
    oEditor.SaveToFile(AOutput);
  finally
    oEditor.Free;
  end;
end;
procedure PrintAllText(const AFileName: string);
var
  oPDF: TsgcPDFDocument;
  i: Integer;
begin
  oPDF := TsgcPDFDocument.Create;
  try
    oPDF.LoadFromFile(AFileName);
    for i := 0 to oPDF.PageCount - 1 do
      WriteLn(string(oPDF.ExtractTextW(i)));
  finally
    oPDF.Free;
  end;
end;
procedure RenderPageToPNG(const APDFFile, APNGFile: string; ADPI: Integer);
var
  oPDF: TsgcPDFDocument;
  oRenderer: TsgcPDFRendererRaster;
  oPage: TsgcPDFPage;
begin
  oPDF := TsgcPDFDocument.Create;
  try
    oPDF.LoadFromFile(APDFFile);
    oPage := oPDF.Pages[0];
    // pure Pascal rasterizer: no GDI, runs on Windows and Linux servers
    oRenderer := TsgcPDFRendererRaster.Create;
    try
      oRenderer.RenderPageToPNG(oPDF.Parser, oPage.PageDict,
        Round(oPage.Width * ADPI / 72), Round(oPage.Height * ADPI / 72),
        APNGFile);
    finally
      oRenderer.Free;
    end;
  finally
    oPDF.Free;
  end;
end;

15 Components on the sgcPDF Palette

Drop them on a form or a data module, or create them in code. Every component is also usable without a form, from console applications and services.

All components

Trial and Licensing

sgcPDF is a new product. Contact eSeGeCe to request a trial or a quote. Like every eSeGeCe library, the license includes full source code.

sgcPDF

  • All 15 components and the sgcPDF_*.pas units
  • Delphi 7 to 13 and C++ Builder
  • Windows, Linux, macOS, iOS and Android
  • Full source code

Other Products by eSeGeCe

Pair sgcPDF with our other Delphi and C++ Builder component libraries.

sgcSign

Enterprise digital signatures. XAdES, PAdES, CAdES and ASiC with 10 key providers and 21 EU country profiles.

Learn more →

sgcWebSockets

Enterprise WebSocket, HTTP/2, MQTT, AMQP and WebRTC components for Delphi, C++ Builder and .NET.

Learn more →

sgcHTML

Server-side HTML and UI components for Delphi and C++ Builder, built on Bootstrap and htmx.

Learn more →

sgcCrypto

Modern cryptography in pure Object Pascal: AES-GCM, SHA-3, Ed25519, X.509 and post-quantum ML-KEM and ML-DSA.

Learn more →
3,000+Developers
20+Years
761+Components
30+API Integrations
5Platforms
30-Day Money-Back GuaranteeNot satisfied? Request a full refund within 30 days of purchase. See refund policy

PDF Without the DLL

Create, view, sign and archive PDF files from the Delphi and C++ Builder code you already have.