Discussion:
[gs-devel] convert PCL to PDF with GhostPCL
Ilya Pravdivtsev
2011-11-05 01:30:29 UTC
Permalink
Hi,

I have a proprietary application designed to print to PCL supporting
printers. But I need the jobs comes out as PDFs.
The application uses cp866 encoding.

I compiled GhostPCL and wrote a cups input filter:
#! /bin/sh
[ -n "$6" ] && exec <"$6"
/usr/local/bin/pcl6 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=- -

By running
/usr/local/libexec/cups/filter/pcl2pdf < test.pcl > test.pdf
I veriefied the filter worked but the text encoding is wrong.

Does GhostPDL support cyrillic symbols?
How could I make pdf file from a pcl stream in cp866 encoding?

Thanks in advance
Ken Sharp
2011-11-05 15:16:17 UTC
Permalink
Post by Ilya Pravdivtsev
By running
/usr/local/libexec/cups/filter/pcl2pdf < test.pcl > test.pdf
I veriefied the filter worked but the text encoding is wrong.
In what sense is the Encoding incorrect ?
Post by Ilya Pravdivtsev
Does GhostPDL support cyrillic symbols?
Not a relevant question in terms of PCL or PDF. Ghostscript (GhostPCL in
fact) supports fonts with variable encodings.
Post by Ilya Pravdivtsev
How could I make pdf file from a pcl stream in cp866 encoding?
I have no idea what cp866 encoding is,but you can create a font in PDF with
any encoding you want. Getting there from PCL is likely to be much more
problematic. I'm not sure what you expect to gain from embedding a font
with a specific encoding though, especially one which isn't a PDF standard
Encoding.

If you believe there is a problem then feel free to open a bug report at
http://bugs.ghostscript.com

You will need to supply a sample file, which will make discussions easier,
since they won't be hypothetical.


Ken
Ilya Pravdivtsev
2011-11-07 08:59:45 UTC
Permalink
Hi,
I'm not sure if it's a bug. I'm attaching a sample PCL file and PDF file
generated from Ghostpcl 9.04
Can anyone explain how to convert this file to pdf properly?
Post by Ken Sharp
Post by Ilya Pravdivtsev
By running
/usr/local/libexec/cups/filter/pcl2pdf < test.pcl > test.pdf
I veriefied the filter worked but the text encoding is wrong.
In what sense is the Encoding incorrect ?
Post by Ilya Pravdivtsev
Does GhostPDL support cyrillic symbols?
Not a relevant question in terms of PCL or PDF. Ghostscript (GhostPCL in
fact) supports fonts with variable encodings.
Post by Ilya Pravdivtsev
How could I make pdf file from a pcl stream in cp866 encoding?
I have no idea what cp866 encoding is,but you can create a font in PDF with
any encoding you want. Getting there from PCL is likely to be much more
problematic. I'm not sure what you expect to gain from embedding a font
with
Post by Ken Sharp
a specific encoding though, especially one which isn't a PDF standard
Encoding.
If you believe there is a problem then feel free to open a bug report at
http://bugs.ghostscript.com
You will need to supply a sample file, which will make discussions easier,
since they won't be hypothetical.
Ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ghostscript.com/pipermail/gs-devel/attachments/20111107/2ad5baf5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.pcl
Type: application/octet-stream
Size: 550 bytes
Desc: not available
URL: <http://ghostscript.com/pipermail/gs-devel/attachments/20111107/2ad5baf5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.pdf
Type: application/pdf
Size: 12780 bytes
Desc: not available
URL: <http://ghostscript.com/pipermail/gs-devel/attachments/20111107/2ad5baf5/attachment.pdf>
Ken Sharp
2011-11-07 10:20:33 UTC
Permalink
Post by Ilya Pravdivtsev
I'm not sure if it's a bug. I'm attaching a sample PCL file and PDF file
generated from Ghostpcl 9.04
Please don't do that again. Even if you are not sure its a bug, open a bug
report in future. If its not a bug we'll just close it with an explanation.
Post by Ilya Pravdivtsev
Can anyone explain how to convert this file to pdf properly?
Depends what you mean by 'properly'. I don't have a PCL printer but if I
render your PCL file with GhostPCL I see exactly the same result as the PDF
file you sent, and the PDF file I create here.

The PCL file you sent does not contain a font, so I 'suspect' (I am not a
PCL expert) that your file is reliant on the font in the printer containing
the glyphs you want at the positions you have used. This is probably some
kind of localisation setting.

Possibly someone else can help you with this, all I can say is that the PDF
file is created identically to the rendered file, and so this is not a
p[dfwrite bug, and probably not a GhostPCL bug.



Ken

Loading...