Recent

Author Topic: fpPDF questions  (Read 4886 times)

Aidex

  • Jr. Member
  • **
  • Posts: 82
fpPDF questions
« 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

xos

  • Newbie
  • Posts: 5
Re: fpPDF questions
« Reply #1 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.

af0815

  • Hero Member
  • *****
  • Posts: 1289
Re: fpPDF questions
« Reply #2 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.
« Last Edit: May 17, 2021, 11:35:24 am by af0815 »
regards
Andreas

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: fpPDF questions
« Reply #3 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

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: fpPDF questions
« Reply #4 on: May 17, 2021, 03:37:11 pm »

 

TinyPortal © 2005-2018