[Demo] Making PDF using Synopse PDF Engine

Demos, code samples. Only questions related to the existing topics are allowed here.
Post Reply
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

[Demo] Making PDF using Synopse PDF Engine

Post by Sergey Tkachenko »

Update 2017-Dec-4] TRichView setup now includes better version of this demo in <TRichViewDir>\ThirdParty\Export\SynPDF\Demos\RV2PDF\ folder. This better version reads all page properties from source RTF (or RVF) files and applies them to PDF, supports headers, footers, footnotes and endnotes, displays preview before exporting.
See http://www.trichview.com/forums/viewtop ... 951#p34100


This demo shows how to convert RTF and RVF files to PDF files using TRichView and SynPDF (Synopse PDF Engine)

Source code:
http://www.trichview.com/support/files/rvsynpdf.zip
Source code + exe file
http://www.trichview.com/support/files/rvsynpdfexe.zip


Image
UweM
Posts: 18
Joined: Wed Oct 04, 2006 5:30 pm
Location: USA

Re: [Demo] Making PDF using Synopse PDF Engine

Post by UweM »

Serge,

thanks a lot for that demo! Very interesting. Unfortuantely, it doesn't seem to work when I try to convert an RTF that contains a table with both text and images in the cells to PDF. The text shows up, but the images are not there.

Thanks
-Uwe
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please send this RTF to richviewgmailcom
LS_M
Posts: 81
Joined: Thu Sep 15, 2005 5:17 pm

Post by LS_M »

Hi all,

can't compile the demo with Delphi 5. I know Delphi 5 is rather old but serves my purpose.

The error, the only error, occurs in
TPageInfo = record
PageFormat: TPDFPaperSize;
PageSize: TSize;
DocRect: TRect;
end;
can't find TPDFPapersize

I can not find where TPDFPapersize is declared. Any pointer to a missing uses entry is appreciated.

Thank's in advance
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TPDFPapersize is defined in Synopse PDF Engine units, in SynPdf.pas
LS_M
Posts: 81
Joined: Thu Sep 15, 2005 5:17 pm

Post by LS_M »

Thank's Sergey for your fast reply. Unfortunately I was not clear in my question. The error is "undefined Height" which is in FPageInfo.PageSize.Height. So it says that it cant't find Height.

Thank's for your patience.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

For compatibility with older versions of Delphi, all occurrences of "PageSize.Height" must be changed to "PageSize.cy".
I fixed the source code.
LS_M
Posts: 81
Joined: Thu Sep 15, 2005 5:17 pm

Post by LS_M »

Hi Sergey,

again many thank's for quick support.
At the end I figured the replacement with FPageInfo.PageSize.cy out myself but thank you anyway.
To make it really work with Delphi 5 you need to change the uses of RVSynPDF.dpr as follows

uses
//Vcl.Forms,
Forms,
Windows,

at the bottom of RVSynPDF.dpr it needs to look like that

begin
Application.Initialize;
//Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

The hole demo works now like expected, thank you.

-Greetings
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: [Demo] Making PDF using Synopse PDF Engine

Post by Sergey Tkachenko »

TRichView setup now includes better version of this demo in <TRichViewDir>\ThirdParty\Export\LLPDFLib\Demos\RV2PDF\ folder. This better version reads all page properties from source RTF (or RVF) files and applies them to PDF, supports headers, footers, footnotes and endnotes, displays preview before exporting.
See http://www.trichview.com/forums/viewtop ... 951#p34100
Post Reply