Showing
7 changed files
with
17 additions
and
17 deletions
| @@ -73,7 +73,7 @@ class PdfCatalog extends PdfObject { | @@ -73,7 +73,7 @@ class PdfCatalog extends PdfObject { | ||
| 73 | params['/PageMode'] = PdfName(_PdfPageModes[pageMode.index]); | 73 | params['/PageMode'] = PdfName(_PdfPageModes[pageMode.index]); |
| 74 | 74 | ||
| 75 | if (pdfDocument.sign != null) { | 75 | if (pdfDocument.sign != null) { |
| 76 | - params['/Perms'] = PdfDict(<String, PdfDataType>{ | 76 | + params['/Perms'] = PdfDict({ |
| 77 | '/DocMDP': pdfDocument.sign!.ref(), | 77 | '/DocMDP': pdfDocument.sign!.ref(), |
| 78 | }); | 78 | }); |
| 79 | } | 79 | } |
| @@ -88,7 +88,7 @@ class PdfCatalog extends PdfObject { | @@ -88,7 +88,7 @@ class PdfCatalog extends PdfObject { | ||
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | if (widgets.isNotEmpty) { | 90 | if (widgets.isNotEmpty) { |
| 91 | - params['/AcroForm'] = PdfDict(<String, PdfDataType>{ | 91 | + params['/AcroForm'] = PdfDict({ |
| 92 | '/SigFlags': PdfNum(pdfDocument.sign?.flagsValue ?? 0), | 92 | '/SigFlags': PdfNum(pdfDocument.sign?.flagsValue ?? 0), |
| 93 | '/Fields': PdfArray.fromObjects(widgets), | 93 | '/Fields': PdfArray.fromObjects(widgets), |
| 94 | }); | 94 | }); |
| @@ -526,7 +526,7 @@ class PdfDict<T extends PdfDataType> extends PdfDataType { | @@ -526,7 +526,7 @@ class PdfDict<T extends PdfDataType> extends PdfDataType { | ||
| 526 | ); | 526 | ); |
| 527 | } | 527 | } |
| 528 | 528 | ||
| 529 | - final Map<String, T> values = <String, T>{}; | 529 | + final values = <String, T>{}; |
| 530 | 530 | ||
| 531 | bool get isNotEmpty => values.isNotEmpty; | 531 | bool get isNotEmpty => values.isNotEmpty; |
| 532 | 532 |
| @@ -127,7 +127,7 @@ mixin PdfGraphicStream on PdfObject { | @@ -127,7 +127,7 @@ mixin PdfGraphicStream on PdfObject { | ||
| 127 | 127 | ||
| 128 | if (pdfDocument.hasGraphicStates) { | 128 | if (pdfDocument.hasGraphicStates) { |
| 129 | // Declare Transparency Group settings | 129 | // Declare Transparency Group settings |
| 130 | - params['/Group'] = PdfDict(<String, PdfDataType>{ | 130 | + params['/Group'] = PdfDict({ |
| 131 | '/Type': const PdfName('/Group'), | 131 | '/Type': const PdfName('/Group'), |
| 132 | '/S': const PdfName('/Transparency'), | 132 | '/S': const PdfName('/Transparency'), |
| 133 | '/CS': const PdfName('/DeviceRGB'), | 133 | '/CS': const PdfName('/DeviceRGB'), |
| @@ -36,8 +36,8 @@ class PdfNames extends PdfObject { | @@ -36,8 +36,8 @@ class PdfNames extends PdfObject { | ||
| 36 | }) { | 36 | }) { |
| 37 | assert(page.pdfDocument == pdfDocument); | 37 | assert(page.pdfDocument == pdfDocument); |
| 38 | 38 | ||
| 39 | - _dests[name] = PdfDict(<String, PdfDataType>{ | ||
| 40 | - '/D': PdfArray(<PdfDataType>[ | 39 | + _dests[name] = PdfDict({ |
| 40 | + '/D': PdfArray([ | ||
| 41 | page.ref(), | 41 | page.ref(), |
| 42 | const PdfName('/XYZ'), | 42 | const PdfName('/XYZ'), |
| 43 | if (posX == null) const PdfNull() else PdfNum(posX), | 43 | if (posX == null) const PdfNull() else PdfNum(posX), |
| @@ -63,7 +63,7 @@ class PdfNames extends PdfObject { | @@ -63,7 +63,7 @@ class PdfNames extends PdfObject { | ||
| 63 | final dict = PdfDict(); | 63 | final dict = PdfDict(); |
| 64 | if (dests.values.isNotEmpty) { | 64 | if (dests.values.isNotEmpty) { |
| 65 | dict['/Names'] = dests; | 65 | dict['/Names'] = dests; |
| 66 | - dict['/Limits'] = PdfArray(<PdfDataType>[ | 66 | + dict['/Limits'] = PdfArray([ |
| 67 | PdfSecString.fromString(this, keys.first), | 67 | PdfSecString.fromString(this, keys.first), |
| 68 | PdfSecString.fromString(this, keys.last), | 68 | PdfSecString.fromString(this, keys.last), |
| 69 | ]); | 69 | ]); |
| @@ -112,7 +112,7 @@ class PdfOutput { | @@ -112,7 +112,7 @@ class PdfOutput { | ||
| 112 | params['/Root'] = rootID!.ref(); | 112 | params['/Root'] = rootID!.ref(); |
| 113 | final id = | 113 | final id = |
| 114 | PdfString(rootID!.pdfDocument.documentID, PdfStringFormat.binary); | 114 | PdfString(rootID!.pdfDocument.documentID, PdfStringFormat.binary); |
| 115 | - params['/ID'] = PdfArray(<PdfDataType>[id, id]); | 115 | + params['/ID'] = PdfArray([id, id]); |
| 116 | } else { | 116 | } else { |
| 117 | throw Exception('Root object is not present in document'); | 117 | throw Exception('Root object is not present in document'); |
| 118 | } | 118 | } |
| @@ -111,19 +111,19 @@ class PdfTtfFont extends PdfFont { | @@ -111,19 +111,19 @@ class PdfTtfFont extends PdfFont { | ||
| 111 | file.buf.putBytes(data); | 111 | file.buf.putBytes(data); |
| 112 | file.params['/Length1'] = PdfNum(data.length); | 112 | file.params['/Length1'] = PdfNum(data.length); |
| 113 | 113 | ||
| 114 | - final descendantFont = PdfDict(<String, PdfDataType>{ | 114 | + final descendantFont = PdfDict({ |
| 115 | '/Type': const PdfName('/Font'), | 115 | '/Type': const PdfName('/Font'), |
| 116 | '/BaseFont': PdfName('/' + fontName), | 116 | '/BaseFont': PdfName('/' + fontName), |
| 117 | '/FontFile2': file.ref(), | 117 | '/FontFile2': file.ref(), |
| 118 | '/FontDescriptor': descriptor.ref(), | 118 | '/FontDescriptor': descriptor.ref(), |
| 119 | - '/W': PdfArray(<PdfDataType>[ | 119 | + '/W': PdfArray([ |
| 120 | const PdfNum(0), | 120 | const PdfNum(0), |
| 121 | widthsObject.ref(), | 121 | widthsObject.ref(), |
| 122 | ]), | 122 | ]), |
| 123 | '/CIDToGIDMap': const PdfName('/Identity'), | 123 | '/CIDToGIDMap': const PdfName('/Identity'), |
| 124 | '/DW': const PdfNum(1000), | 124 | '/DW': const PdfNum(1000), |
| 125 | '/Subtype': const PdfName('/CIDFontType2'), | 125 | '/Subtype': const PdfName('/CIDFontType2'), |
| 126 | - '/CIDSystemInfo': PdfDict(<String, PdfDataType>{ | 126 | + '/CIDSystemInfo': PdfDict({ |
| 127 | '/Supplement': const PdfNum(0), | 127 | '/Supplement': const PdfNum(0), |
| 128 | '/Registry': PdfSecString.fromString(this, 'Adobe'), | 128 | '/Registry': PdfSecString.fromString(this, 'Adobe'), |
| 129 | '/Ordering': PdfSecString.fromString(this, 'Identity-H'), | 129 | '/Ordering': PdfSecString.fromString(this, 'Identity-H'), |
| @@ -132,7 +132,7 @@ class PdfTtfFont extends PdfFont { | @@ -132,7 +132,7 @@ class PdfTtfFont extends PdfFont { | ||
| 132 | 132 | ||
| 133 | params['/BaseFont'] = PdfName('/' + fontName); | 133 | params['/BaseFont'] = PdfName('/' + fontName); |
| 134 | params['/Encoding'] = const PdfName('/Identity-H'); | 134 | params['/Encoding'] = const PdfName('/Identity-H'); |
| 135 | - params['/DescendantFonts'] = PdfArray(<PdfDataType>[descendantFont]); | 135 | + params['/DescendantFonts'] = PdfArray([descendantFont]); |
| 136 | params['/ToUnicode'] = unicodeCMap.ref(); | 136 | params['/ToUnicode'] = unicodeCMap.ref(); |
| 137 | 137 | ||
| 138 | charMin = 0; | 138 | charMin = 0; |
| @@ -76,11 +76,11 @@ void main() { | @@ -76,11 +76,11 @@ void main() { | ||
| 76 | test('PdfDataTypes Array', () { | 76 | test('PdfDataTypes Array', () { |
| 77 | expect(PdfArray().toString(), '[]'); | 77 | expect(PdfArray().toString(), '[]'); |
| 78 | expect( | 78 | expect( |
| 79 | - PdfArray(<PdfDataType>[const PdfNum(1), const PdfNum(2)]).toString(), | 79 | + PdfArray([const PdfNum(1), const PdfNum(2)]).toString(), |
| 80 | '[1 2]', | 80 | '[1 2]', |
| 81 | ); | 81 | ); |
| 82 | expect( | 82 | expect( |
| 83 | - PdfArray(<PdfDataType>[ | 83 | + PdfArray([ |
| 84 | const PdfName('/Name'), | 84 | const PdfName('/Name'), |
| 85 | const PdfName('/Other'), | 85 | const PdfName('/Other'), |
| 86 | const PdfBool(false), | 86 | const PdfBool(false), |
| @@ -98,15 +98,15 @@ void main() { | @@ -98,15 +98,15 @@ void main() { | ||
| 98 | expect(PdfDict().toString(), '<<>>'); | 98 | expect(PdfDict().toString(), '<<>>'); |
| 99 | 99 | ||
| 100 | expect( | 100 | expect( |
| 101 | - PdfDict(<String, PdfDataType>{ | 101 | + PdfDict({ |
| 102 | '/Name': const PdfName('/Value'), | 102 | '/Name': const PdfName('/Value'), |
| 103 | '/Bool': const PdfBool(true), | 103 | '/Bool': const PdfBool(true), |
| 104 | '/Num': const PdfNum(42), | 104 | '/Num': const PdfNum(42), |
| 105 | '/String': PdfString.fromString('hello'), | 105 | '/String': PdfString.fromString('hello'), |
| 106 | '/Null': const PdfNull(), | 106 | '/Null': const PdfNull(), |
| 107 | '/Indirect': const PdfIndirect(55, 0), | 107 | '/Indirect': const PdfIndirect(55, 0), |
| 108 | - '/Array': PdfArray(<PdfDataType>[]), | ||
| 109 | - '/Dict': PdfDict(<String, PdfDataType>{}), | 108 | + '/Array': PdfArray<PdfDataType>([]), |
| 109 | + '/Dict': PdfDict<PdfDataType>({}), | ||
| 110 | }).toString(), | 110 | }).toString(), |
| 111 | '<</Name/Value/Bool true/Num 42/String(hello)/Null null/Indirect 55 0 R/Array[]/Dict<<>>>>', | 111 | '<</Name/Value/Bool true/Num 42/String(hello)/Null null/Indirect 55 0 R/Array[]/Dict<<>>>>', |
| 112 | ); | 112 | ); |
-
Please register or login to post a comment