[Webkit-unassigned] [Bug 75232] REGRESSION (WebKit2): Printing a subframe containing a PDF prints the on-screen view instead of the entire PDF document

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 26 19:03:42 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=75232


Alexey Proskuryakov <ap at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #120561|review?                     |review+
               Flag|                            |




--- Comment #3 from Alexey Proskuryakov <ap at webkit.org>  2011-12-26 19:03:42 PST ---
(From update of attachment 120561)
View in context: https://bugs.webkit.org/attachment.cgi?id=120561&action=review

> Source/WebKit2/Shared/PrintInfo.h:29
> +#include <WebCore/FloatRect.h>

You could include FloatSize.h.

> Source/WebKit2/UIProcess/API/mac/WKView.mm:2734
> +        // FIXME: If the frame cannot be printed (e.g. if it contains an encrypted PDF that disallows
> +        // printing), this function should return nil.

Is this something you plan to address very soon? Otherwise, a bug number would be helpful.

What's the symptom here - will a single blank page be printed for non-printable documents?

> Source/WebKit2/WebProcess/Plugins/PluginView.h:72
> +    RetainPtr<CGPDFDocumentRef> pdfDocumentForPrinting() const { return m_plugin->pdfDocumentForPrinting(); }

I do not understand why we have to talk to WebCore here. Is this for <embed type="application/pdf">? But these end up in BuiltinPDFViews, too.

Eventually, there will be no CGPDFDocument parsing in WebProcess, so adding such plumbing across framework boundary is against the long term plan.

> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:2658
> +    CGRect cropBox = CGPDFPageGetBoxRect(page, kCGPDFCropBox);
> +    cropBox = CGRectIntersection(cropBox, CGPDFPageGetBoxRect(page, kCGPDFMediaBox));

This is suspicious - many PDFs don't have a crop box. See e.g. code in BuiltInPDFView::calculateSizes.

> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:2668
> +    if (widthDifference || heightDifference)
> +        CGContextTranslateCTM(context, widthDifference / 2, heightDifference / 2);

At least on screen, PDFs really dislike non-integer translation (see drawing code in BuiltinPDFView).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list