Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-12

FCL-PDF and RTF Support

9 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys
to Leonardo M. Ramé
Leonardo M. Ramé wrote
Hi, 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

Reply by email

Leonardo M. Ramé
to Graeme Geldenhuys
Graeme Geldenhuys wrote 21 lines
On 2016-12-09 11:02, Leonardo M. Ramé via Lazarus wrote: > Hi, 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?.

Reply by email

Michael Van Canneyt
to Leonardo M. Ramé
Leonardo M. Ramé wrote 32 lines
El 09/12/16 a las 08:52, Graeme Geldenhuys via Lazarus escribió: > On 2016-12-09 11:02, Leonardo M. Ramé via Lazarus wrote: >> Hi, 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.

Reply by email

Leonardo M. Ramé
to Michael Van Canneyt
Michael Van Canneyt wrote 43 lines
On Fri, 9 Dec 2016, Leonardo M. Ramé via Lazarus wrote: > > > El 09/12/16 a las 08:52, Graeme Geldenhuys via Lazarus escribió: >> On 2016-12-09 11:02, Leonardo M. Ramé via Lazarus wrote: >>> Hi, 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

Reply by email

Graeme Geldenhuys
to Leonardo M. Ramé: 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é 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.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Leonardo M. Ramé
to Graeme Geldenhuys
Graeme Geldenhuys wrote 15 lines
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.

Reply by email

Graeme Geldenhuys
to Leonardo M. Ramé
Leonardo M. Ramé wrote
Hi 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

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email