Closed
Bug 367907
Opened 18 years ago
Closed 17 years ago
allow printing to PDF file on gtk2-cairo
Categories
(Core :: Printing: Output, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: chpe, Assigned: chpe)
References
()
Details
Attachments
(1 file, 3 obsolete files)
2.42 KB,
patch
|
pavlov
:
review+
roc
:
superreview+
pavlov
:
approval1.9+
|
Details | Diff | Splinter Review |
(Not sure this is the correct component; maybe -> Widget::Gtk ?) Printing to file always prints to a PS file. That's because sDeviceContextSpecGTK::GetSurfaceForPrinter always creates a PS surface: 442 #ifdef USE_PDF 443 gfxPDFSurface *surface = new gfxPDFSurface(path, gfxSize(w, h)); 444 #else 445 gfxPSSurface *surface = new gfxPSSurface(path, gfxSize(w, h)); 446 #endif and USE_PDF is undefined. In Epiphany, I want to offer the choice to print to a PS or PDF file; so I need a programmatic switch here, not a compile time option. Attached patch implements this by adding a new attribute "outputFormat" to nsIPrintSettings with values kOutputFormatPS|PDF.
Assignee | ||
Comment 1•18 years ago
|
||
Attachment #252484 -
Flags: review?(pavlov)
Comment 2•18 years ago
|
||
Comment on attachment 252484 [details] [diff] [review] patch Should we have an OutputFormatNative or something that this defaults to? Setting this to PS or PDF on windows and mac won't do what you'd hope for with this... thoughts?
Assignee | ||
Comment 3•18 years ago
|
||
Yes, I think it makes sense to have kOutputFormatNative as default.
Attachment #252484 -
Attachment is obsolete: true
Attachment #252764 -
Flags: review?(pavlov)
Attachment #252484 -
Flags: review?(pavlov)
Updated•17 years ago
|
Attachment #252764 -
Flags: superreview+
Attachment #252764 -
Flags: review?(pavlov)
Attachment #252764 -
Flags: review+
Comment 4•17 years ago
|
||
Comment on attachment 252764 [details] [diff] [review] add kOutputFormatNative and default to it actually, is there any reason to have mOutputFormat on the devicecontextspec? would it be easier to just call mPrintSettings->GetOutputFormat in GetSurfaceForPrinter?
Assignee | ||
Comment 5•17 years ago
|
||
(In reply to comment #4) > (From update of attachment 252764 [details] [diff] [review]) > actually, is there any reason to have mOutputFormat on the devicecontextspec? > would it be easier to just call mPrintSettings->GetOutputFormat in > GetSurfaceForPrinter? I just followed how the other print settings are cached in the devicecontextspec; if you prefer it without that, I change the patch.
Updated•17 years ago
|
Assignee: printing → chpe
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 6•17 years ago
|
||
Updated patch to trunk. I removed the caching of the setting, and added a null check.
Assignee | ||
Comment 7•17 years ago
|
||
Attachment #252764 -
Attachment is obsolete: true
Attachment #259700 -
Attachment is obsolete: true
Attachment #273828 -
Flags: review?(pavlov)
Updated•17 years ago
|
Attachment #273828 -
Flags: review?(pavlov) → review+
Assignee | ||
Comment 8•17 years ago
|
||
Does this need sr, or is this ready for checkin?
Comment 9•17 years ago
|
||
I guess it does need sr (see the log: http://bonsai.mozilla.org/cvslog.cgi?file=mozilla/widget/src/gtk2/nsDeviceContextSpecG.cpp), but you can request that from pavlov as well. Or ask roc.
Assignee | ||
Updated•17 years ago
|
Attachment #273828 -
Flags: superreview?(roc)
Attachment #273828 -
Flags: superreview?(roc) → superreview+
Assignee | ||
Updated•17 years ago
|
Keywords: checkin-needed
Comment 10•17 years ago
|
||
You now need to request approval1.9 as well, and provide a short evaluation of risk and benefit of the patch... http://groups.google.com/group/mozilla.dev.planning/browse_thread/thread/569a23ce266a451/265344ae5291dee0
Updated•17 years ago
|
Attachment #273828 -
Flags: approval1.9?
Updated•17 years ago
|
Attachment #273828 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 11•17 years ago
|
||
The patch has no risk at all since it's just replacing an |#ifdef| with an |if ()| which will take the same branch as the #ifdef by default (the default value is kOutputFormatNative; and no code in mozilla sets it to any other value). The benefit is for embedders (Epiphany) that want to allow printing to PDF file instead of PS file.
Comment 12•17 years ago
|
||
Patch checked into trunk.
Updated•17 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•