-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Crash when rendering a web page as PDF #12500
Comments
An alternative self-contained test script: var page = require('webpage').create();
page.open("about:blank", function() {
page.render("test.pdf");
phantom.exit()
}); |
Can't confirm on Windows. |
@vitallium Good to know! Hopefully this is not a cross-platform bug. |
PhantomJS crashes due to a null pointer here: https://github.com/ariya/phantomjs/blob/master/src/qt/qtbase/src/plugins/printsupport/cocoa/main.cpp#L66 |
I concur, the stack trace looks like this:
|
OTOH, there is also a closely related upstream bug: https://bugreports.qt-project.org/browse/QTBUG-33109. Particularly interesting is that it seems this is general Qt on OS X |
I found a quick workaround. We simply need to implement |
By implementing a dummy platform native interface (for now, it may be extended in the near future), QPlatformPrinterSupportPlugin will avoid the path of loading the printer support plugin (QCocoaPrinterSupportPlugin on OS X). Related upstream bug (QCocoaPrinterSupportPlugin problem with static build): https://bugreports.qt-project.org/browse/QTBUG-33109 #12500
this commit fixed rasterize.js for me on 10.9 via Homebrew install --HEAD. thanks! |
By implementing a dummy platform native interface (for now, it may be extended in the near future), QPlatformPrinterSupportPlugin will avoid the path of loading the printer support plugin (QCocoaPrinterSupportPlugin on OS X). Related upstream bug (QCocoaPrinterSupportPlugin problem with static build): https://bugreports.qt-project.org/browse/QTBUG-33109 ariya/phantomjs#12500
See also the following commit in PhantomJS: commit 7317724723639932f79c211ac40f5ca06f4d9e1a Author: Ariya Hidayat <ariya.hidayat@gmail.com> Date: Tue Aug 26 23:25:01 2014 -0700 Fix consistent crash on OS X when rendering to PDF format. By implementing a dummy platform native interface (for now, it may be extended in the near future), QPlatformPrinterSupportPlugin will avoid the path of loading the printer support plugin (QCocoaPrinterSupportPlugin on OS X). Related upstream bug (QCocoaPrinterSupportPlugin problem with static build): https://bugreports.qt-project.org/browse/QTBUG-33109 ariya/phantomjs#12500
See also the following commit in PhantomJS: commit 7317724723639932f79c211ac40f5ca06f4d9e1a Author: Ariya Hidayat <ariya.hidayat@gmail.com> Date: Tue Aug 26 23:25:01 2014 -0700 Fix consistent crash on OS X when rendering to PDF format. By implementing a dummy platform native interface (for now, it may be extended in the near future), QPlatformPrinterSupportPlugin will avoid the path of loading the printer support plugin (QCocoaPrinterSupportPlugin on OS X). Related upstream bug (QCocoaPrinterSupportPlugin problem with static build): https://bugreports.qt-project.org/browse/QTBUG-33109 ariya/phantomjs#12500
This is a regression in master branch.
To reproduce it:
PhantomJS will crash instead of producing the PDF file. Other formats (PNG, JPEG) don't have the problem.
Test on OS X.
The text was updated successfully, but these errors were encountered: