如何使用GhostXPS将书签插入新的PDF文件? [英] How do I insert bookmarks into a new PDF file using GhostXPS?

查看:106
本文介绍了如何使用GhostXPS将书签插入新的PDF文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 GhostXPS 将XPS转换为PDF.使用命令行:

I want to convert XPS to PDF using GhostXPS. Using command line:

"S:\GhostXPS\gxpswin32-9.18.exe" @"S:\Temp\PS\XPS\TestXPSWrite.txt" 

这些选项在TestXPSWrite.txt文件中的位置:

Where the options are in the TestXPSWrite.txt file:

-sDEVICE=pdfwrite -sOutputFile="S:\Temp\PS\XPS\TestMerged.pdf" 
-dNOPAUSE -dBatch 
"S:\Temp\PS\XPS\Test1.xps" 
"S:\Temp\PS\XPS\Test2.xps" 
"S:\Temp\PS\XPS\Test3.xps" 
"S:\Temp\PS\XPS\Bookmarks.txt"

Bookmarks.txt文件的内容:

Contents of Bookmarks.txt file:

[/Title (Summary) /Page 1 /OUT pdfmark
[/Title (TOC) /Page 2 /OUT pdfmark
[/Title (Chapter 1) /Page 3 /OUT pdfmark

一切正常,除了Bookmarks.txt文件失败,因为它不是XPS文件,该文件失败.如果这些是使用常规GhostScript exe的PostScript文件,则书签的效果非常好.但是XPS则不行.

Everything works fine except the Bookmarks.txt file which fails because it isn't an XPS file. If these were PostScript files using regular GhostScript exe then the bookmarks work fantastic. But not with XPS.

如何使用GhostXPS将书签插入新的PDF文件中?

How do I insert bookmarks into a new PDF file using GhostXPS?

推荐答案

坦白地说,你不能.

您知道,当前添加此类内容的唯一方法是使用pdfmark PostScript运算符(这就是您的bookmarks.txt文件中的内容,它实际上是一个PostScript程序).

The only way currently to add such content is, as you are aware, to use the pdfmark PostScript operator (that's what's in your bookmarks.txt file, its actually a PostScript program).

但是,由于GhostXPS不了解PostScript,因此您无法做到这一点.

But since GhostXPS doesn't understand PostScript, you can't do that.

您可以对文件进行双重处理,将新创建的PDF文件通过Ghostscript和pdfwrite设备传回,以获取第二个新PDF文件并在此阶段添加书签.但是重复处理会导致内容发生奇怪的事情.

You could double process the file, passing the newly created PDF file back through Ghostscript and the pdfwrite device to get a second new PDF file and add the bookmarks during that stage. But double processing can cause odd things to happen with the content.

稍后可能对此有解决方案.

There may be a solution to this at a later date.

这篇关于如何使用GhostXPS将书签插入新的PDF文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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