Recent

Author Topic: pdf creation  (Read 2996 times)

Blestan

  • Sr. Member
  • ****
  • Posts: 461
pdf creation
« on: July 22, 2016, 04:03:16 pm »
hi!
any pdf creation unit in the packages of fpc 3.0?
Speak postscript or die!
Translate to pdf and live!

peshte

  • New Member
  • *
  • Posts: 13
Re: pdf creation
« Reply #1 on: July 24, 2016, 11:39:36 am »
Hi.

I generate HTML files and convert them to pdf with http://wkhtmltopdf.org
For simplicity, I use HTML templates and just replace variables.

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: pdf creation
« Reply #2 on: July 24, 2016, 11:54:19 am »
fcl-pdf - look for other related discussionsin the forum here. It is available in fpc 3.01 and 3.1.1, but works also in 3.0.

Middlecope

  • Jr. Member
  • **
  • Posts: 92
Re: pdf creation
« Reply #3 on: July 24, 2016, 10:00:37 pm »
On a linux machine I installed CUPS-PDF
Now I can write to a VirtualPrinter.
The actual created PDF file can be found in the directory that you specified in /etc/cups/cups-pdf.conf
under Out     In my case "Out  {$HOME}/Documents"
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. CONST  printerpad = 'Documents';
  3.   BEGIN
  4.   naam:= 'Doc__' + GetEnvironmentVariable('USER') + '_Documents.pdf';
  5. //Optional
  6.   DeleteFile(printerpad + '/' + naam);
  7. Printer.SetPrinter('Virtual_PDF_printer');
  8. Printer.Title:= 'Doc';
  9. Printer.BeginDoc;
  10. // Your code
  11. Printer.EndDoc;
  12. //Optional:
  13. SysUtils.ExecuteProcess(UTF8ToAnsi('/usr/bin/okular'),printerpad + '/' + naam, []);
  14. end;
I don't know much about MS Windows. CUPS is Unix specific.
Try using PDFCreator as printer in Windows

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: pdf creation
« Reply #4 on: August 09, 2016, 02:45:07 pm »
fcl-pdf - look for other related discussionsin the forum here. It is available in fpc 3.01 and 3.1.1, but works also in 3.0.
fcl-pdf works with FPC 2.6.4 as well.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

 

TinyPortal © 2005-2018