Showing
2 changed files
with
11 additions
and
6 deletions
| @@ -101,6 +101,8 @@ class PdfXrefTable extends PdfDataType with PdfDiagnostic { | @@ -101,6 +101,8 @@ class PdfXrefTable extends PdfDataType with PdfDiagnostic { | ||
| 101 | 101 | ||
| 102 | final int lastObjectId; | 102 | final int lastObjectId; |
| 103 | 103 | ||
| 104 | + static const String libraryName = 'https://github.com/DavBfr/dart_pdf'; | ||
| 105 | + | ||
| 104 | /// Writes a block of references to the Pdf file | 106 | /// Writes a block of references to the Pdf file |
| 105 | void _writeBlock(PdfStream s, int firstId, List<PdfXref> block) { | 107 | void _writeBlock(PdfStream s, int firstId, List<PdfXref> block) { |
| 106 | s.putString('$firstId ${block.length}\n'); | 108 | s.putString('$firstId ${block.length}\n'); |
| @@ -125,13 +127,16 @@ class PdfXrefTable extends PdfDataType with PdfDiagnostic { | @@ -125,13 +127,16 @@ class PdfXrefTable extends PdfDataType with PdfDiagnostic { | ||
| 125 | 127 | ||
| 126 | s.putString('%PDF-$v\n'); | 128 | s.putString('%PDF-$v\n'); |
| 127 | s.putBytes(const <int>[0x25, 0xC2, 0xA5, 0xC2, 0xB1, 0xC3, 0xAB, 0x0A]); | 129 | s.putBytes(const <int>[0x25, 0xC2, 0xA5, 0xC2, 0xB1, 0xC3, 0xAB, 0x0A]); |
| 130 | + s.putComment(libraryName); | ||
| 128 | assert(() { | 131 | assert(() { |
| 129 | if (o.settings.verbose) { | 132 | if (o.settings.verbose) { |
| 130 | - setInsertion(s); | 133 | + setInsertion(s, 350); |
| 131 | startStopwatch(); | 134 | startStopwatch(); |
| 132 | debugFill('Verbose dart_pdf'); | 135 | debugFill('Verbose dart_pdf'); |
| 133 | - debugFill('Producer https://github.com/DavBfr/dart_pdf'); | 136 | + debugFill('Producer $libraryName'); |
| 134 | debugFill('Creation date: ${DateTime.now()}'); | 137 | debugFill('Creation date: ${DateTime.now()}'); |
| 138 | + debugFill('Compress: ${o.settings.compress}'); | ||
| 139 | + debugFill('Crypto: ${o.settings.encryptCallback != null}'); | ||
| 135 | } | 140 | } |
| 136 | return true; | 141 | return true; |
| 137 | }()); | 142 | }()); |
| @@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
| 17 | import '../document.dart'; | 17 | import '../document.dart'; |
| 18 | import '../format/dict.dart'; | 18 | import '../format/dict.dart'; |
| 19 | import '../format/string.dart'; | 19 | import '../format/string.dart'; |
| 20 | +import '../format/xref.dart'; | ||
| 20 | import 'object.dart'; | 21 | import 'object.dart'; |
| 21 | 22 | ||
| 22 | /// Information object | 23 | /// Information object |
| @@ -39,15 +40,14 @@ class PdfInfo extends PdfObject<PdfDict> { | @@ -39,15 +40,14 @@ class PdfInfo extends PdfObject<PdfDict> { | ||
| 39 | if (subject != null) '/Subject': PdfString.fromString(subject), | 40 | if (subject != null) '/Subject': PdfString.fromString(subject), |
| 40 | if (keywords != null) '/Keywords': PdfString.fromString(keywords), | 41 | if (keywords != null) '/Keywords': PdfString.fromString(keywords), |
| 41 | if (producer != null) | 42 | if (producer != null) |
| 42 | - '/Producer': PdfString.fromString('$producer ($_libraryName)') | 43 | + '/Producer': PdfString.fromString( |
| 44 | + '$producer (${PdfXrefTable.libraryName})') | ||
| 43 | else | 45 | else |
| 44 | - '/Producer': PdfString.fromString(_libraryName), | 46 | + '/Producer': PdfString.fromString(PdfXrefTable.libraryName), |
| 45 | '/CreationDate': PdfString.fromDate(DateTime.now()), | 47 | '/CreationDate': PdfString.fromDate(DateTime.now()), |
| 46 | }), | 48 | }), |
| 47 | ); | 49 | ); |
| 48 | 50 | ||
| 49 | - static const String _libraryName = 'https://github.com/DavBfr/dart_pdf'; | ||
| 50 | - | ||
| 51 | /// Author of this document | 51 | /// Author of this document |
| 52 | final String? author; | 52 | final String? author; |
| 53 | 53 |
-
Please register or login to post a comment