Recent

Author Topic: Convert Plain text to pdf  (Read 3192 times)

DreamVB

  • Full Member
  • ***
  • Posts: 100
    • Memo Pad
Convert Plain text to pdf
« on: July 10, 2022, 10:35:40 pm »
Hi can someone help me I am looking for a way to convert text to PDF I am thinking of making a opensource program that takes a bunch of text files and makes one PDF file or a RTF file. I know how to do the RTF part but I want to add support for PDF to would this be possible in Lazarus to do? any help or directions will be great full thanks.
Dream Believe Achieve

jamie

  • Hero Member
  • *****
  • Posts: 7662
The only true wisdom is knowing you know nothing

RayoGlauco

  • Full Member
  • ***
  • Posts: 227
  • Beers: 1567
Re: Convert Plain text to pdf
« Reply #2 on: July 11, 2022, 12:18:34 am »
Any link to a lazpdf.lpk download?
I don't find it in the Blaise Pascal site.
To err is human, but to really mess things up, you need a computer.

Thausand

  • Hero Member
  • *****
  • Posts: 503
Re: Convert Plain text to pdf
« Reply #3 on: July 11, 2022, 12:26:37 am »
Is then not part of Free Pascal (or is other package) ? see https://www.freepascal.org/daily/packages/fcl-pdf/fppdf/index.html

VTwin

  • Hero Member
  • *****
  • Posts: 1227
  • Former Turbo Pascal 3 user
Re: Convert Plain text to pdf
« Reply #4 on: July 11, 2022, 03:34:35 pm »
I have used fppdf. It is part of FCL.
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 15.3.2: Lazarus 3.8 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 3.8 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 3.8 (64 bit on VBox)

VTwin

  • Hero Member
  • *****
  • Posts: 1227
  • Former Turbo Pascal 3 user
Re: Convert Plain text to pdf
« Reply #5 on: July 11, 2022, 03:48:46 pm »
Here is a small test project.
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 15.3.2: Lazarus 3.8 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 3.8 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 3.8 (64 bit on VBox)

RayoGlauco

  • Full Member
  • ***
  • Posts: 227
  • Beers: 1567
Re: Convert Plain text to pdf
« Reply #6 on: July 12, 2022, 12:04:32 am »
Thanks, VTwin. I tested your project. It works ok out of the box. No install needed.  :)
To err is human, but to really mess things up, you need a computer.

Kepsz

  • New Member
  • *
  • Posts: 37
Re: Convert Plain text to pdf
« Reply #7 on: February 19, 2026, 02:01:19 pm »
Here is a small test project.

Thank you!

I leave the link for the usable fonts here because it took me quite a while to figure out the name of a monospace font (Courier) that works with this code. https://www.fpdf.org/en/doc/setfont.htm

cdbc

  • Hero Member
  • *****
  • Posts: 2727
    • http://www.cdbc.dk
Re: Convert Plain text to pdf
« Reply #8 on: February 19, 2026, 02:21:11 pm »
Hi
It's an Adobe format, so......
Regards Benny

NOTE: The built-in fonts are __not__ happy with unicode codepoints / characters, e.g.: Ñëß© æøå ÆØÅ ÜÖÄ üöä and ofc. many asian and other exotic languages...!
« Last Edit: February 19, 2026, 02:27:02 pm by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

 

TinyPortal © 2005-2018