Hi, does anyone know if there's RTF support for FCL-PDF?. Anyone working on this?.
Regards,

Mailing lists / lazarus / 2016-12
9 messages · 3 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi, does anyone know if there's RTF support for FCL-PDF?. Anyone working on this?.
Regards,
Leonardo M. Ramé wroteHi, does anyone know if there's RTF support for FCL-PDF?. Anyone working on this?.
Please explain what you mean by that - RTF support?
fcl-pdf is a PDF generator library, nothing more. It does what it says on the tin, with the API available to it (as per the PDF 1.3 specs). It's not a report engine, layouting engine etc. So it doesn't do text layouting (alignment, text inside a shape, text on a curve etc.) But, it does output text (and other graphic elements) where you tell it to, and how it should look and in what font.
eg: In the upcoming fpReport engine I do text layouting (doing all the line calculations and word positions in the report engine), and then simply pass that information to the PDF report renderer, which in turn tells fcl-pdf where to render want text.
Regards,
Graeme
You are right Graeme, I'm looking for a way to add an RTF file to a PDF. I need a report engine but I couln't find one that fit my needs.
Currently I'm using LibreOffice in headless mode for some projects, but this one cannot use it (because of memory constraints).
Is there a way to get the fpReport source?.
I can send you a preview, if you want.
Michael.
Yes, of course!, I'm eager to take a
Leonardo M. Ramé
http://leonardorame.blogspot.com
You are right Graeme, I'm looking for a way to add an RTF file to a PDF. I need a report…
Leonardo M. Ramé wroteI'm looking for a way to add an RTF file to a PDF.
In that case you need a RTF parser, and then interpret that into fcl-pdf API calls.
The tiOPF project (on SourceForge) has a RTF based reporting engine. It processes a template RTF file which contains tokens, and then produces a fully populate RTF report file as output. We also used to use OpenOffice (in read-only mode) to preview the generated report output - which actually worked very well. OpenOffice in read-only mode hides all editing functionality from the user interface, so it looked like a true "print preview" dialog. Anyway, the tiRtfReport.pas unit in tiOPF might have some code you could use to translate a RTF file into fcl-pdf API calls.
Regards,
Graeme
Hi Graeme, I use LibreOffice in headless mode to generate PDFs on-the-fly. My workflow is handled by a CGI who calls a Python script (needed for the UNO API) who loads a Libreoffice template with the header and footer, then it inserts the RTF and lastly output the PDF to STDOUT.
So, I don't really need a fully featured reporting engine, but just a way to "insert" an RTF file inside a PDF.
What I've been looking at is this
https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/rtfview/rtfview.pas, I think it shouln't be too difficult to replace its dependencies to TRichView and make it work with fcl-pdf.
Leonardo M. Ramé wroteHi Graeme, I use LibreOffice in headless mode to generate PDFs on-the-fly.
OpenOffice/LibreOffice headless mode is pretty cool. We used it often too. :)
So, I don't really need a fully featured reporting engine, but just a way to "insert" an RTF file inside a PDF.
I didn't mean to use the tiRtfReporter.pas unit as a reporting engine. I meant, you can cannibalise the code and grab what you need to suite your needs (translate RTF files into fcl-pdf API calls to render the text in a rich text manner when producing the PDF).
https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/rtfview/rtfview.pas, I think it shouln't be too difficult to replace its dependencies to TRichView and make it work with fcl-pdf.
That's pretty much what I meant with the tiOPF code. I guess either one will do.
Regards,
Graeme
I didn't mean to use the tiRtfReporter.pas unit as a reporting engine. I meant, you can cannibalise the code and grab what you need to suite your needs (translate RTF files into fcl-pdf API calls to render the text in a rich text manner when producing the PDF).
Great, I'll take a
Leonardo M. Ramé
http://leonardorame.blogspot.com