Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
I need some help with the most basic of tasks: converting txt to pdf from the command line. I believe that this is the proper code to convert a .txt file to .pdf:
To IM, the ".txt" format is a text list of pixel values, one pixel per line, with a header. If you want any arbitrary text file to be rendered as pixels, use the "TEXT:" prefix:
The result from the code above is a little, well, pixely. Also, the margins and justification are different from the original. (Ignore the blue background for the .txt file, that is just my reader settings).
If you want to extract the text then you need to do OCR. Imagemagick will only convert to raster format, not ascii text.
What Imagemagick saves to PDF it embeds the raster file in a PDF vector shell. But the default density for the PDF is not the same as that for the raster image. So when viewing the PDF you must tell it a proper density such as 72 dpi to view the same as the original.