We help IT Professionals succeed at work.

linux convert text file to PDF

dory550
dory550 asked
on
411 Views
Last Modified: 2017-05-06
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
Comment
Watch Question

Natty GregIn Theory (IT)
CERTIFIED EXPERT

Commented:
Try using Cute PDF and make sure you download the ghost script file for it also

Author

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

 Dory
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
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.

Author

Commented:
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
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Technical EngeneerTechnical Support Specialist

Commented:
I usually transfer all text files to LibreOffice (or OpenOffice) and do File>Export as PDF. All formatting is saved perfectly.

Author

Commented:
@Arnold
Thank you for your help
Dory

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.