Link to home
Start Free TrialLog in
Avatar of dory550 lambert
dory550 lambertFlag for United States of America

asked on

linux convert text file to PDF

Hi guys
I need to convert multi-page text files (invoices or orders)  to pdf
I tried using enscript & ps2pdf but was succesful only with one-page invoices
Multi-page invoices were a problem because program ignores formfeed character and resulting with a pdf file with various page lengths.
Can anyone suggest a solution?
Thanks
Dory
Avatar of Natty Greg
Natty Greg
Flag of Canada image

Try using Cute PDF and make sure you download the ghost script file for it also
Avatar of dory550 lambert

ASKER

Natty Greg
 
Cute PDF is a windows software
 I am using Linux
 "linux convert text file to PDF"

 Dory
What generates the invoice, could you output them directly into PDF using php,perl?
Another option to output invoices j HTML format and then convert it to PDF.
Look at configuring a PDF printer filter, Enscript.  What issues do you run into with multiple pages?
It might be a set of options you need to pass.
The issue with various page sizes is that when printed, the page header does not always appear at the head of the page as it should.
for example a 4 pages text file ends up as a 3 pages pdf page where  headers and footers are not properly spaced and are crammed  into a 33 inch space  instead of 44 inches  (4 x 11 =44 inches)
redesigning the invoices to html or Perl is not on the table at this stage of the game.
I think what makes sense here is how to change  the enscript configuration file to compensate for this problem
Dory
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I usually transfer all text files to LibreOffice (or OpenOffice) and do File>Export as PDF. All formatting is saved perfectly.
@Arnold
Thank you for your help
Dory