Showing
1 changed file
with
4 additions
and
12 deletions
@@ -51,18 +51,14 @@ class PdfOutput { | @@ -51,18 +51,14 @@ class PdfOutput { | ||
51 | 51 | ||
52 | /// This method writes a [PdfObject] to the stream. | 52 | /// This method writes a [PdfObject] to the stream. |
53 | void write(PdfObject ob) { | 53 | void write(PdfObject ob) { |
54 | - // Check the object to see if it's one that is needed in the trailer | ||
55 | - // object | 54 | + // Check the object to see if it's one that is needed later |
56 | if (ob is PdfCatalog) { | 55 | if (ob is PdfCatalog) { |
57 | rootID = ob; | 56 | rootID = ob; |
58 | - } | ||
59 | - if (ob is PdfInfo) { | 57 | + } else if (ob is PdfInfo) { |
60 | infoID = ob; | 58 | infoID = ob; |
61 | - } | ||
62 | - if (ob is PdfEncryption) { | 59 | + } else if (ob is PdfEncryption) { |
63 | encryptID = ob; | 60 | encryptID = ob; |
64 | - } | ||
65 | - if (ob is PdfSignature) { | 61 | + } else if (ob is PdfSignature) { |
66 | assert(signatureID == null, 'Only one document signature is allowed'); | 62 | assert(signatureID == null, 'Only one document signature is allowed'); |
67 | signatureID = ob; | 63 | signatureID = ob; |
68 | } | 64 | } |
@@ -74,12 +70,8 @@ class PdfOutput { | @@ -74,12 +70,8 @@ class PdfOutput { | ||
74 | /// This closes the Stream, writing the xref table | 70 | /// This closes the Stream, writing the xref table |
75 | void close() { | 71 | void close() { |
76 | final xref = os.offset; | 72 | final xref = os.offset; |
77 | - | ||
78 | os.putString('xref\n'); | 73 | os.putString('xref\n'); |
79 | 74 | ||
80 | - // Now a single subsection for object 0 | ||
81 | - //os.write("0 1\n0000000000 65535 f \n"); | ||
82 | - | ||
83 | // Now scan through the offsets list. The should be in sequence, | 75 | // Now scan through the offsets list. The should be in sequence, |
84 | // but just in case: | 76 | // but just in case: |
85 | var firstid = 0; // First id in block | 77 | var firstid = 0; // First id in block |
-
Please register or login to post a comment