Convert PCL to PDF using ghostscript: cyrillic problem - ghostscript

I have simple PCL file in Windows 1251 code page:
<ESC>E<ESC>&l6D<ESC>&a1L<ESC>&l1E<ESC>(9R<ESC>(s0p10.00h0s0b4099T
Привет! (it means Hello!)
When I convert it to pdf with gpcl6win32.exe from ghostscript 9.28:
gpcl6win32.exe -dNOPAUSE -sDEVICE=pdfwrite -dNOCACHE -sOutputFile=output.pdf input.pcl
I get unreadable cyrillic glyphs in output.pdf because there are no cyrillic glyphs in NimbusMono-Regular selected for Courier font (4099):
What is correct way to make it correct PDF with cyrillic glyphs?
Thank you for any hints!

You need to use a font which contains Cyrillic glyphs. The simplest solution is to embed a soft font in the PCL. Otherwise you could try defining a different Courier font by editing fontmap.GS.
If you want to try that you will need to find a version of Courier which contains the Cyrillic glyphs, since you are presumably using Windows, you could try using the Windows version of Courier.

Related

Ghostscript PDF fonts becomes boxes in Adobe Illustrator where as its output is fine when opened in Adobe Acrobat

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
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.

libGDX TrueTypeFont font working with accented characters on windows

So we made a small hangman game, and because we are Hungarians we have those irritating accented characters. libGDX can perfectly draw these on Android and Linux, but it just skips them on Windows. I have included 3 screenshots from the 3 systems. The font is self-made ttf font, I have also included, it only has the required letters.
When generating the font I included the characters like so:
parameter.characters = "aábcdeéfghiíjklmnoóöőpqrstuúüűvwxyz_"
Font (Mega link)
Windows: Supposed to say sütőlap(oventop)
Linux: pöröly(sledge hammer)
Android: színész(actor)
So I ended up using the Apache commons-IO library and specifying utf-8 encoding for reading the file, as it turned out that was the problem.

Hindi characters as ???? in PDF/A

I am converting html templates into PDF/A format using jod converter3(using open office 3x).This is working fine in the development environment(using Eclipse and JRE).
But while executing the same program on production(Linux,JBoss 5) some templates that have hindi characters in output pdf with ???
Working fine for english characters
Tried running my program via command line w/o app server still the same output.
java -cp bin:PATH/JARNAME.jar:lib ConvertToPDFA encoding=UTF8 x (Not working).
HTML is also UTF-8 encoded.
Please suggest the problem area.
Check for a hindi font tiff under the location usr\share\fonts\TTF.
if missing then create the same and place the required font tiff.

how to install pfa fonts in windows

I have extracted fonts from pdf but they have extension like
font.pfa
how can i install those fonts
PFA stands for Printer Font Ascii. PFB stands for Printer Font Binary.
Wikipedia on postscript fonts suggests that Windows doesn't support PFA, but does support PFB.
So, try converting your PFA to PFB, perhaps using https://onlinefontconverter.com

Generate PDF with cyrillic (or UTF-8) contents

My C# .NET 3.5 application has an option to export text to PDF. I am using ReportingCloud (based on RDL) as generation engine. However, cyrillic texts shown incorrectly in resulting PDF. What means can I use to generate cyrillic PDF correctly? A method to generate UTF8 will also do.
UPD: Particularly, how to embed right fonts into PDF?
I am not familiar with ReportingCloud, so perhaps this is not the easiest answer to your question. But for really great looking PDFs with UTF8 and cyrillic support you could use LaTeX. But it is a language like HTML, just for PDFs. So you have to generate some source code. It is also possible to embed the desired fonts.

Resources