I spend almost day trying to understand how to convert "print to file" PRN file to PS or PDF file. The PRN file is in PCL format and while looking on google I found that GhostPCL should do conversion job using command line
gpcl6win64.exe -dNOPAUSE -sDEVICE=ps2write -sOutputFile="c:\output.ps" "c:\input.prn"
Unfortunately that I get is binary data from PRN file is moved to ps/pdf file without rendering anything useful only garbage symbols.
Any idea how to convert PRN PCL files to PS or PDF?
I am using the newest version of GhostPCL 9.23 for Win64. I also attaching test files.
The command line you specify will create a PostScript program from the PCL input. I don't understand what you mean by:
binary data from PRN file is moved to ps/pdf file without rendering anything
The process won't render anything it will produce a PostScript file. Note you can create a PDF file instead by using the pdfwrite device.
Perhaps if you shared an example of the input and output files it might be possible to say more. It would also be helpful to see the entire transcript of the back channel output. If nothing else it would contain the version of GhostPCL being used, which would be helpful to know.
[Edit after files supplied]
I've no idea what led you to believe your file was a PCL file, but it isn't.
The 'PRN' file turns out not to be a PCL file at all. Its an XPS file.
Unsurprisingly, when you run this through the PCL interpreter it doesn't know what to make of it. PCL interpreters treat anything they don't understand as 'text' and try to print it as such. Which is why the content of your PDF begins with 'PK'. XPS files are zip archives, and PK is the signature for a zip archive.
If you use GhostXPS instead it will read the file properly. Or, since this is presumably on Windows 10, you could just save it direct to a PDF file if that's what you want.