Text to pdf


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Text to pdf
# 1  
Old 12-24-2014
Text to pdf

Is there a way to covert te attached text file to a pdf?

I have tried:
Code:
 enscript-p output.ps article.txt

PRE.cjk { font-family: "WenQuanYi Micro Hei",monospace; }PRE.ctl { font-family: "Lohit Hindi",monospace; }P { margin-bottom: 0.08in; }
Code:
awk '{ A[$1]=$2; next} END { for (i in A) print "mv\x27"A[i]"\x27",i".pdf" }' article.txt | sh

[/CODE]

Thank you Smilie.
# 2  
Old 12-24-2014
I dunno what you're doing exactly.

Linux and several other flavors have:
Consider using a2ps, and ps2pdf. Convert text to ps first with a2ps, then convert the output of that to pdf with ps2pdf.

Note: you may have ps2pdf13 or something like that. The "13" part refers to the version of pdf, in this example version 1.3. You want the latest version, maybe 13 or 14.
# 3  
Old 12-24-2014
I am not quite sure how to properly run the commands. I am just trying to take the article.txt which is a publication downloaded in text format and make it a pdf.

It sounds like
Code:
 a2ps

followed by
Code:
 ps2pdf

will do but I am not sure of the correct syntax. Thank you Smilie.

I also tried:
Code:
 enscript -B --margins=10:10: -o outputfile.ps -f Courier@7.3/10 article.txt
$ ps2pdfwr outputfile.ps new.pdf
$ rm outputfile.ps

and attached the output. [/CODE]

Thank you Smilie.
# 4  
Old 12-24-2014
Actually, I think your main problem is that the original file is UCS2-LE. And you may need plain ascii to use most tools, but you could convert to UTF-8 and then load and print to pdf using a browser (just an example). Shoot... you could actually do that using the UCS original file.

Anyway, to convert (for example) from UCS2-LE to UTF-8 you could do:

Code:
iconv -f UCS-2LE -t UTF-8 -o article-utf8.txt article.txt

Of course, you need iconv on your platform. But who knows, maybe the view and print from browser (e.g. Firefox) would work in your case?

Hope this gets you pointed in the right direction.
# 5  
Old 12-24-2014
UCS2-LE is UTF-16. How did you see that - the sample was straight text?
This User Gave Thanks to jim mcnamara For This Post:
# 6  
Old 12-24-2014
Actually, I just used the file command and saw it was UTF-16 Little-endian
This User Gave Thanks to cjcox For This Post:
# 7  
Old 12-24-2014
Thank you Smilie.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. HP-UX

Best text to pdf converter for Hp/UX 11.31

Hi, Can anyone tell me the best converter I can use to convert text to pdf for HP/UX 11.31? Thanks, Linda (0 Replies)
Discussion started by: lnemitz
0 Replies

2. Post Here to Contact Site Administrators and Moderators

Best text to pdf converter for UNIX hp/ux 11.31

Hi, Can anyone tell me the best text to pdf converter? I need to convert several text files to pdf. :)I'm looking to evaluate any products before I purchase. thanks, Linda (1 Reply)
Discussion started by: lnemitz
1 Replies

3. Shell Programming and Scripting

Pdf to text

Is there a way using the pdf to text utility to convert all the pdf in a given directory? So instead of one at a time: pdftotext pdftotext hp-manual.pdf hp-manual.txt a directory of 50 pdf files would be converted: pdftotext /home/dnascopev/Desktop/PDF.pdf /home/dnascopev/Desktop/PDF.txt ... (6 Replies)
Discussion started by: cmccabe
6 Replies

4. UNIX for Advanced & Expert Users

PDF to Text Conversion

Hi Guys, My OS is Suse Linux.. Is there a Command to convert PDF file to Text?? Cheers!!!!! (2 Replies)
Discussion started by: mac4rfree
2 Replies

5. Red Hat

create pdf of text file help

Can someone please tell me why this is not working? I have created numerous pdf's from text files by following these instructions and this time it is not working. Convert jpeg files to PDF under Linux | bitPrison.net convert /home/liveuser/Documents/hw7 /home/liveuser/Documents/hw7.pdf... (5 Replies)
Discussion started by: cokedude
5 Replies

6. HP-UX

Convert text file into pdf on HP-UX platform

I am looking for a tool to convert text file into pdf on HP-UX platform. Current version of OS - $ uname -a HP-UX XXXXXXX B.11.23 U ia64 4125393404 unlimited-user license I'm able to get "ClibPDF-2.02"; A library for creating PDF files on HP-UX 11.00, PA-RISC 1.1 Not sure if... (2 Replies)
Discussion started by: mail4usr
2 Replies

7. Shell Programming and Scripting

Pdf to text conversion and vice versa

Hi, I have a pdf file. i want to convert it to text file and do some work on it and later want to convert it back to pdf. Can this be done via unix? or Is there a way unix can directly work on PDF file? (2 Replies)
Discussion started by: saltysumi
2 Replies

8. AIX

How convert PCL or PDF file to text in AIX

I need to conver a PCL or PDF file to text in AIX, and I donīt know how. (0 Replies)
Discussion started by: 10789
0 Replies

9. UNIX for Dummies Questions & Answers

pdf to text

Hi, Can anyone help me in converting a PDF file into a text file? Thanks, sskb (2 Replies)
Discussion started by: sskb
2 Replies
Login or Register to Ask a Question