[webkit-reviews] review requested: [Bug 3527] Allow Safari to open
postscript files in browser windows as well : [Attachment
6313] Patch v4
bugzilla-request-daemon at opendarwin.org
bugzilla-request-daemon at opendarwin.org
Mon Feb 6 22:06:43 PST 2006
David D. Kilzer <ddkilzer at kilzer.net> has asked Darin Adler <darin at apple.com>
for review:
Bug 3527: Allow Safari to open postscript files in browser windows as well
http://bugzilla.opendarwin.org/show_bug.cgi?id=3527
Attachment 6313: Patch v4
http://bugzilla.opendarwin.org/attachment.cgi?id=6313&action=edit
------- Additional Comments from David D. Kilzer <ddkilzer at kilzer.net>
Update from Patch v3:
- Now use WebCFAutorelease() on result object at end of
convertPostScriptDataSourceToPDF()
- CGPSConverterConvert() fails by returning false and leaving the result object
zero-length.
- It is not possible to pass in 0 in place of the CGPSConverterCallbacks struct
to CGPSConverterCreate(). (I got a Bus Error inside CGPSConverterCreate() when
I tried it.)
- Restructured code per Comment #15.
- Added code to display an NSAlert exactly like Preview does when it fails to
convert a PostScript file. Not sure if that's what you want to do ultimately,
but it seems to work as I expected it to!
- Return early from finishedLoadingWithDataSource() if NSData* returned from
convertPostScriptDataSourceToPDF() is zero length. (This leaves the window
"darkened", though, which happens before a PDF is displayed.) If I pass the
empty NSData* through, nothing else happens except that WebKit/Safari prints
this to either stdout or stderr: "Failed to find PDF header: `%PDF' not
found."
- Giving the copyright to Apple since I'm not sure what good it would do me for
this small amount of code. :)
More information about the webkit-reviews
mailing list