Bug 167490 - PDF export: extend PDFViewSelection parameter with value to remove external links
Summary: PDF export: extend PDFViewSelection parameter with value to remove external l...
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All All
: medium enhancement
Assignee: Floris
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on:
Blocks: PDF-Export-Options-Dialog
  Show dependency treegraph
 
Reported: 2025-07-13 10:34 UTC by Floris
Modified: 2025-08-01 08:36 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Floris 2025-07-13 10:34:34 UTC
Description:
In PDFWriter, we currently already have a parameter (called PDFViewSelection in the cli, DefaultLinkAction in the code) that can be used to configure how hyperlinks to locations outside the document should be emitted.

I would like to extend it with an option to tell it to NOT emit pdf link annotations at all for external links, effectively removing all external links from the document.

Actual Results:
Current available CLI options for PDF generation ( https://help.libreoffice.org/latest/en-US/text/shared/guide/pdf_params.html?&DbPAR=SHARED&System=MAC#links ):


PDFViewSelection

Specifies the way the exported PDF will be viewed (experienced) by the user. Possible values are:

0: Specifies that the PDF will be exported with all the links external to the document treated as URI. This is the Default

1: Specifies that the PDF will be exported in order to be viewed through a PDF reader application only. Valid only if not exporting to PDF/A-1 (e.g. SelectPdfVersion not set to 1).

2: Specifies that the PDF will be exported in order to be viewed through an Internet browser, using the PDF plug-in provided with it. The bookmark of the URI will be rendered compatible with the target bookmark generated with LibreOffice PDF Export feature (see ExportBookmarksToPDFDestination).


Expected Results:
Would like to change the available options to:


PDFViewSelection

Specifies the way the exported PDF will be viewed (experienced) by the user. Possible values are:

0: Specifies that the PDF will be exported with all the links external to the document treated as URI. This is the Default

1: Specifies that the PDF will be exported in order to be viewed through a PDF reader application only. Valid only if not exporting to PDF/A-1 (e.g. SelectPdfVersion not set to 1).

2: Specifies that the PDF will be exported in order to be viewed through an Internet browser, using the PDF plug-in provided with it. The bookmark of the URI will be rendered compatible with the target bookmark generated with LibreOffice PDF Export feature (see ExportBookmarksToPDFDestination).

3: Specifies that the PDF will be exported without links external to the document.



Reproducible: Always


User Profile Reset: No

Additional Info:
-
Comment 1 Buovjaga 2025-07-13 13:14:34 UTC
Patch: https://gerrit.libreoffice.org/c/core/+/187800
Comment 2 Buovjaga 2025-07-13 13:15:19 UTC
Let's involve UX as this adds a new option.
Comment 3 Commit Notification 2025-07-20 20:13:28 UTC
Floris Bos committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/32aa68a652007a718f9e3f41b49e191f0527d518

tdf#167490: PDF export: add option to disable external links in PDF

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Heiko Tietze 2025-08-01 08:36:42 UTC
This milk has been spilt. Another item in the list of radio buttons is a bit odd because it could be the default mode too following the UI. Better layout would be an extra checkbox that disables the radio buttons, if checked. 

Anyway, keep the implemented solution IMO as is not totally wrong.