Converting pdf to ps correctly and vice versa

I use "pdftops" to convert .pdf files to .ps files, and then "ps2pdf" for the reverse process (poppler-utils). The problem is that when creating .pdf files from .ps files, the text looks fine, but when I try to copy it, the characters are very strange (as if they were corrupted). I used these tools for other files for a long time, and it worked fine. I also tried "pdftohtml -xml" to create the .xml file and the text is fine (the characters were extracted correctly).

  • What problem can be related to conversion? Maybe if I use "pdftops" and "ps2pdf", are there any options that need to be changed?
  • If I create .xml output, is there a way to create a .pdf file from an XML file?

EDIT: Exit for "pdffonts original.pdf" pdffonts_output_originalpdf

Output for "roundtripped.pdf" pdffonts_output_roundtrippedpdf

+5
source share
1 answer

I just cover PS-> PDF conversion ... (I assume that your phrase doesn’t mean that the conversion is “back and forth” of the same file [PDF-> PS-> PDF], but the general direction of conversion is for any PS file. Right?)

, , ps2pdf - shellscript, Ghostscript . ps2pdf . Ghostscript , . ps2pdf , , Ghostscript. ( ps2pdf - , Ghostscript ...)

-, , PS , : PS , ? ? .

-, Ghostscript , , PDF. , Ghostscript ​​ ? (, ps2pdf Ghostscript, gs.)

PDF ( ), PDF. PDF ? ( pdffonts your.pdf, - pdffonts Poppler utils.)

() Ghostscript PS- > PDF , :

gs \
  -o output.pdf \
  -sDEVICE=pdfwrite \
  -dPDFSETTINGS=/prepress \
  -dHaveTrueTypes=true \
  -dEmbedAllFonts=true \
  -dSubsetFonts=false \
  -c ".setpdfwrite <</NeverEmbed [ ]>> setdistillerparams" \
  -f input.ps
+4

All Articles