David PHAM-VAN

Move libraryName

... ... @@ -101,6 +101,8 @@ class PdfXrefTable extends PdfDataType with PdfDiagnostic {
final int lastObjectId;
static const String libraryName = 'https://github.com/DavBfr/dart_pdf';
/// Writes a block of references to the Pdf file
void _writeBlock(PdfStream s, int firstId, List<PdfXref> block) {
s.putString('$firstId ${block.length}\n');
... ... @@ -125,13 +127,16 @@ class PdfXrefTable extends PdfDataType with PdfDiagnostic {
s.putString('%PDF-$v\n');
s.putBytes(const <int>[0x25, 0xC2, 0xA5, 0xC2, 0xB1, 0xC3, 0xAB, 0x0A]);
s.putComment(libraryName);
assert(() {
if (o.settings.verbose) {
setInsertion(s);
setInsertion(s, 350);
startStopwatch();
debugFill('Verbose dart_pdf');
debugFill('Producer https://github.com/DavBfr/dart_pdf');
debugFill('Producer $libraryName');
debugFill('Creation date: ${DateTime.now()}');
debugFill('Compress: ${o.settings.compress}');
debugFill('Crypto: ${o.settings.encryptCallback != null}');
}
return true;
}());
... ...
... ... @@ -17,6 +17,7 @@
import '../document.dart';
import '../format/dict.dart';
import '../format/string.dart';
import '../format/xref.dart';
import 'object.dart';
/// Information object
... ... @@ -39,15 +40,14 @@ class PdfInfo extends PdfObject<PdfDict> {
if (subject != null) '/Subject': PdfString.fromString(subject),
if (keywords != null) '/Keywords': PdfString.fromString(keywords),
if (producer != null)
'/Producer': PdfString.fromString('$producer ($_libraryName)')
'/Producer': PdfString.fromString(
'$producer (${PdfXrefTable.libraryName})')
else
'/Producer': PdfString.fromString(_libraryName),
'/Producer': PdfString.fromString(PdfXrefTable.libraryName),
'/CreationDate': PdfString.fromDate(DateTime.now()),
}),
);
static const String _libraryName = 'https://github.com/DavBfr/dart_pdf';
/// Author of this document
final String? author;
... ...