laurentj/slimerjs — pull request #195 by bernardeli (2014-06-16 07:08:05+00:00)
Title: Add options to PDF

Hi,

First of all, thanks for the great work that you've put into SlimerJS.

I couldn't be more excited when PDF rendering came out, unfortunately it does not honour width and height.

Looking at SlimerJS code, I realised it creates a print profile every time you render to PDF.
I have found all available print settings here: http://dxr.mozilla.org/mozilla-central/source/widget/nsIPrintSettings.idl

Having that said, I've tweaked the code to accept dimensions as well as ability to set margin and resolutions.

This solves #162.

The options are:
```
printSettings.marginTop
printSettings.marginRight
printSettings.marginBottom
printSettings.marginLeft
printSettings.unwriteableMarginTop
printSettings.unwriteableMarginRight
printSettings.unwriteableMarginBottom
printSettings.unwriteableMarginLeft
printSettings.resolution
printSettings.paperWidth
printSettings.paperHeight
```

Also, I've bumped to gecko 30.0. I've got some really heavy html that loads heaps of SVG. I believe previous versions had memory leaks, and randomly crashed with `Illegal instructions` and `Segmentation Fault`. After updating, all errors have been solved apparently.

Please instruct me if you require anything else for merging this pull request, and hope it helps other developers!

Cheers
@bernardeli