Permalink
Browse files

Added input and output for templates

  • Loading branch information...
1 parent d30168c commit 8a170ebfe6c8e638ef3b70ffec68005ff658036d @alFReD-NSH committed Dec 25, 2011
Showing with 10 additions and 3 deletions.
  1. +10 −3 lib/document.coffee
View
@@ -79,7 +79,9 @@ class PDFDocument
@store.ref(data)
addContent: (str) ->
+ console.log @haveTemp
if @haveTemp is true
+ console.log 'hi'
@temp.add str
else
@page.content.add str
@@ -121,14 +123,13 @@ class PDFDocument
generateBody: (out) ->
offset = out.join('\n').length
-
for id, ref of @store.objects
object = ref.object()
ref.offset = offset
out.push object
offset += object.length + 1
-
+ console.log out
@xref_offset = offset
generateXRef: (out) ->
@@ -162,7 +163,13 @@ class PDFDocument
@haveTemp = true
endTemp: ->
- @temp.finalize @compress
+ @temp.finalize true
@haveTemp = false
+
+ outputTemp: ->
+ @temp
+
+ inputTemp: (input)->
+ @store.objects[5] = input
module.exports = PDFDocument

0 comments on commit 8a170eb

Please sign in to comment.