I have one pdf file where text have been formatted in tables, boxes, background colours. I tried to convert my text file to pdf with boxes, tables and background colours with enscript. I got success for foreground and background colours, but no tables and boxes. So I converted one pdf file to post-script to see what codes had been used for creating/inserting tables and boxes with text. I got success with PS codes but these are very difficult to understand. Then I converted .ps file to text, but now I can not see codes. I am hoping after understand post-script code I will use the same with awk as usual for pdf conversion. But no success. Is there any tool or command so I can see exact code used in post-script with text editor? I am using red hat linux 5.9.
Is it possible to convert a pdf file to post script, then to text for see codes used in post script?
Asked
Active
Viewed 163 times
0
ctrl-alt-delor
- 27,473
- 9
- 58
- 102
Kalpesh Bhoj
- 192
- 1
- 10
-
I think postscript is just text: it is a stack based programming language. If you can't see it as text, then it may be compressed. Some GUI file-managers, will use the end of the file name (the bit after the last `.`) to determine how to open a file when you click on it. – ctrl-alt-delor Jul 28 '20 at 12:30
-
There is always 2 option to open with document viewer and text editor. Document viewer is showing almost like pdf. Text editor shows post script codes for pdf. But those are difficult to understand. – Kalpesh Bhoj Jul 28 '20 at 13:16
-
What editor? Some have syntax highlighting, you may also need at tool to format it: put in non-functional spaces and newlines. – ctrl-alt-delor Jul 28 '20 at 20:03
-
The program 'pstoedit' can produce the most readable postscript for editing. When using ghostscript pdf2ps be sure to avoid compressing the postscript with options: -dCompressPages=false -dCompressFonts=false -dCompressStreams=false for example. – beginner6789 Jul 29 '20 at 00:01