   [parent pdf-object]
   (println "Called draw-custom-layout!"))
 
+(defn insert-new-page!
+  [parent pdf-object]
+  (let [document (parent :object)
+        cb       (parent :context-byte)]
+    (. document newPage)))
+
 (def add-fns {"TextDraw"   draw-text!
               "Phrase"     add-phrase!
               "Paragraph"  add-paragraph!
               "Line"       draw-line!
               "Table"      add-table!
-              "Custom"     draw-custom-layout!})
+              "Custom"     draw-custom-layout!
+              "NewPage"    insert-new-page!})
 
 (defn print-font-families
   []

  "application/pdf")

(def directions { "h" BaseFont/IDENTITY_H
                  "v"   BaseFont/IDENTITY_V })

(def default-fonts (ref {:hmv  (BaseFont/createFont "HeiseiMin-W3" "UniJIS-UCS2-V" BaseFont/EMBEDDED)
                         :hmh  (BaseFont/createFont "HeiseiMin-W3" "UniJIS-UCS2-H" BaseFont/EMBEDDED)

(defn generate
  "Generate a PDF file"
  [file data]
  (let [page         (if (nil? (data "page"))
                         { "size" { "width" 210 "height" 297 }}
                         (data "page"))
        page-rect    (let [size (page "size")]
                       (if (nil? size)
                           (. PageSize A4)
                           (Rectangle. (* 2.83 (size "width")) (* 2.83 (size "height")))))
        page-margins (let [margins (page "margins")]
                       (if (nil? margins)
                           { "left" 20 "right" 20 "top" 20 "bottom" 20 }
