   [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)

        ]
    (. document open)
    (let [context-byte (.. writer getDirectContent)
          parent       {:object       document
                        :context-byte context-byte
                        :font         (@default-fonts :hkgh)
                        :font-size    (float 10.0)}]
      (add-objects parent (data "pdf_objects")))
    (. document close)
    (. writer close)))

