简体   繁体   English

如何计算后记中的页面

[英]How to count pages in a Postscript

I'm developing a C# Console Application and have to count the pages of a PostScript file. 我正在开发C#控制台应用程序,必须计算PostScript文件的页面数。 Is there an easyer way to count the pages other then parsing the text in the file. 有没有一种更简单的方法来计算页面数,然后解析文件中的文本。

Thanks! 谢谢!

If the file contains an arbitrary PostScript program, the only way is to execute the file, perhaps after redefining the showpage operator to count the number of pages. 如果文件包含任意PostScript程序,则唯一的方法是执行文件,可能是在重新定义了showpage运算符以计算页面数之后。

If the file follows the DSC conventions, then you can count %%Page comments or perhaps directly use %%Pages if present. 如果文件遵循DSC约定,则可以计算%%Page注释,或者直接使用%%Pages如果存在)。

See also http://en.wikibooks.org/wiki/PostScript_FAQ#How_to_count_pages_in_a_PS_file.3F . 另请参见http://en.wikibooks.org/wiki/PostScript_FAQ#How_to_count_pages_in_a_PS_file.3F

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

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