Lazarus

Programming => Packages and Libraries => Topic started by: Aidex on April 22, 2021, 06:06:37 am

Title: fpPDF questions
Post by: Aidex on April 22, 2021, 06:06:37 am
Hi!
I have a few beginner questions about fpPDF (fcl-pdf).
I tried fpPDF for the first time today and I'm glad it exists. :)

1) Is there already a helper function to write a table/spreadsheet (text content only) into a PDF?

2) Is it correct that fpPDF does not have a Canvas yet?
So I couldn't use my existing program parts for canvas drawings?

3) Has anyone tried rendering HTML into a PDF? (or alternatively to a Canvas?)

Thanks in advance for your answers.
Regards, Jörg
Title: Re: fpPDF questions
Post by: xos on May 17, 2021, 11:12:49 am
I have already tried with fpPdf. I asked myself the same questions.
Unfortunately, the current fpPDF does not yet have a canvas, but more painful is that the inclusion of TTF fonts is only rudimentarily solved. For my project I should be able to include any installed fonts (Win). As I understand it, the TTF font must now be in the output directory.
Without the complete inclusion of all installed TTF fonts I can not port my project from Delphi to Lazraus.
Title: Re: fpPDF questions
Post by: af0815 on May 17, 2021, 11:32:51 am
Maybe you can look in the sources of fpreport. There is a Manager for the fonts. You have to read the fonts at startup, but this reading of the fonts can be done often automatic, because the most known directories of the font are scanned. If you have other directories you have to specify this.

From the sample (in Lazarus examples)
Code: Pascal  [Select][+][-]
  1. procedure TFrmSimpleReportLCL.FormActivate(Sender: TObject);
  2. begin
  3.   if not FInit then begin
  4.     gTTFontCache.ReadStandardFonts;
  5.     gTTFontCache.BuildFontCache;
  6.    .....
  7.     FInit:= true;
  8.   end;
  9. end;
  10.  
And function gTTFontCache: TFPFontCacheList  is in fpTTF.

Then you can search for fonts or families and more. In fpreport this is used for the pdf-renderer as well.
Title: Re: fpPDF questions
Post by: winni on May 17, 2021, 03:31:13 pm
Hi!

I  think he is talking about the ability to embedd Fonts - a big advantage of PDF, because of that the PDF file can be used a data exachange format for graphic stuff. No matter if a font is installed at the destination. Stolen from PostScript.

Winni
Title: Re: fpPDF questions
Post by: marcov on May 17, 2021, 03:37:11 pm
https://bugs.freepascal.org/view.php?id=30116 ?
TinyPortal © 2005-2018