Open Bug 1810111 Opened 2 years ago Updated 1 year ago

Add support for printing PDFs in GeckoView

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

People

(Reporter: marco, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Once bug 1659818 is fixed.

We should check if this works automagically now that bug 1659818 has been fixed. Olivia, could you test printing a PDF?

Flags: needinfo?(ohall)

Sure!

I'm not quite sure if this is the correct way to test what we need, but I loaded a .pdf and tried to call window.print() from about:debugging in the content process. Unfortunately, the .pdf did not print this way. This seems like the related log warning that showed up.

If testing calling window.print from a pdf.js page this way was valid, I think the issue might be that it tries to capture a browser clone first and then makes the call that would check for PDF.js, which then gets the PDF sent on to the printer. It should maybe check for PDF.js first and not make a clone in that situation before requesting the PDF because the clone will not be needed. (geckoview.js -> onPrintWindow code). (I'll test this idea later today. )

Update: Tried the idea in the above paragraph. I adjusted the code to send directly to the PDF and printing stage without a browser clone attached. This test change did not seem to solve the issue. The same warning still appeared. Gecko did need a browsing context, so I did return one in the test.

Alternatively, we don't have printing as a menu option on Fenix/Focus yet (bug 1808755), but we do in GeckoView Example. Printing a .pdf page worked as expected when I tested printing from the menu on GVE. This calls printPageContent directly without needing to make a browser clone first.

Flags: needinfo?(ohall)
Blocks: 1837520
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: