Open Bug 1633544 Opened 5 years ago Updated 5 years ago

saveAsPDF internal API doesn't export wrapped links correctly

Categories

(Core :: Printing: Output, defect, P3)

75 Branch
defect

Tracking

()

People

(Reporter: mcbain.asm, Unassigned)

References

Details

(Whiteboard: [layout:print-triage:p3])

Attachments

(4 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0

Steps to reproduce:

  1. Install or already have installed the Print to PDF add-on.
  2. Create a webpage with link that wraps across at least two lines.
  3. Right click and select Print to PDF.
  4. Save the PDF.

Actual results:

The link is rendered as a link across all lines, but the second and further lines are rendered as regular text. Only the part of the link on the first line is considered a link. Only clicking the text on the first line offers to open the link in a browser.

Secondly, the href attribute of the link is seemingly ignored in favor of the link text. If the link text differs from the link href, hovering the link in a PDF viewer or clicking on it, will still visit/show the link text, not the href. If the link text is not a URL/URI, it will render as an unvisited link but clicking it does nothing.

Expected results:

Links should be rendered using the href for the link target for all lines it is wrapped across or, failing that, it should use the entire link text as the link target, not just the text from the first line.

If this is an issue with the print to pdf addon, please contact the developer at https://mybrowseraddon.com/print-to-pdf.html.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE

The add-on calls the internal API listed in the original post. It is a bug in Firefox. All they would do is turn around and file one here. It says they call the Firefox PDF API in the FAQ on the page you linked and, iirc, on the add-ons page for it. It's why I selected it over other PDF add-ons as others called out to external services.

I found a link to the XPI used to install the add-on from my profile and downloaded it to inspect it. The XPI ZIP contains two short JavaScript files: one for the config options, and the other for handling the context menu item. Neither has any code for rendering PDFs itself.

The context menu-handling JavaScript file calls gets the stored preferences then calls the following on line 36: "browser.tabs.saveAsPDF({", an internal Firefox API.

I think this well verifies the issue is not in the add-on. Can this be reopened? Thank you.

Flags: needinfo?(ehumphries)

I'll ask the printing team to have a look.

Component: Untriaged → Printing
Flags: needinfo?(ehumphries)
Product: Firefox → Toolkit
Status: RESOLVED → UNCONFIRMED
Resolution: INCOMPLETE → ---

Jared, is this something that's on your team's radar wrt providing save-to-pdf output?

I also notice that pdfjs doesn't make the link clickable at all... (it works in Preview.app ).

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jaws)
Priority: -- → P3

This isn't on our radar. I'm not sure if it ranks high enough severity for it to get tackled in this first phase, but it most likely is in the purview of Sean's team anyways. I've dug through the code and it looks like it is a bug somewhere in Printing: Output since the front-end code just sets the printer as type kOutputFormatPDF and sends it to gfx/thebes as a PrintTarget instance.

Component: Printing → Printing: Output
Flags: needinfo?(jaws) → needinfo?(svoisen)
Product: Toolkit → Core

The work to make this fully functional I think would be covered by bug 454059. It's on our radar but not presently on any near-term roadmap.
Will keep this open because it doesn't sound like a dupe given that the wrapped hyperlink is somehow partially functional outside PDF.js.

Severity: -- → normal
Flags: needinfo?(svoisen)
See Also: → 454059
Whiteboard: [layout:print-triage:p3]

The product::component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.

Priority: P3 → --

The severity field is not set for this bug.
:svoisen, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(svoisen)
Severity: normal → S3
Flags: needinfo?(svoisen)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: