I need to convert the PDF of RGB color space to Grayscale using commandline tool supporting for Windows and Linux. When i used Ghostscript the conversion is happening but when the output is opened in illustrator the fonts were shown as boxes. Is there any solution option available in Ghostscript to overcome this font issue. Is there any other commandline tool available for this conversion. The font encoding is always built in is there any ways available to change it as ANSI encoding.Screenshot of font issue on illustrator VS the working scenario on acrobat
1 Answers
Pictures of the problem really don't help. You need to provide the following:
The version of Ghostscript you are using, and the platform (Linux, Windows etc), the word size of the version of Ghostscript and where you sourced this version of Ghostscript from (official Ghostscript download page, package, self-built binary).
An example file to reproduce the problem
The exact command line you used to reproduce the problem, and any supporting files required.
I suspect that your problem is that the original PDF file does not include the fonts that it uses, and that you have left SubsetFonts as true, and have left the AlwaysEmbed and NeverEmbed arrays untouched. This will mean that the new PDF file also does not include the fonts, which means that any PDF consumer must use a substitute font. The 'boxes' you refer to are /.notdef glyphs which are used when the font does not contain the glyph being requested.
Having the Encoding 'built-in' doesn't help with anything at all, it's the presence or absence of the fonts which matters. No, you can't change the encoding to 'ANSI', if you do that (assuming it isn't already WinAnsiEncoding) you'll see very similar problems to the ones you are complaining of here. You would also need to change the text character codes in the PDF file to be able to change the Encoding.
You could also raise this as a bug at https://bugs.ghostscript.com, where you will also have to supply an example file (as simple as possible) and all the other information listed above.
-
Command used: gswin64c -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray-dEmbedAllFonts=true -dPDFSETTINGS=/prepress -sOutputFile=output.pdf input.pdf OS: Windows 10 GPL Ghostscript Version : 9.50 We have tried the same commands with PDF containing basic fonts but still the same error. – Bhanu Jan 30 '20 at 13:59
-
You still have not supplied an example file. First thing to do is drop everything in the command line that you don't need. So that's everything **except** -sColorConversionStrategy, in particular drop -dPDFSETTINGS and -dNOCACHE. What do you mean by 'PDF containing basic fonts ?' Do you mean the base 14 fonts (35 faces) ? Do you mean the fonts are actually embedded or just referenced ? If you made an example file available I wouldn't have to ask these questions.... – KenS Jan 30 '20 at 15:12
-
This previous answer is possibly relevant: https://stackoverflow.com/questions/41205112/ghostscript-stubbornly-refuses-to-embed-fonts/41243959#41243959 – KenS Jan 30 '20 at 15:16
-
Please check the sample pdffile for your analysis please check the pdffile in adobe illustrator https://drive.google.com/file/d/1-70y3tv8jhkmTp2yWb8CAShuf5ZgHkyl/view?usp=drivesdk Output file from gs :- please check pdffile in adobe illustrator https://drive.google.com/file/d/1-DLkxFnGGuwsPZADQQ2b4eOAYyrpLecX/view?usp=drivesdk – Bhanu Feb 12 '20 at 10:02
-
Please check the sample pdffile for your analysis Check both files in adobe illustrator https://drive.google.com/file/d/1-70y3tv8jhkmTp2yWb8CAShuf5ZgHkyl/view?usp=drivesdk https://drive.google.com/file/d/1-DLkxFnGGuwsPZADQQ2b4eOAYyrpLecX/view?usp=drivesdk – Bhanu Feb 12 '20 at 10:09
-
I don't have a google drive account and I'm not prepared to create one to download your file, please put the file somewhere that I can access without creating an account. Also, I'll be using Adobe Acrobat, not Illustrator, for the very good reason that Acrobat is free and Illustrator is expensive; its also not the reference implementation for PDF files. – KenS Feb 12 '20 at 13:51
-
Then what is the purpose of sharing files? Only in illustrator the fonts were shown as boxes. Acrobat it is showing the fonts fine. – Bhanu Feb 13 '20 at 09:21
-
What are all the options available to embed fonts in GS, We are getting perfect output in GS but we cant use it due to this font issue as blocker. – Bhanu Feb 13 '20 at 10:00
-
Well if Acrobat shows the fonts correctly then this is an Illustrator bug, you should take it up with Adobe. The options for font embedding are described (at length) in the Ghostscript documentation. Please take amoment to review the AGPL as well. – KenS Feb 13 '20 at 13:23