使用Ghostscript将PDF转换为PostScript:大文件打印有问题 [英] PDF to PostScript Using Ghostscript: large files having issues printing

查看:390
本文介绍了使用Ghostscript将PDF转换为PostScript:大文件打印有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Ghostscript将500页的PDF文件转换为PostScript.

I'm currently using Ghostscript to convert 500 page PDF files into PostScript.

我正在使用Windows 7,Ghostscript x64 v 9.16和柯达Digimaster商业打印机.

I'm using Windows 7, Ghostscript x64 v 9.16, and a Kodak Digimaster Commercial Printer.

我对GhostScript使用以下参数将PDF转换为PS:

I use the following arguments for GhostScript to convert a PDF into PS:

C:\Program Files\gs\gs9.16\bin\gswin64c.exe" 
-dCompressFonts=true 
-dSubsetFonts=true 
-dEmbedAllFonts=true 
-sFONTPATH=C:\Windows\Fonts\ 
-dNOPAUSE 
-dBATCH 
-sDEVICE=ps2write 
-sOutputFile="PostScript.ps" 
"MyPdf.pdf"

然后我添加%KDK(专有)命令,通过使用基于打印机文档的%KDKSlip命令来指示哪些页面需要在哪张纸上打印.

I then add %KDK (proprietary) commands to dictate which pages need to print on which paper by using the %KDKSlip command based on the Printer documentation.

下面的示例将在Letter双面打印所有页面,但第1/2和5/6页除外.第1/2页将在名称为"YellowPerf"的纸张上打印,而5/6页将在"TriPerf"名称上打印:

The example below would print all pages on Letter duplex except for pages 1/2 and 5/6. Pages 1/2 would print on a paper defined under the name of "YellowPerf", while 5/6 would print on "TriPerf":

 %!PS-Adobe-3.0
 %%BoundingBox: 0 0 612 792
 %%HiResBoundingBox: 0 0 612.00 792.00
 %%Creator: GPL Ghostscript 916 (ps2write)
 %%LanguageLevel: 2
 %%CreationDate: D:20150506143059-05'00'
 %%Pages: 8
 %%DocumentMedia: Letter 612 792 0 white ()
 %%+ YellowPerf 612 792 0 yellow ()
 %%+ TriPerf 612 792 0 white ()
 %KDKRequirements: duplex
 %KDKSlip: YellowPerf duplex 1
 %%+ TriPerf duplex 5
 %%EndComments
 %%BeginProlog

然后使用Windows命令将其发送到Kodak Digimaster打印机:

This is then sent to a Kodak Digimaster printer using a Windows command:

> COPY PostScript.ps PrinterName

这对于较小的文档效果很好,但是对于较大的页面集,我遇到了问题.

This has worked fine with smaller documents, but I'm having issues with larger page sets.

当我尝试使用500页PDF到Postscript文件打印到Digimaster时,出现了以下错误:忙,不重置RIP".

When I attempted to print to the Digimaster using a 500 page PDF to Postscript file, it had errors occur: "Busy, do not reset the RIP".

无效文件的大小:

PostScript文件大小:52 MB
PDF档案大小:41 MB

PostScript File Size: 52 MB
PDF File Size: 41 MB

起作用的文件大小:

PostScript文件大小1MB
PDF档案大小:.8 MB

PostScript File Size 1MB
PDF File Size: .8 MB

为什么这在较小的文件上可以正常使用,而在较大的文件上却用软管连接?

Why does this work fine with smaller files but get hosed on larger files?

任何人有什么建议吗?

推荐答案

不一定是PostScript的文件大小会引起您的问题:

It is not necessarily the filesize of the PostScript that causes your problem:

  • 它可以是PostScript本身,也可以是
  • 插入(专有)%KDK-注释时,可能是您在编辑PS文件时犯了一个错误.
  • It could be the PostScript itself, or
  • it could be that you made a mistake with your editing of the PS files when you inserted the (proprietary) %KDK-comments.

您确定您的文本编辑器不会默默更改换行符吗?这也可能会更改PostScript的二进制部分!

Are you sure your text editor doesn't silently change your linefeed characters?! This could also change the binary parts of the PostScript!

此外,我不确定copy命令是否确实可以处理打印作业.我希望使用lpr命令(啊...在您的Windows版本上仍然可以使用吗?!)

Also, I'm not sure if the copy command does handle print jobs like it should. I would prefer the lpr command (ah... is that even still available on your version of Windows?!)

要调试此功能并探索成功打印的几种不同方法,我将尝试一些不同的步骤:

To debug this and to explore a few different roads to successful printing, I would try a few different steps:

  • 将没有添加%%KDK DSC标头注释的原始PostScript发送到打印机.

  • Send the original PostScript, without the added %%KDK DSC header comments, to the printer.

该打印机型号具有一个很好的功能,可以利用:您可以检查它的RIP是否完整且成功地处理了输入文件,而无需在(错误的)纸张上输出500页并浪费掉它(因此,您还需要之后将其丢弃-太多的工作).只需在其用户界面监视器上单击红色的停止"按钮即可.

