why is ghostscript replacing embedded fonts? - ghostscript

well I've given up. I don't think I understand how GS works... as far as I understand GS replaces all fonts that are not embedded and should not touch already embedded ones? why is it replacing them? I have a pdf file that contains 2 embedded fonts and 1 not embedded (ArialMT).
I'm using command:
"gswin64c.exe -I "C:/Program Files/gs/gs9.56.1/Resource/Init" -sFONTMAP="Fontmap.GS" -dNOSAFER -dPDFACompatibilityPolicy=1 -sColorConversionStrategy=LeaveColorUnchanged -dBATCH -dNOPAUSE -sDEVICE="pdfwrite" -dAutoRotatePages=/None -dPDFA=3 -sOutputFile="pdfa.pdf" "original.pdf"
all I get with this command is this error:
GPL Ghostscript 9.56.1: Actual TT subtable offset xxxxx differs from one in the TT header yyyy. (multiple ones like this)
The following errors were encountered at least once while processing this file:
error executing PDF token
**** This file had errors that were repaired or ignored.
**** The file was produced by:
**** >>>> StreamServe Communication Server 16.6.1 GA Build 319 (64 bit) <<<<
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.
the output is a pdf without ANY fonts...
is there any way to force GS not to replace font if it wasn't found on the system?
why is it replacing ArialMT with NimbusSans-Regular even though I have declared a specific path to ArialMT in my FontMap.GS file?
I'd rather not share this pdf file as it contains sensitive customer data.
(osadzony podzestaw=embedded subset)

Ghost Script substitution will require embeddable fonts on windows those are usually stored in C:\Windows\Fonts
Thus if font substitution was simple (without look-up) your command could be simplified
gswin64c.exe -sFONTPATH="C:\Windows\Fonts" -dNOSAFER -sDEVICE=pdfwrite -dNEWPDF=false -dPDFA=3 -dPDFACompatibilityPolicy=1 -sColorConversionStrategy=LeaveColorUnchanged -dAutoRotatePages=/None -o"pdfa.pdf" "original.pdf"
you need to add -dNEWPDF=false Since to include additional mapping you add -I "C:/Program Files/gs/gs9.56.1/Resource/Init" -sFONTMAP=Fontmap.gs
Thus the following should be a startpoint
gswin64c.exe -sFONTPATH="C:\Windows\Fonts" -I "C:/Program Files/gs/gs9.56.1/Resource/Init" -sFONTMAP=Fontmap.gs -dNOSAFER -sDEVICE=pdfwrite -dNEWPDF=false -dPDFA=3 -dPDFACompatibilityPolicy=1 -sColorConversionStrategy=LeaveColorUnchanged -dAutoRotatePages=/None -o"pdfa.pdf" "original.pdf"
It will not remove warnings using a PDF file from the same developer, the difference was now there is no mention of Nimbus, but the substitutions should be better/fuller as the warning messages verified the fonts were eventually applied from windows
Note the file is smaller although the fonts are embedded, and in side by side comparison they look the same.
GPL Ghostscript 9.56.1: PDFA doesn't allow images with Interpolate true.
and
The following errors were encountered at least once while processing this file:
missing white space after number
error executing PDF token
**** This file had errors that were repaired or ignored.
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.
from their report.
If I save the file from Acrobat the file size drops but the same issues reside

Related

ImageMagick no decode delegate for this image format `PDF' Windows

Trying to play with ImageMagick to read scanned PDF texts, but at the point to convert the PDF to image, I've got this error, where it shows "no decode delegate for this image format `PDF' # error/constitute.c/ReadImage/504". Been search for this solution for hours to no avail, need some help here.
OS: Windows 7 x64
ImageMagick Version: ImageMagick-6.9.8-10-Q16-x86-dll.exe
convert -list format
shows below output
Format Module Mode Description
-------------------------------------------
* native blob support
r read support
w write support
+ support for multiple images
Looks like your delegates are not properly configured,
Once Ghostscript is installed make sure the binary folder C:\Program Files/gs/gs3.0.9/bin is added to your path.
Once Done, there should be a file names delegates.mgk in you graphics magick home directory. Open that file in a text editor.
<delegate decode="pdf" encode="eps" mode="bi" command='"#PSDelegate#" -q -dBATCH -dSAFER -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=#GSEPSDevice# "-sOutputFile=%o" -- "%i" -c quit' />
In the whole file, find and replace #PSDelegate# with gswin64c and it should get the job done.

Ghostscript find out more debugging information

