Synopse PDF Engine
Synopse PDF Engine is an Open Source PDF document creation library for Delphi, embedded in one unit.It's used e.g. in our mORMot framework, for creating PDF files from reports.
But you can use it stand-alone, without our main ORM/SOA framework.
Features
- Pure Delphi code, with no external .dll, and adding very small code size to your executable;
- Targets Delphi 5 up to Delphi 10.2 Tokyo, for Win32 and Win64 platforms, with full source code provided;
- Includes most vectorial drawing commands, including text,lines or curves;
- Renders bitmaps, and metafiles (even most .emf files with clipping and regioning);
- Introduce metadata, bookmarks and outline information;
- Produce very small .pdf files;
- Optionally encrypt and secure the .pdf content using 40 bit or 128 bit keys;
- Fast file generation with low memory overhead (tested with several thousands of pages);
- Access a true VCL
TCanvas
instance to create the PDF content; - Optionally embed True Type fonts subsets;
- Unicode ready, even with pre-Unicode versions of Delphi, including advanced Uniscribe Glyph shading and Font fallback;
- Can publish PDF/A-1 archive files;
- Used in a lot of applications, with regular enhancements, mainly from active end-users;
- Licensed under a MPL/GPL/LGPL tri-license.
Download
Latest version is available directly from github.com/synopse/SynPDF - just clone the repository, or click on the "Download" button.
As an alternative, you may download the main mORMot trunk, which contains all needed files for all platforms and compilers. If you plan to use some other part of Synopse libraries, consider using the whole mORMot framework, which contains the Synopse PDF Engine and much more, and is actively maintained.
Sample code
In fact, you have at least three ways of generating pdfs using the library:
- Directly call of a
TPdfCanvas
as published by aTPdfDocument
instance - this is the most direct but also more difficult way of rendering; - Use
TMetaFile
driven content - seeTPdfDocumentGDI.VCLCanvas
property and theTPdfCanvas.RenderMetaFile
method - this is very easy if you want to use "regular"TCanvas
methods to draw the page content, especially if you have some existing printing code; - Use
TGDIPages
of unitmORMotReport
to easily create the content from code, with some report-oriented methods (including complex rtf withTGDIPages.AppendRichEdit
) - for basic reporting features, it is pretty much the solution.
The 2nd and 3rd ways are preferred, for most applications.
Documentation
For detailed documentation of the unit, see the corresponding page in the API reference of mORMot official documentation, or directly in the interface part of the unit, as methods comments.
See also the associated mORMotReport.pas unit and the report generation description in the SynFile Main Demo description.
Dedicated blog and forum
A blog is available at http://blog.synopse.info, and will notify any evolution of this component.A forum thread is dedicated to this component, and is available on https://synopse.info.
This is the main entry point for support: first search for an existing answer, then ask your question in a new thread.