From 3904daf1b359665dbe6fea6caef109e9d33055cc Mon Sep 17 00:00:00 2001 From: Kyle Kirby Date: Thu, 30 Jan 2014 18:47:52 -0600 Subject: [PATCH] Fixed a bug where the xref table would have incorrect offsets. The additional "\n" character upon the final ".join" of data wasn't taken into account. This may fix #173 and #147. --- lib/document.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/document.coffee b/lib/document.coffee index 353bdbe..18298a7 100644 --- a/lib/document.coffee +++ b/lib/document.coffee @@ -129,7 +129,7 @@ class PDFDocument return out generateBody: (out, fn) -> - offset = out.join('\n').length + offset = out.join('\n').length + 1 refs = (ref for id, ref of @store.objects) do proceed = => @@ -155,7 +155,7 @@ class PDFDocument generateTrailer: (out) -> trailer = PDFObject.convert - Size: @store.length + Size: @store.length + 1 Root: @store.root Info: @_info