Thread: Convert text file to pdf

  1. #1
    Registered User
    Join Date
    Dec 2022
    Posts
    3

    Convert text file to pdf

    Hello Everybody.
    Is there a library for C to convert a txt file to a pdf file?
    I have been searching for a while but i just find stuff for C# and C++.
    Thanks a lot for every help.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,663
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Dec 2022
    Posts
    3
    Thanks for this link but i do not understand it.
    Then, the program will not work if ghostscript in not installed.
    Maybe there is a way to convert text to pdf without using system-commands?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,663
    Ghostscript is both a library and a program.
    Ghostscript is the name of a set of software that provides:
    An interpreter for the PostScript language and the PDF file format,
    A set of C procedures (the Ghostscript library) that implement the graphics capabilities that appear as primitive operations in the PostScript language, and
    A wide variety of output drivers for various file formats and printers.
    > Maybe there is a way to convert text to pdf without using system-commands?
    Well PDF is a complicated beast.
    Either you deal with all that complication yourself by interacting with the library, or you take the simple approach by using system commands that trade flexibility for convenience.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Dec 2022
    Posts
    3
    ok. Thanks a lot for your help. Will read more about it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 10-26-2017, 02:58 PM
  2. Replies: 9
    Last Post: 01-21-2014, 10:44 PM
  3. read txt file as binary then convert to text
    By 911help in forum C Programming
    Replies: 2
    Last Post: 01-04-2008, 06:29 AM
  4. Convert a text file to a binary file
    By Cyber Kitten in forum C Programming
    Replies: 16
    Last Post: 02-04-2002, 08:53 AM

Tags for this Thread