PhantomJS人为控制打印PNG的尺寸

server-client:

page.onCallback = ( result ) ->
    console.log 'callback = ' + JSON.stringify result
    #set size
    page.viewportSize = { width : result.width + 50, height : result.height + 200 }

client-server:

if ( typeof window.callPhantom === 'function' ) {
    window.callPhantom({ 'width' : xxx, 'height' : xxx });
}
2014-04-29 11:23