Code Monkey home page Code Monkey logo

synpdf's Introduction

SynPDF

Synopse PDF engine is a fully featured Open Source PDF document creation library for Delphi and FPC, embedded in one unit.

It's used e.g. in our mORMot framework, for creating PDF files from generated reports. But you can use it stand-alone, without our main ORM/SOA framework.

If you download the whole mORMot source code, you do not need this separate package: ensure you get rid of any existing separated SynPDF installation, and use the PDF units as available in the main mORMot trunk. This SynPDF distribution/GitHub account targets only people needing PDF writing, without other mORMot features, under Delphi (some files may be missing for FPC).

If you plan using any part of the framework (e.g. SynLog, SynDB or the ORM/SOA), don't use this repository, but use the main mORMot framework. Having the two repositories on the same environement may be a source of unexpected version conflict. Just use and trust the main mORMot repository, which will be updated much more often.

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 (and latest version of FPC), 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.

Sample code

In fact, you have at least three ways of generating pdfs using the library:

  • Directly call of a TPdfCanvas as published by a TPdfDocument instance - this is the most direct but also more difficult way of rendering;
  • Use regular VCL TCanvas methods thanks to TMetaFile support - see TPdfDocumentGDI.VCLCanvas property and the TPdfCanvas.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 the supplied mORMotReport.pas unit (extracted from our mORMot ORM/SOA framework) to easily create the content from code, with some report-oriented methods (including complex rtf with TGDIPages.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 pages in the "Software Architecture Document" of mORMot official documentation, or directly in the interface part of the unit, as methods comments.

Including the report generation pages within 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 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.