Merge pull request #383 from naturalatlas/no-auto-first-page

Allow automatic first page to be disabled (#65).
This commit is contained in:
Devon Govett 2015-04-02 15:26:36 -07:00
commit 7acefc28c6
2 changed files with 3 additions and 2 deletions

View File

@ -80,7 +80,7 @@ If you forget to install it, Browserify will print an error message.
## Adding pages
The first page of a PDFKit document is added for you automatically when you
create the document. Subsequent pages must be added by you. Luckily, it is
create the document unless you provide `autoFirstPage: false`. Subsequent pages must be added by you. Luckily, it is
quite simple!
doc.addPage()

View File

@ -63,7 +63,8 @@ class PDFDocument extends stream.Readable
@_write "%\xFF\xFF\xFF\xFF"
# Add the first page
@addPage()
if @options.autoFirstPage != false
@addPage()
mixin = (methods) =>
for name, method of methods