File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656
5757page .paperSize = paperSize
5858
59+ page .onLoadFinished = (status ) ->
60+ # Output to parent process
61+ fileOptions =
62+ type : options .type || ' pdf'
63+ quality : options .quality || 75
5964
65+ # Option 1: Output file to stdout
66+ # Not working in Ubuntu 12.04 (at least not in my environment)
67+ if options .buffer
68+ page .render (' /dev/stdout' , fileOptions)
6069
61- # Output to parent process
62- fileOptions =
63- type : options .type || ' pdf'
64- quality : options .quality || 75
6570
66- # Option 1: Output file to stdout
67- # Not working in Ubuntu 12.04 (at least not in my environment)
68- if options .buffer
69- page .render (' /dev/stdout' , fileOptions)
70-
71-
72- # Option 2: Output filename to stdout
73- else
74- filename = options .filename || (" #{ options .directory || ' /tmp' } /html-pdf-#{ sys .pid } -#{ size} .#{ fileOptions .type } " )
75- page .render (filename, fileOptions)
76- sys .stdout .write (filename)
71+ # Option 2: Output filename to stdout
72+ else
73+ filename = options .filename || (" #{ options .directory || ' /tmp' } /html-pdf-#{ sys .pid } -#{ size} .#{ fileOptions .type } " )
74+ page .render (filename, fileOptions)
75+ sys .stdout .write (filename)
7776
7877
79- phantom .exit (0 )
78+ phantom .exit (0 )
You can’t perform that action at this time.
0 commit comments