WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 25866
30621
Printing using other media types then "print"
https://bugs.webkit.org/show_bug.cgi?id=30621
Summary
Printing using other media types then "print"
Jakob Truelsen
Reported
2009-10-21 01:54:01 PDT
Some times, especialy when printing to pdf, it makes sense to use another media type then print when printing, often "screen".
Attachments
Media Type 1.0
(6.10 KB, patch)
2009-10-21 01:58 PDT
,
Jakob Truelsen
zecke
: review-
Details
Formatted Diff
Diff
Media Type 1.1
(6.53 KB, patch)
2009-10-21 07:46 PDT
,
Jakob Truelsen
ap
: review-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jakob Truelsen
Comment 1
2009-10-21 01:58:37 PDT
Created
attachment 41556
[details]
Media Type 1.0 Patch implementing printing media type setting
Holger Freyther
Comment 2
2009-10-21 06:23:27 PDT
Comment on
attachment 41556
[details]
Media Type 1.0
> void Frame::setPrinting(bool printing, float minPageWidth, float maxPageWidth, bool adjustViewSize) > { > + String mediaType; > + if (m_page->settings())
Use: String mediaType = settings() ? settings()->printingMediaType() : "print"; reasoning: - m_page can be NULL... m_page->settings() not.. - provide a default for printingMediaType as well..
> +*/ > +QString QWebSettings::printingMediaType() const > +{ > + return d->printingMediaType; > +}
Which can be QString() which is not what your API doc said... have a default... and let it be "print" but in general this is a nice patch!
Jakob Truelsen
Comment 3
2009-10-21 07:07:53 PDT
if I give d->printingMediaType a default value in the constructor, it will not inherit a value set in globalSettings unless explicitly set to the empty string. While this is consistent with other current behaviour (
https://bugs.webkit.org/show_bug.cgi?id=30622
) it is clearly not what one wants. The way QWebSettings currently work's putting default values into variables is broken. The only solution I can think of to the problem would be to do settings->setPrintingMediaType(type.isEmpty() ? "print" : type); however then printingMediaType would still return the empty (null) string .
Jakob Truelsen
Comment 4
2009-10-21 07:46:28 PDT
Created
attachment 41567
[details]
Media Type 1.1 Fix mentioned issues. Mention in documentation that QString() means that a default value is used.
Eric Seidel (no email)
Comment 5
2009-10-21 10:30:42 PDT
I'm not sure this really shoudl be a setting. I would envision this being a one-off. If you were to expose some sort of UI to the user to print and they could chose to override the "print" stylesheet and print what's on screen. Then again, I'm not sure this is very useful to begin with.
Alexey Proskuryakov
Comment 6
2009-10-22 00:04:43 PDT
Comment on
attachment 41567
[details]
Media Type 1.1 I agree with Eric - making this a setting seems wrong.
Jakob Truelsen
Comment 7
2009-10-22 00:34:42 PDT
Whether this is a feature needed by other projects then my own (wkhtmltopdf), I cannot judge. I would however really like this feature in webkit. I tried submitting a patch where the media type is an optional settings for one of the print methods (compute page rects I think). However the review was denied saying that this was the wrong way to do it. So I made it a setting, which is apparently also the wrong way to get this feature. If neither of these approaches are good, is there an approach I can take, that will give me some kind of way to set the printing media type to screen?
Alexey Proskuryakov
Comment 8
2009-10-22 19:44:51 PDT
The best place to discuss this would be webkit-dev mailing list.
Alexey Proskuryakov
Comment 9
2010-06-12 15:39:14 PDT
*** This bug has been marked as a duplicate of
bug 25866
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug