#1 2011-02-08 20:43:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Synopse PDF Engine 1.12

Our SynPdf unit has been refreshed to the 1.12 version.

The main enhancements are:

- Can now generate PDF/A-1 files;
- Direct methods for creating bookmarks, links and document outline;
- Document information can now be Unicode encoded;
- The bitmaps can be cached and reused  if drawn multiple times;
- Some corrected issues.

Here are the detailed modifications (extracted from SynPdf.pas):

- can now generate PDF/A-1 files if the new PDFA1 property is set to true
- new CreateLink and CreateBookMark methods for TPdfDocument, to easily handle bookmarks and links
- new CreateOutline method for TPdfDocument, for direct outline adding
- new TPdfPage.PageLandscape and TPdfDocument.DefaultPageLandscape properties
- can use EMR_GDICOMMENT to embedd some SynPDF related data (like bookmarks, links, and document outline) in the source TMetaFile - used by TSQLite3Pages
- new TPdfTextString class, used to handle Unicode parameters (e.g. in TPdfInfo, which properties are now handling unicode encoding as expected)
- new CreateOrGetImage method to easily add a bitmap to the page, with internal caching: if the same bitmap content is sent more than once, only one TPDFImage will be used (used for emf enumeration, e.g. SQLite3Pages)
- now handle justified text from metafile (i.e. call to SetTextJustification Windows API will change the PDF word space as expected)
- Uniscribe API now made public (and documented as such), for TRenderPages
- fixed memory leak in TPdfOutlineRoot.Create
- fixed issue in TPdfDocumentGDI.VCLCanvasSize
- fixed issue with fixed-width font unicode characters display
- FontSub.dll library is loaded only once for the whole application

Compatible with Delphi 6 up to Delphi XE.

Source code released under GPL/LGPL/MPL license, on choice.
That means: free, like a bird, and like a beer.

You can download it from http://synopse.info/files/pdf/synpdf.zip
or from the main SQLite3 framework daily archive.

Offline

#2 2011-02-09 05:16:14

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Synopse PDF Engine 1.12

Thank you for your continual updates for this PDF lib!

And I wish I can use it to extract PDF meta data.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#3 2011-02-09 07:32:52

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Synopse PDF Engine 1.12

edwinsn wrote:

And I wish I can use it to extract PDF meta data.

If I understand you well, you want to read an existing PDF file.

You'll have to write a PDF parser first!
See http://synopse.info/fossil/tktview?name=4e8685d8a3

Offline

#4 2011-02-09 16:15:51

hansklok
Member
Registered: 2011-02-09
Posts: 3

Re: Synopse PDF Engine 1.12

Hi,

how can i create multiline textdocuments, about 2 pages (autobreak textbox, if a page ends)?

greetings

Offline

#5 2011-02-09 17:20:37

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Synopse PDF Engine 1.12

SynPdf is very low-level, and is intended to create the PDF document using a Canvas.

Just use the SQLite3Pages unit for creating a multiline text document, with auto creation of the next page.

You can use the TGDIPages as a report generator, then export the PDF directly with its ExportPDF method, without no preview.
But since TGDIPages is also a preview component, you can use it to preview and browse the content before the PDF creation.

See http://synopse.info/forum/viewtopic.php?pid=1304#p1304

Offline

#6 2011-02-10 21:16:36

hansklok
Member
Registered: 2011-02-09
Posts: 3

Re: Synopse PDF Engine 1.12

Thanks, works fine. And how to change the Page Margins? I tried to edit the TGDIPage(Self). Margins, but there is no difference between the output PDF before changing and after!

Thanks...Greetings

Offline

#7 2011-02-11 07:23:21

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Synopse PDF Engine 1.12

You should set the margins before putting some text in, and after BeginDoc method call.

The following code will set 3 cm margins for the page:

procedure TForm1.btn1Click(Sender: TObject);
var i: integer;
    Bmp: TBitmap;
    s: string;
    Marg: TRect;
begin
  Bmp := TBitmap.Create;
  try
    Bmp.Width := ClientWidth;
    Bmp.Height := ClientHeight;
    PaintTo(Bmp.Canvas,0,0); // create some bitmap content
    with TGDIPages.Create(self) do
    try
      // the name of the report is taken from main Window's caption
      Caption := self.Caption;
      // now we add some content to the report
      BeginDoc;
      Marg.Left := 30;
      Marg.Top := 30;
      Marg.Right := 30;
      Marg.Bottom := 30;
      PageMargins := Marg;
      // header and footer
      Font.Name := 'Georgia';
      Font.Size := 11;
      SaveLayout;
   .....

Or

    PageMargins := Rect(30,30,30,30);

Offline

#8 2011-02-11 10:40:44

hansklok
Member
Registered: 2011-02-09
Posts: 3

Re: Synopse PDF Engine 1.12

Thank you so much, i tried it before, but there was just an error. But now it works.

Synopse PDF Engine is definitely the best freeware PDF engine for Delphi, thanks for your great work.

You can be sure, that was not my last question, be sure ;-)

Greetings

Offline

#9 2014-09-08 17:11:00

MaddoxDeluxe
Member
Registered: 2014-09-08
Posts: 2

Re: Synopse PDF Engine 1.12

Thanks a lot for Synopse PDF Engine, works very good with Absolute Database Engine. It did not take much work at all just to get a database report from the grid to work.


Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

Offline

Board footer

Powered by FluxBB