Allow setting page.paperSize from options explicitly #134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
http://phantomjs.org/api/webpage/property/paper-size.html
Currently
paperSize
is always defined, so size auto detection is unusable, although I personally sometimes need it.Problem
I couldn't find a way in PhantomJS to turn on size auto detection and use headers/footers at the same time. So, adding options like
format: 'auto'
seems unreasonable because it would break other options.Variant of solution
Well.. allowing users to set PhantomJS pageSize to what they exactly want seems to work just find and it must be quite obvious that setting it manually will overwrite other options. And setting it to
empty object (
{}
) does the work and turns on page size auto detection, so it's a kind of solution.Maybe having something like
pageSize: 'auto'
is better, but I'm not really sure.Comments appreciated.
P.S. If I missed something like contributing guidelines, I'll be glad if you point me to them.