Question

Running gswin64c.exe @gsparams with the following two files should create a PDF file with 8 links:

=== gsparams ===
-sDEVICE=pdfwrite -dPSFitPage -o All.pdf 1.ps 2.ps pdfmarks

=== pdfmarks ===
[ /Title (some title) /DOCINFO pdfmark

[ /Count -2 /Title (E4) /Page 1 /View [/Fit] /OUT pdfmark
[ /Title (1 / E4) /Page 1 /View [/FitR 756.07 545.8 729.07 676.3] /OUT pdfmark
[ /Title (2 / E4) /Page 1 /View [/FitR 324.07 545.8 297.08 676.3] /OUT pdfmark

[ /Rect [590.13 404.52 572.13 422.52] /SrcPg 1 /BS <</S /D /W 0.5 /D [1 3]>> /Color [0.2 0.4 1] /Page 2 /View [/FitR 749 344.64 722.01 459.43] /Subtype /Link /ANN pdfmark
[ /Rect [590.13 774.1 572.13 792.1] /SrcPg 1 /BS <</S /D /W 0.5 /D [1 3]>> /Color [0.2 0.4 1] /Page 2 /View [/FitR 749 838.7 722.01 953.49] /Subtype /Link /ANN pdfmark
[ /Rect [590.13 692.39 572.13 710.38] /SrcPg 1 /BS <</S /D /W 0.5 /D [1 3]>> /Color [0.2 0.4 1] /Page 2 /View [/FitR 398.86 360.55 371.87 475.34] /Subtype /Link /ANN pdfmark
[ /Rect [590.13 638.81 572.13 656.81] /SrcPg 1 /BS <</S /D /W 0.5 /D [1 3]>> /Color [0.2 0.4 1] /Page 2 /View [/FitR 388.12 865.3 361.13 980.09] /Subtype /Link /ANN pdfmark

[ /Rect [217.14 420.95 199.14 438.94] /SrcPg 1 /BS <</S /D /W 0.5 /D [1 3]>> /Color [0.2 0.4 1] /Page 2 /View [/FitR 749 344.64 722.01 459.43] /Subtype /Link /ANN pdfmark
[ /Rect [217.14 687.85 199.14 705.85] /SrcPg 1 /BS <</S /D /W 0.5 /D [1 3]>> /Color [0.2 0.4 1] /Page 2 /View [/FitR 388.12 865.3 361.13 980.09] /Subtype /Link /ANN pdfmark
[ /Rect [217.14 741.85 199.14 759.85] /SrcPg 1 /BS <</S /D /W 0.5 /D [1 3]>> /Color [0.2 0.4 1] /Page 2 /View [/FitR 398.86 360.55 371.87 475.34] /Subtype /Link /ANN pdfmark
[ /Rect [217.14 780.23 199.14 798.23] /SrcPg 1 /BS <</S /D /W 0.5 /D [1 3]>> /Color [0.2 0.4 1] /Page 2 /View [/FitR 749 838.7 722.01 953.49] /Subtype /Link /ANN pdfmark

[ /Count -4 /Title (D11) /Page 2 /View [/Fit] /OUT pdfmark
[ /Title (1 / D11) /Page 2 /View [/FitR 398.86 360.55 371.87 475.34] /OUT pdfmark
[ /Title (2 / D11) /Page 2 /View [/FitR 388.12 865.3 361.13 980.09] /OUT pdfmark
[ /Title (3 / D11) /Page 2 /View [/FitR 749 344.64 722.01 459.43] /OUT pdfmark
[ /Title (4 / D11) /Page 2 /View [/FitR 749 838.7 722.01 953.49] /OUT pdfmark

Instead it creates only 7 links, the seventh is missing.

If I remove the /DOCINFO with a % then the missing one is the third.

If I change the first parameter of the first link from 590.13 to 590 then all the links are created.

But if I change it to 590. then that's the link that goes missing.

Changing all the colors to [0 0 0] all the links are created.

Also changing the order of the lines affects whether and which link will be missing.

How can I reliably get all my links?

Was it helpful?

Solution

The links are missing because of this Ghostscript bug.

The bug has been fixed and it will be released in October.

My workaround for the time being is to create every link twice. The chances that the same link fails twice is very low, and so far I've never noticed any missing link in my PDF documents.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top