diff --git a/docs/getting_started.coffee.md b/docs/getting_started.coffee.md index d4d89d8..bf277d4 100644 --- a/docs/getting_started.coffee.md +++ b/docs/getting_started.coffee.md @@ -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() diff --git a/lib/document.coffee b/lib/document.coffee index bd9d863..d91b676 100644 --- a/lib/document.coffee +++ b/lib/document.coffee @@ -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