I am creating a pdf file using ghostscript 9.15. I have been using ghostscript for about 5 years and haven’t encountered any serious issues till this week.
Essentially I am running the query below….
“c://distiller/exes/gswin32c.exe" -sDEVICE="pdfwrite" -dNOPAUSE -dBATCH -dNOSAFER -dQUIET -sFONTPATH="C:/Windows/Fonts" -sOUTPUTFILE="C:\distiller\test.pdf" "C:\ExactDistiller \example.ps"
and I get the error below
Current allocation mode is local Last OS error: No such file or
directory Current file position is 197197 GPL Ghostscript 9.15:
Unrecoverable error, exit code 1
I am getting the error “No such file or directory” but I have checked every file path and checked every font is installed and all seems fine but still no luck. I just want to know is there a way of finding out what file / directory is causing the issue?
Well the first thing I would do is not set -dQUIET, turning off information isn't a good way to debug a problem. Not setting -dBATCH and -dNOPAUSE might be helpful too as it might show you more of what is going on. Note that -dNOSAFER is in fact the default, you don't need to set that unless you have previously set your environment to include -dSAFER
In short, when trying to debug the problem, simplify it as far as possible, don't set any switches unless you know you need them, or they contribute to the problem.
You could then paste the stdout transcript which might shed some illumination.
Secondly, your directory appears to contain a trailing space before the separator "c:\ExactDistiller \example.ps", is that correct ? A 'No such file or directory' error will be thrown (without a PostScript error) if you get the input filename incorrect.
If there is a PostScript error revealed when you stop issuing -dQUIET then you can paste it in your original question (by editing it) and I'll take a look. It may be necessary to see your example.ps file, depending on what that reveals.

Missing ICC Data in ghostscript

For some documents that I need to convert into images (jpeg) through the (templated) command gs -dNOPAUSE -sDEVICE=jpeg -dBATCH -r133 -sOutputFile=/my/path/%d.jpg file, sometimes I get the following error :
./base/gdevp14.c:3632: pdf14_update_device_color_procs_push_c(): Missing ICC data
the process then launches a signal 11 (which is a segfault I believe). I'm using Ghostscript 9.05 on the machines where this crashes, but on another machine equipped with Ghostscript 9.10, it runs just fine, for (exactly) the same document.
I thought that I could be missing something, but what could it be ?
thanks !
Update to something a little more recent. The current version is 9.16. If you continue to experience problems then file a bug report. I would guess that your bug has been fixed somewhere between 9.05 and 9.10.....
By overriding the ICC settings, it seems that it is doing fine : gs -dNOPAUSE -sDEVICE=jpeg -dOverrideICC -dBATCH -r133 -sOutputFile=/my/path/%d.jpg file.
A PDF that was failing, once exported to a new PDF worked just fine, so I guess there was something amiss in the original PDF, that ghostscript didn't like very much. Overriding the ICC settings with the default ones on the current machine seems to do the trick.

Ghostscript and pxlcolor: how to generate additional PJL entries in generated PCL

I have to set the Outbin in a PCL file that is generated via Ghostscript with the device=pxlcolor. I'm looking araund but didn't find the necessary parameter.
Can someone pls advice?
My commandline on windows is:
C:/Programme/gs/gs9.06/bin/gswin32c.exe -dBATCH -sDEVICE=pxlcolor -dFIXEDMEDIA -dMediaPosition=4 -dDuplex=true -sOutputFile=output.pcl -f Input.pdf
That produces a pcl file that takes it sheet(s) from the correct input tray/PaperSource.
There is no provision for this, you will have to add these manually after the file is generated.

discoloration of images created by ghostscript

I m converting a pdf into image using ghostscript
It almost produces good images but for one pdf the created image is having a white strip
however this strip is not present in the original pdf.
script which i hv used is below
gs -dNOPAUSE -sDEVICE=jpeg -dFirstPage=1 -dLastPage=2 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=fileName.gif -dJPEGQ=100 -r300 -q pdfName.pdf -c quit
Here the created image http://www.pictureshack.us/images/65486_1.gif
i am using Ghostscript 8.70 and the issue is fixed for the latest update i.e 9.06, but i cant upgrade to this...moreover found the issue its due -r300, so when i specify resolution of 100 then it works fine for this pdf but not for many other pdf...
You don't say what version of Ghostscript you are using, and you haven't provided the original PDF file, so I can't test it on current code. However, this 'looks like' a transparency bug, and may well be fixed in recent versions of Ghostscript.
I would suggest you upgrade to 9.06 if you haven't already and try that. If the problem persists please open a bug report at http://bugs.ghostscript.com Please attach the original PDF file and the command line you are using.

Resources