[Lazarus] FCL-PDF and RTF Support

Leonardo M. Ramé l.rame at griensu.com
Fri Dec 9 16:23:50 CET 2016



El 09/12/16 a las 12:15, Graeme Geldenhuys via Lazarus escribió:
> On 2016-12-09 12:00, Leonardo M. Ramé via Lazarus wrote:
>> I'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.
>

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é
http://leonardorame.blogspot.com


More information about the Lazarus mailing list