Bug 705565 - Links are not preserved with new pdf engine
Summary: Links are not preserved with new pdf engine
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-20 19:05 UTC by Tomás Bolaño
Modified: 2022-06-21 11:01 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
A simple exemplary PDF file with links to itself created with pdflatex (55.57 KB, application/pdf)
2022-06-20 19:05 UTC, Tomás Bolaño
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Bolaño 2022-06-20 19:05:01 UTC
Created attachment 22774 [details]
A simple exemplary PDF file with links to itself created with pdflatex

When processing a PDF using the new PDF engine links are not preserved in the output PDF.

To reproduce:
Consider a document with links, for example I attach the test.pdf document created with pdflatex with links to itself, and execute the following command:

$ gs -sOutputFile=gs_test.pdf -dBATCH -dNOPAUSE -dPrinted=false -sDEVICE=pdfwrite test.pdf

With ghostscript 9.56.0 and 9.56.1 The result is a gs_test.pdf document without links and table of contents. I also tried compiling ghostscript from the master branch and with this version only a single link is preserved in the gs_test.pdf document.

Expected result:
The expected result is to obtain a gs_test.pdf document with links and table of contents as the original test.pdf, which is what happens using the old PDF engine with the following command

$ gs -sOutputFile=gs_test.pdf -dBATCH -dNOPAUSE -dPrinted=false -sDEVICE=pdfwrite -dNEWPDF=false test.pdf
Comment 1 Ken Sharp 2022-06-21 11:01:38 UTC
Thanks for the report. The problem is fixed in this commit:

https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=481646eb1cdba4f0401cd8f90d8a326ea1e39ae2

Though I think that relies on the earlier commits:

https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=821f1ce09d733b12ac6a6dc5b95d9f1ff04474c3

and

https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=4e430376fd16cb76d9bb9d157bf975bcb6662334

For simplicity I would suggest cloning the HEAD of master from our Git repository (you noted in comment #0 you had tried this) and check that the result works for you.