从打印作业中提取文档名称
如果您有原始 Postscript 数据,是否有可靠的方法从 Postscript 打印作业中提取文档名称或作业名称?
我见过打印发布站软件,它用打印的文档名称或 URL 来标记每个作业,所以这似乎是可能的。
Is there a reliable way to extract a document name or job name from a postscript print job if you have the raw postscript data?
I've seen print release station software that labels each job with a document name or url it was printed from, so it seems possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没有可靠的方法来做到这一点,因为 PostScript 语言中没有这样的(元数据)信息。 如果您的文件符合 DSC(文档结构约定),那么您可以查找注释。这些记录在 DSC 参考手册中。有效的 PostScript 文件不必符合 DSC。
除此之外,没有任何信息可供提取,至少就 PostScript 而言是这样。
There is no reliable way to do this, as there is no such (metadata) information in the PostScript language. If your files are DSC (Document Structuring Convention) compliant then you can look for comments. These are documented in the DSC reference manual. Valid PostScript files need not be DSC compliant.
Other than that, there is no information there to extract, at least as far as PostScript is concerned.
使用 C++ 从打印作业中提取文档名称。
To extract document name from print job using C++.
您可能看到的是应用程序提交给打印后台处理程序的文档名称。此外,它可能不可靠,但大多数打印驱动程序将 PJL 或 XML 格式的文档名称放在打印作业的顶部。通过一些灵活的规则,您也许能够充满信心地提取这些数据。
当然,这假设 PS 数据是由打印机驱动程序生成的。
What you might be seeing is the document name that the application submitted to the print spooler. Also, it may not be reliable but most print drivers put the document name in PJL or XML at the top of the print job. With some flexible rules you might be able to pull this data with some confidence.
This, of course, assumes that the PS data was generated by a printer drivers.