简体   繁体   English

Ghostscript PDF打印出现乱码

[英]Ghostscript PDF printing garbled

I'm trying to use Ghostscript 9.02 on Windows 7 to print a PDF to an Epson Workforce printer from the command line using the following command: 我正在尝试在Windows 7上使用Ghostscript 9.02,使用以下命令从命令行将PDF打印到Epson Workforce打印机:

   gswin32c -dPrinted -dBATCH -dNOPAUSE -dNOSAFER -q -dNumCopies=1 -sDEVICE=epson -sOutputFile=\\spool\EPSON C:\Document1.pdf

When executing this command, pages will print from my printer, but it is just garbled text instead of the PDF. 执行此命令时,页面将从我的打印机打印,但是它只是乱码文本,而不是PDF。

在此处输入图片说明

I have tried 3 different PDF files with similar results. 我尝试了3种不同的PDF文件,但结果相似。

I doubt that the previous answer is the issue, but rather is a problem with getting the epson format data passed through correctly as binary. 我怀疑以前的答案是问题,而是将epson格式的数据正确地作为二进制传递是一个问题。 Particularly if the 'init_string' == "\\f\\033@" doesn't make it in, the rest of the data will be interpreted by the printer as text instead of raster data. 特别是如果'init_string'==“ \\ f \\ 033 @”没有输入,则打印机会将其余数据解释为文本而不是光栅数据。

Since you are on Windows, you may get better results by using the -sDEVICE=mswinpr2 device which sends the raster image for the page through GDI to the manufacturer's driver. 因为您使用的是Windows,所以使用-sDEVICE = mswinpr2设备可以得到更好的结果,该设备通过GDI将页面的光栅图像发送到制造商的驱动程序。 See http://artifex.com/gs-current-release/Devices.htm#Win for documentation on printing from windows using Ghostscript. 有关使用Ghostscript从Windows打印的文档,请参见http://artifex.com/gs-current-release/Devices.htm#Win

BTW, you can easily check if the problem is with gswin32c being able to properly render the input PDF by looking at it on the default 'display' device using: 顺便说一句,您可以使用以下命令在默认的“显示”设备上查看gswin32c是否能够正确呈现输入的PDF,从而轻松检查是否存在问题:

gswin32c C:\Document1.pdf

I have had a similar issue, and it looks like not all listed devices are capable of printing PDF files. 我遇到了类似的问题,而且似乎并非所有列出的设备都能够打印PDF文件。 I have used ljet4 option for Ricoh network printer and it prints fine. 我为理光网络打印机使用了ljet4选项,它可以正常打印。 The only problem is it always prints immediately instead of "HoldPrint" queue. 唯一的问题是它总是立即打印,而不是“ HoldPrint”队列。

your problem may be probably related with encoding used by pdf file 您的问题可能与pdf文件使用的编码有关

how this pdf has been produced? 此pdf文件是如何产生的?

I seen several times this problem arise with pdf produced by internal pdf exporter of OpenOffice 我多次看到OpenOffice内部pdf出口商产生的pdf出现此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM