0

We have used ghostscript to generate PDF files using postscript files created by our system services for years. Currently if three topics are bookmarked for a singled page all three bookmarks point to the top of the page.

We have been asked to have the bookmarks open the page and position the viewer at the location where the topic originates on the page. My understanding is that bookmarks in the postscript file as shown should provide this functionality. Topic 1 should be at the top of the 14" page and Topic 2 should be near the bottom.

[ /Page 1 /Count -1 /Title (Topic 1) /VIEW [/XYZ 0 1008 0] /OUT pdfmark

[ /Title (Topic 2) /VIEW [/XYZ 0 55 0] /OUT pdfmark

However both bookmarks position at the top of the page.

I have attached the actual postscript file and a command file containing the actual ghostscript commands used to generate the PDF.

Postscript file Ghostscript command fileu

Any help appreciated.

Barry
  • 1

2 Answers2

0

I don't think this is really a Ghostscript question (nor ghostscript.net) its really more 'how do I use the pdfmark operator'. Ghostscript produces a file which is identical (in terms of outline) with the PDF file produced by Adobe Acrobat Distiller.

I'm assuming, of course, that the pdfmarks you want are the ones in the PostScript file and you aren't intending to supply them externally.

Both Acrobat and Ghostscript produce a PDF file which has only a single Outline entry with one subordinate clause, the outline entry is closed. In both cases the destination is stored as:

/XYZ null null null

which would explain why both appear to be the same; in fact neither of them does anything.

The reason is that you have put:

[ /Count -1 /Title (Assets)   /VIEW [/XYZ 0 1008 0] /OUT pdfmark
[ /Title (Assets Write-ins)   /VIEW [/XYZ 0 55 0] /OUT pdfmark

PostScript is case sensitive, the actual arguments should be:

[ /Count -1 /Title (Assets)   /View [/XYZ 0 1008 0] /OUT pdfmark
[ /Title (Assets Write-ins)   /View [/XYZ 0 55 0] /OUT pdfmark
KenS
  • 30,202
  • 3
  • 34
  • 51
0

Cannot believe I missed this: thank you for the answer:

[ /Count -1 /Title (Assets) /VIEW [/XYZ 0 1008 0] /OUT pdfmark [ /Title (Assets Write-ins) /VIEW [/XYZ 0 55 0] /OUT pdfmark

PostScript is case sensitive, the actual arguments should be:

[ /Count -1 /Title (Assets) /View [/XYZ 0 1008 0] /OUT pdfmark [ /Title (Assets Write-ins) /View [/XYZ 0 55 0] /OUT pdfmark

Barry
  • 1