Recent

Author Topic: Is there any support for PDF in Free Pascal?  (Read 2390 times)

anyone

  • Guest
Is there any support for PDF in Free Pascal?
« on: September 29, 2020, 10:07:09 pm »
Hi all, I am new to this forum.

I wonder if it is worth to create a command-line utility txt2pdf... In fact, I have already started working on it. So it would not make much sense for me to continue working on it if Free Pascal already has built-in support for PDF.




Handoko

  • Hero Member
  • *****
  • Posts: 5130
  • My goal: build my own game engine using Lazarus
« Last Edit: September 29, 2020, 10:28:24 pm by Handoko »

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: Is there any support for PDF in Free Pascal?
« Reply #2 on: September 29, 2020, 10:59:13 pm »
You should also observe the licenses of the existing tools, which may pose restrictions on the mode of distribution of your code.

Additionally, you might want to check out https://foundation.freepascal.org/projects/project-6 and https://foundation.freepascal.org/projects/reporting-engine for information on projects currently being developed.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

anyone

  • Guest
Re: Is there any support for PDF in Free Pascal?
« Reply #3 on: September 29, 2020, 11:50:09 pm »
Thank you, @Handoko and @jwdietrich.

"A reporting engine [with PDF support] that does not have GUI dependencies" is something I was looking for.

Though, I just need to convert plain text file into PDF file. In the mean time, I think I will just stick to my own txt2pdf by looking up PDF File Format 1.7 Specification.

However, it is good to know that professional PDF libraries for Free Pascal are available or going to be officially made available.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Is there any support for PDF in Free Pascal?
« Reply #4 on: September 30, 2020, 01:47:54 am »
There is already a wide selection of text to PDF command line tools for both Windows and UNIX or UNIX-like operating systems with source, though they are generally written in C and have varying licences.

anyone

  • Guest
Re: Is there any support for PDF in Free Pascal?
« Reply #5 on: September 30, 2020, 10:50:04 am »
There is already a wide selection of text to PDF command line tools for both Windows and UNIX or UNIX-like operating systems with source, though they are generally written in C and have varying licences.

Thanks for this useful information.  I hope I am not reinventing the wheel because someone has already done it before.

I am not sure about those command-line tools written in C, but from my initial finding, quite a number of open-source  software (regardless of the platform) are using PdfBox (and its Android port), or iText. Even my resume created with a mobile app was produced by iText (as shown in metadata section).

It is not difficult just to convert plain text into PDF programmatically after a few attempts (without using third-party library) although it would be much complicated to generate multi-page PDF (if input text file is long enough).

 

 

TinyPortal © 2005-2018