Recent

Author Topic: Is there any support for PDF in Free Pascal?  (Read 577 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: 3913
  • My goal: build my own game engine using Lazarus
« Last Edit: September 29, 2020, 10:28:24 pm by Handoko »

jwdietrich

  • Hero Member
  • *****
  • Posts: 1154
    • 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.0.10 | FPC 3.2.0 | 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: 1068
  • 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.
o Lazarus v2.1.0 r63871, FPC v3.3.1 r47164, macOS 10.14.6, Xcode 11.3.1
o Lazarus v2.1.0 r64160, FPC v3.3.1 Nov 27 21:16:31, macOS 11.0.1 (aarch64), Xcode 12.2
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 20.04 (PD VM)

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