That printer model has a nice feature you can utilize: you can check if its RIP processes the input file completely and successfully without needing to output your 500 pages on (wrong) paper and waste it therefore (you'd also need to discard it afterwards -- too much work too). Just click the red "Stop" button on its user interface monitor.

一个人能成功完成RIP进程吗?

Does that one complete the RIP process successfully?

是吗?现在,您甚至可以打印它.在执行此操作之前,您甚至可以通过单击界面上的某个按钮来修改作业设置,以选择特定的纸盒(不过,无法回忆起确切的按钮标签).然后释放"作业,它将打印.

Yes? Now you can now even print it. Before you do so you can even modify the job settings to select a particular paper tray, by clicking on some button on the interface (can't recall the exact button label though). Then "release" the job and it will print.

如果有效,您可以再次将注意力转移到正确的%%KDK行上.

If it worked, you can again turn your attention to get your %%KDK lines right.

如果没有,您必须尝试其他路线.

If it didn't you have to try another route.

  • 借助pdftops创建PostScript文件(有关pdftops.exe版本,请参见此处-阅读自述文件以了解可用的选项).

  • Create a PostScript file with the help of pdftops (see here for the pdftops.exe version -- read the README to see which options are available).

进行与上述类似的操作:首先查看它是否完成了RIP过程.然后继续您的%KDK操作....

Proceed analog to above: first see if it completes the RIP process. Then continue with your %KDK manipulations....

  • Digimaster模型可以直接使用PDF. (好吧,它内部使用了自己的PDF到PS转换器,但外部看不到-因此它不会真正地算作PDF RIP ...)

  • The Digimaster model can consume PDF directly. (Well, internally it uses its own PDF-to-PS converter, but that isn't visible to the outside -- so it doesn't really count as a PDF RIP...)

如果可行,您甚至可以在PDF文件中添加适当的%KDK注释,类似于下面的几行(不要依靠我正确地获取细节,它是从我的头上来的,和记忆已经有几十年了!):

If that works, you can even prepend your appropriate %KDK comments to the PDF file, similar to the lines below (don't rely on me getting the details right, it's from the top of my head, and memory is decades old!):

%!PS-Adobe-3.0
%%.........................
%%DocumentMedia: ..........
%KDKRequirements: .........
%KDKInserts: ..............
%KDKSlip: .................
%KDKBody: .................
%KDKCovers: ...............
%KDKPDFPrintAnnotations: on 
%KDKPDFFitToPage: on
%KDKBinaryOK: on 
<esc>%-12345X
%%Emulation: pdf
%PDF-1.5
%...here follow the lines of the original PDF file...
...

  • 对于Windows,曾经是所谓的"Kodak打印文件下载器"(KPD). KPD是一个应用程序,而不是打印机驱动程序.不知道它是否仍然可用.

  • For Windows there used to be the so-called 'Kodak Print File Downloader' (KPD). The KPD is an application, not a printer driver. Not sure if it is still available.

您可以打开其GUI,然后将PS,PDF,PCL或TIFF文件加载到其要打印的作业列表中.然后选择一些作业选项(例如纸盘,装订,分类等).最后,将作业发送给Digimaster ...

You could open its GUI, then load a PS, PDF, PCL or TIFF file into its to-be-printed-list of jobs. Then select a few job options (like trays, stapling, sorting etc.). Lastly, send the job off to the Digimaster...

KPD本质上与您要实现的功能相同:将%KDK命令插入文件头.但是,您想使用脚本或编辑器(一旦可行,可以通过批处理自动完成此操作).

The KPD essentially does the same thing, as you want to achieve: insert %KDK commands into the file header. But you want to do it with a script or an editor (and possibly automatically via a batch process, once it works).

KPD需要交互式用户活动,并且不能编写脚本.

The KPD requires interactive user activity and cannot be scripted.

但是您可以(ab-)使用它来拦截它从Windows假脱机系统创建的文件,对其进行研究,然后调整脚本工作,以便它们也可以工作....

But you can (ab-)use it to intercept the files it creates from the Windows spooling system, study them and then adapt your scripted efforts so that they also work....

(我本想在初始答案中添加它.但是时间用完了,所以我暂时跳过了它.)

  • Digimaster打印机具有自己的内置触摸屏或平板显示器或显像管监视器(取决于型号的使用期限).他们通常还拥有一名专职操作员,非常了解机器及其调整和特性.这台机器与用户发送作业的距离可能很远.

  • Digimaster printers have their own built-in touchscreen or flatscreen or tube monitor (depending on the age of the model). They also typically have a full-time operator who knows the machine and its tweaks and peculiarities quite will. The machine may be quite a distance from the user sending a job.

因此,调试打印问题时应执行以下操作:

So the following should be done when debugging a print problem:

  • 要求操作员将打印机设置为停止打印",但仍为接收新作业".
  • 提交任何所需的工作.
  • 与打印机及其操作员联系.
  • 发布作业以进行RIP ping操作并观察会发生什么情况:
    • 您可能会看到一切顺利,直到最后一页为止(您知道提交了多少页,对吗?)
    • 或者您可能会在特定的页码上看到作业中止.
    • 或者您可能会看到打印机RIP在特定页面(或几页)上的咀嚼时间过长,但最终完成了该工作.
    • 或者您可能会看到打印机RIP永远挂在某个页面上.
    • 或者...
    • Ask the operator to set the printer to "stop printing", but still "receiving new jobs".
    • Submit any job(s) you want.
    • Walk up to the printer and its operator.
    • Release the job for RIP-ping and observe what happens:
      • You may see everything going alright and completing until the last page (you know how many pages you submitted, right?)
      • Or you may see the job aborting at a certain page number.
      • Or you may see the printer RIP chewing extremely long on a certain page (or several pages), but finally completing the job.
      • Or you may see the printer RIP hanging with a certain page forever.
      • Or...

      无论如何,这里可以观察到的细节可能会为下一步的寻找提供重要线索...

      In any case, the details which are observable here may give important clues about where to look next...

      这篇关于使用Ghostscript将PDF转换为PostScript:大文件打印有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