Showing
84 changed files
with
778 additions
and
327 deletions
@@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
10 | - Fix PdfOutlineMode enum | 10 | - Fix PdfOutlineMode enum |
11 | - Improve API documentation | 11 | - Improve API documentation |
12 | - Add support for Icon Fonts (MaterialIcons) | 12 | - Add support for Icon Fonts (MaterialIcons) |
13 | +- Opt-out from dart library | ||
13 | 14 | ||
14 | ## 1.12.0 | 15 | ## 1.12.0 |
15 | 16 |
@@ -14,64 +14,27 @@ | @@ -14,64 +14,27 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -library pdf; | ||
18 | - | ||
19 | -import 'dart:collection'; | ||
20 | -import 'dart:convert'; | ||
21 | -import 'dart:math' as math; | ||
22 | -import 'dart:typed_data'; | ||
23 | - | ||
24 | -import 'package:crypto/crypto.dart'; | ||
25 | -import 'package:image/image.dart' as im; | ||
26 | -import 'package:meta/meta.dart'; | ||
27 | -import 'package:path_parsing/path_parsing.dart'; | ||
28 | -import 'package:utf/utf.dart'; | ||
29 | -import 'package:vector_math/vector_math_64.dart'; | ||
30 | - | ||
31 | -import 'io/interface.dart' | ||
32 | - if (dart.library.io) 'io/vm.dart' | ||
33 | - if (dart.library.js) 'io/js.dart'; | ||
34 | - | ||
35 | -part 'src/annotation.dart'; | ||
36 | -part 'src/arabic.dart'; | ||
37 | -part 'src/array.dart'; | ||
38 | -part 'src/ascii85.dart'; | ||
39 | -part 'src/border.dart'; | ||
40 | -part 'src/catalog.dart'; | ||
41 | -part 'src/color.dart'; | ||
42 | -part 'src/colors.dart'; | ||
43 | -part 'src/data_types.dart'; | ||
44 | -part 'src/document.dart'; | ||
45 | -part 'src/encryption.dart'; | ||
46 | -part 'src/exif.dart'; | ||
47 | -part 'src/font.dart'; | ||
48 | -part 'src/font_descriptor.dart'; | ||
49 | -part 'src/font_metrics.dart'; | ||
50 | -part 'src/formxobject.dart'; | ||
51 | -part 'src/function.dart'; | ||
52 | -part 'src/graphic_state.dart'; | ||
53 | -part 'src/graphic_stream.dart'; | ||
54 | -part 'src/graphics.dart'; | ||
55 | -part 'src/image.dart'; | ||
56 | -part 'src/info.dart'; | ||
57 | -part 'src/names.dart'; | ||
58 | -part 'src/object.dart'; | ||
59 | -part 'src/object_stream.dart'; | ||
60 | -part 'src/outline.dart'; | ||
61 | -part 'src/output.dart'; | ||
62 | -part 'src/page.dart'; | ||
63 | -part 'src/page_format.dart'; | ||
64 | -part 'src/page_list.dart'; | ||
65 | -part 'src/point.dart'; | ||
66 | -part 'src/rect.dart'; | ||
67 | -part 'src/shading.dart'; | ||
68 | -part 'src/signature.dart'; | ||
69 | -part 'src/stream.dart'; | ||
70 | -part 'src/ttf_parser.dart'; | ||
71 | -part 'src/ttf_writer.dart'; | ||
72 | -part 'src/ttffont.dart'; | ||
73 | -part 'src/type1_font.dart'; | ||
74 | -part 'src/type1_fonts.dart'; | ||
75 | -part 'src/unicode_cmap.dart'; | ||
76 | -part 'src/xobject.dart'; | ||
77 | -part 'src/xref.dart'; | 17 | +export 'src/annotation.dart'; |
18 | +export 'src/arabic.dart'; | ||
19 | +export 'src/border.dart'; | ||
20 | +export 'src/color.dart'; | ||
21 | +export 'src/colors.dart'; | ||
22 | +export 'src/document.dart'; | ||
23 | +export 'src/encryption.dart'; | ||
24 | +export 'src/exif.dart'; | ||
25 | +export 'src/font.dart'; | ||
26 | +export 'src/font_metrics.dart'; | ||
27 | +export 'src/function.dart'; | ||
28 | +export 'src/graphic_state.dart'; | ||
29 | +export 'src/graphics.dart'; | ||
30 | +export 'src/image.dart'; | ||
31 | +export 'src/info.dart'; | ||
32 | +export 'src/outline.dart'; | ||
33 | +export 'src/page.dart'; | ||
34 | +export 'src/page_format.dart'; | ||
35 | +export 'src/point.dart'; | ||
36 | +export 'src/rect.dart'; | ||
37 | +export 'src/shading.dart'; | ||
38 | +export 'src/signature.dart'; | ||
39 | +export 'src/ttf_parser.dart'; | ||
40 | +export 'src/ttffont.dart'; |
@@ -14,7 +14,21 @@ | @@ -14,7 +14,21 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:vector_math/vector_math_64.dart'; | ||
19 | + | ||
20 | +import 'border.dart'; | ||
21 | +import 'color.dart'; | ||
22 | +import 'data_types.dart'; | ||
23 | +import 'document.dart'; | ||
24 | +import 'font.dart'; | ||
25 | +import 'graphic_stream.dart'; | ||
26 | +import 'graphics.dart'; | ||
27 | +import 'object.dart'; | ||
28 | +import 'page.dart'; | ||
29 | +import 'point.dart'; | ||
30 | +import 'rect.dart'; | ||
31 | +import 'stream.dart'; | ||
18 | 32 | ||
19 | class PdfAnnot extends PdfObject { | 33 | class PdfAnnot extends PdfObject { |
20 | PdfAnnot(this.pdfPage, this.annot) | 34 | PdfAnnot(this.pdfPage, this.annot) |
@@ -31,8 +45,8 @@ class PdfAnnot extends PdfObject { | @@ -31,8 +45,8 @@ class PdfAnnot extends PdfObject { | ||
31 | 45 | ||
32 | /// Output the annotation | 46 | /// Output the annotation |
33 | @override | 47 | @override |
34 | - void _prepare() { | ||
35 | - super._prepare(); | 48 | + void prepare() { |
49 | + super.prepare(); | ||
36 | annot.build(pdfPage, this, params); | 50 | annot.build(pdfPage, this, params); |
37 | } | 51 | } |
38 | } | 52 | } |
@@ -14,12 +14,6 @@ | @@ -14,12 +14,6 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -// https://github.com/agawish/Better-Arabic-Reshaper/tree/master/src/org/amr/arabic | ||
18 | -// http://mpcabd.xyz/python-arabic-text-reshaper/ | ||
19 | -// https://github.com/Georeactor/alif-toolkit/tree/master/src | ||
20 | - | ||
21 | -part of pdf; | ||
22 | - | ||
23 | /// Arabic shape substitutions functions | 17 | /// Arabic shape substitutions functions |
24 | class PdfArabic { | 18 | class PdfArabic { |
25 | /// Arabic shape substitutions: char code => (isolated, final, initial, medial). | 19 | /// Arabic shape substitutions: char code => (isolated, final, initial, medial). |
@@ -224,7 +218,7 @@ class PdfArabic { | @@ -224,7 +218,7 @@ class PdfArabic { | ||
224 | return _arabicDiacritics.containsKey(letter); | 218 | return _arabicDiacritics.containsKey(letter); |
225 | } | 219 | } |
226 | 220 | ||
227 | - static bool _isArabicDiacriticValue(int letter) { | 221 | + static bool isArabicDiacriticValue(int letter) { |
228 | return _arabicDiacritics.containsValue(letter); | 222 | return _arabicDiacritics.containsValue(letter); |
229 | } | 223 | } |
230 | 224 | ||
@@ -240,7 +234,7 @@ class PdfArabic { | @@ -240,7 +234,7 @@ class PdfArabic { | ||
240 | final finalDiacritics = <int>[]; | 234 | final finalDiacritics = <int>[]; |
241 | 235 | ||
242 | for (var i = 0; i < letters.length; i++) { | 236 | for (var i = 0; i < letters.length; i++) { |
243 | - if (_isArabicDiacriticValue(letters[i])) { | 237 | + if (isArabicDiacriticValue(letters[i])) { |
244 | effectedDiacritics.insert(0, letters[i]); | 238 | effectedDiacritics.insert(0, letters[i]); |
245 | if (tmpDiacritic.containsKey(letters[i])) { | 239 | if (tmpDiacritic.containsKey(letters[i])) { |
246 | tmpDiacritic = tmpDiacritic[letters[i]]; | 240 | tmpDiacritic = tmpDiacritic[letters[i]]; |
@@ -14,7 +14,10 @@ | @@ -14,7 +14,10 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'data_types.dart'; |
18 | +import 'document.dart'; | ||
19 | +import 'object.dart'; | ||
20 | +import 'stream.dart'; | ||
18 | 21 | ||
19 | /// An array object | 22 | /// An array object |
20 | class PdfArrayObject extends PdfObject { | 23 | class PdfArrayObject extends PdfObject { |
@@ -29,8 +32,8 @@ class PdfArrayObject extends PdfObject { | @@ -29,8 +32,8 @@ class PdfArrayObject extends PdfObject { | ||
29 | final PdfArray array; | 32 | final PdfArray array; |
30 | 33 | ||
31 | @override | 34 | @override |
32 | - void _writeContent(PdfStream os) { | ||
33 | - super._writeContent(os); | 35 | + void writeContent(PdfStream os) { |
36 | + super.writeContent(os); | ||
34 | 37 | ||
35 | array.output(os); | 38 | array.output(os); |
36 | os.putBytes(<int>[0x0a]); | 39 | os.putBytes(<int>[0x0a]); |
@@ -14,7 +14,8 @@ | @@ -14,7 +14,8 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:convert'; |
18 | +import 'dart:typed_data'; | ||
18 | 19 | ||
19 | /// Ascii 85 encoder | 20 | /// Ascii 85 encoder |
20 | class Ascii85Encoder extends Converter<Uint8List, Uint8List> { | 21 | class Ascii85Encoder extends Converter<Uint8List, Uint8List> { |
@@ -14,7 +14,10 @@ | @@ -14,7 +14,10 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'annotation.dart'; |
18 | +import 'data_types.dart'; | ||
19 | +import 'document.dart'; | ||
20 | +import 'object.dart'; | ||
18 | 21 | ||
19 | /// Border style | 22 | /// Border style |
20 | enum PdfBorderStyle { | 23 | enum PdfBorderStyle { |
@@ -58,8 +61,8 @@ class PdfBorder extends PdfObject { | @@ -58,8 +61,8 @@ class PdfBorder extends PdfObject { | ||
58 | final List<double> dash; | 61 | final List<double> dash; |
59 | 62 | ||
60 | @override | 63 | @override |
61 | - void _prepare() { | ||
62 | - super._prepare(); | 64 | + void prepare() { |
65 | + super.prepare(); | ||
63 | 66 | ||
64 | params['/S'] = | 67 | params['/S'] = |
65 | PdfName('/' + 'SDBIU'.substring(style.index, style.index + 1)); | 68 | PdfName('/' + 'SDBIU'.substring(style.index, style.index + 1)); |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'annotation.dart'; |
18 | +import 'data_types.dart'; | ||
19 | +import 'document.dart'; | ||
20 | +import 'names.dart'; | ||
21 | +import 'object.dart'; | ||
22 | +import 'outline.dart'; | ||
23 | +import 'page_list.dart'; | ||
18 | 24 | ||
19 | /// Pdf Catalog object | 25 | /// Pdf Catalog object |
20 | class PdfCatalog extends PdfObject { | 26 | class PdfCatalog extends PdfObject { |
@@ -41,9 +47,17 @@ class PdfCatalog extends PdfObject { | @@ -41,9 +47,17 @@ class PdfCatalog extends PdfObject { | ||
41 | /// The initial page mode | 47 | /// The initial page mode |
42 | final PdfNames names; | 48 | final PdfNames names; |
43 | 49 | ||
50 | + /// These map the page modes just defined to the pagemodes setting of Pdf. | ||
51 | + static const List<String> _PdfPageModes = <String>[ | ||
52 | + '/UseNone', | ||
53 | + '/UseOutlines', | ||
54 | + '/UseThumbs', | ||
55 | + '/FullScreen' | ||
56 | + ]; | ||
57 | + | ||
44 | @override | 58 | @override |
45 | - void _prepare() { | ||
46 | - super._prepare(); | 59 | + void prepare() { |
60 | + super.prepare(); | ||
47 | 61 | ||
48 | /// the PDF specification version, overrides the header version starting from 1.4 | 62 | /// the PDF specification version, overrides the header version starting from 1.4 |
49 | params['/Version'] = PdfName('/${pdfDocument.version}'); | 63 | params['/Version'] = PdfName('/${pdfDocument.version}'); |
@@ -59,7 +73,7 @@ class PdfCatalog extends PdfObject { | @@ -59,7 +73,7 @@ class PdfCatalog extends PdfObject { | ||
59 | params['/Names'] = names.ref(); | 73 | params['/Names'] = names.ref(); |
60 | 74 | ||
61 | // the /PageMode setting | 75 | // the /PageMode setting |
62 | - params['/PageMode'] = PdfName(PdfDocument._PdfPageModes[pageMode.index]); | 76 | + params['/PageMode'] = PdfName(_PdfPageModes[pageMode.index]); |
63 | 77 | ||
64 | if (pdfDocument.sign != null) { | 78 | if (pdfDocument.sign != null) { |
65 | params['/Perms'] = PdfDict(<String, PdfDataType>{ | 79 | params['/Perms'] = PdfDict(<String, PdfDataType>{ |
@@ -14,9 +14,7 @@ | @@ -14,9 +14,7 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -// ignore_for_file: public_member_api_docs | ||
18 | - | ||
19 | -part of pdf; | 17 | +import 'color.dart'; |
20 | 18 | ||
21 | /// Material design colors | 19 | /// Material design colors |
22 | class PdfColors { | 20 | class PdfColors { |
@@ -14,9 +14,15 @@ | @@ -14,9 +14,15 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -// ignore_for_file: avoid_unused_constructor_parameters | 17 | +import 'dart:convert'; |
18 | +import 'dart:typed_data'; | ||
18 | 19 | ||
19 | -part of pdf; | 20 | +import 'package:meta/meta.dart'; |
21 | +import 'package:utf/utf.dart'; | ||
22 | + | ||
23 | +import 'color.dart'; | ||
24 | +import 'object.dart'; | ||
25 | +import 'stream.dart'; | ||
20 | 26 | ||
21 | abstract class PdfDataType { | 27 | abstract class PdfDataType { |
22 | const PdfDataType(); | 28 | const PdfDataType(); |
@@ -97,7 +103,7 @@ class PdfString extends PdfDataType { | @@ -97,7 +103,7 @@ class PdfString extends PdfDataType { | ||
97 | return PdfString(_string(value), PdfStringFormat.litteral); | 103 | return PdfString(_string(value), PdfStringFormat.litteral); |
98 | } | 104 | } |
99 | 105 | ||
100 | - factory PdfString.fromStream(PdfObject object, PdfStream value, | 106 | + factory PdfString.fromStream(PdfStream value, |
101 | [PdfStringFormat format = PdfStringFormat.litteral]) { | 107 | [PdfStringFormat format = PdfStringFormat.litteral]) { |
102 | return PdfString(value.output(), format); | 108 | return PdfString(value.output(), format); |
103 | } | 109 | } |
@@ -14,7 +14,27 @@ | @@ -14,7 +14,27 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:math' as math; |
18 | +import 'dart:typed_data'; | ||
19 | + | ||
20 | +import 'package:crypto/crypto.dart'; | ||
21 | + | ||
22 | +import '../io/interface.dart' | ||
23 | + if (dart.library.io) '../io/vm.dart' | ||
24 | + if (dart.library.js) '../io/js.dart'; | ||
25 | +import 'catalog.dart'; | ||
26 | +import 'encryption.dart'; | ||
27 | +import 'font.dart'; | ||
28 | +import 'graphic_state.dart'; | ||
29 | +import 'info.dart'; | ||
30 | +import 'names.dart'; | ||
31 | +import 'object.dart'; | ||
32 | +import 'outline.dart'; | ||
33 | +import 'output.dart'; | ||
34 | +import 'page.dart'; | ||
35 | +import 'page_list.dart'; | ||
36 | +import 'signature.dart'; | ||
37 | +import 'stream.dart'; | ||
18 | 38 | ||
19 | /// Display hint for the PDF viewer | 39 | /// Display hint for the PDF viewer |
20 | enum PdfPageMode { | 40 | enum PdfPageMode { |
@@ -102,14 +122,6 @@ class PdfDocument { | @@ -102,14 +122,6 @@ class PdfDocument { | ||
102 | /// The PDF specification version | 122 | /// The PDF specification version |
103 | final String version = '1.7'; | 123 | final String version = '1.7'; |
104 | 124 | ||
105 | - /// These map the page modes just defined to the pagemodes setting of Pdf. | ||
106 | - static const List<String> _PdfPageModes = <String>[ | ||
107 | - '/UseNone', | ||
108 | - '/UseOutlines', | ||
109 | - '/UseThumbs', | ||
110 | - '/FullScreen' | ||
111 | - ]; | ||
112 | - | ||
113 | /// This holds the current fonts | 125 | /// This holds the current fonts |
114 | final Set<PdfFont> fonts = <PdfFont>{}; | 126 | final Set<PdfFont> fonts = <PdfFont>{}; |
115 | 127 | ||
@@ -129,7 +141,7 @@ class PdfDocument { | @@ -129,7 +141,7 @@ class PdfDocument { | ||
129 | } | 141 | } |
130 | 142 | ||
131 | /// Creates a new serial number | 143 | /// Creates a new serial number |
132 | - int _genSerial() => _objser++; | 144 | + int genSerial() => _objser++; |
133 | 145 | ||
134 | /// This returns a specific page. It's used mainly when using a | 146 | /// This returns a specific page. It's used mainly when using a |
135 | /// Serialized template file. | 147 | /// Serialized template file. |
@@ -14,7 +14,10 @@ | @@ -14,7 +14,10 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:typed_data'; |
18 | + | ||
19 | +import 'document.dart'; | ||
20 | +import 'object.dart'; | ||
18 | 21 | ||
19 | /// Encryption object | 22 | /// Encryption object |
20 | abstract class PdfEncryption extends PdfObject { | 23 | abstract class PdfEncryption extends PdfObject { |
@@ -14,7 +14,10 @@ | @@ -14,7 +14,10 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:convert'; |
18 | +import 'dart:typed_data'; | ||
19 | + | ||
20 | +import 'image.dart'; | ||
18 | 21 | ||
19 | /// Jpeg metadata extraction | 22 | /// Jpeg metadata extraction |
20 | class PdfJpegInfo { | 23 | class PdfJpegInfo { |
@@ -14,13 +14,25 @@ | @@ -14,13 +14,25 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:convert'; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | + | ||
21 | +import 'data_types.dart'; | ||
22 | +import 'document.dart'; | ||
23 | +import 'font_metrics.dart'; | ||
24 | +import 'object.dart'; | ||
25 | +import 'point.dart'; | ||
26 | +import 'rect.dart'; | ||
27 | +import 'stream.dart'; | ||
28 | +import 'type1_font.dart'; | ||
29 | +import 'type1_fonts.dart'; | ||
18 | 30 | ||
19 | /// Pdf font object | 31 | /// Pdf font object |
20 | abstract class PdfFont extends PdfObject { | 32 | abstract class PdfFont extends PdfObject { |
21 | /// Constructs a [PdfFont]. This will attempt to map the font from a known | 33 | /// Constructs a [PdfFont]. This will attempt to map the font from a known |
22 | /// font name to that in Pdf, defaulting to Helvetica if not possible. | 34 | /// font name to that in Pdf, defaulting to Helvetica if not possible. |
23 | - PdfFont._create(PdfDocument pdfDocument, {@required this.subtype}) | 35 | + PdfFont.create(PdfDocument pdfDocument, {@required this.subtype}) |
24 | : assert(subtype != null), | 36 | : assert(subtype != null), |
25 | super(pdfDocument, '/Font') { | 37 | super(pdfDocument, '/Font') { |
26 | pdfDocument.fonts.add(this); | 38 | pdfDocument.fonts.add(this); |
@@ -28,87 +40,87 @@ abstract class PdfFont extends PdfObject { | @@ -28,87 +40,87 @@ abstract class PdfFont extends PdfObject { | ||
28 | 40 | ||
29 | /// Monospaced slab serif typeface. | 41 | /// Monospaced slab serif typeface. |
30 | factory PdfFont.courier(PdfDocument pdfDocument) { | 42 | factory PdfFont.courier(PdfDocument pdfDocument) { |
31 | - return PdfType1Font._create( | 43 | + return PdfType1Font.create( |
32 | pdfDocument, 'Courier', 0.910, -0.220, const <double>[]); | 44 | pdfDocument, 'Courier', 0.910, -0.220, const <double>[]); |
33 | } | 45 | } |
34 | 46 | ||
35 | /// Bold monospaced slab serif typeface. | 47 | /// Bold monospaced slab serif typeface. |
36 | factory PdfFont.courierBold(PdfDocument pdfDocument) { | 48 | factory PdfFont.courierBold(PdfDocument pdfDocument) { |
37 | - return PdfType1Font._create( | 49 | + return PdfType1Font.create( |
38 | pdfDocument, 'Courier-Bold', 0.910, -0.220, const <double>[]); | 50 | pdfDocument, 'Courier-Bold', 0.910, -0.220, const <double>[]); |
39 | } | 51 | } |
40 | 52 | ||
41 | /// Bold and Italic monospaced slab serif typeface. | 53 | /// Bold and Italic monospaced slab serif typeface. |
42 | factory PdfFont.courierBoldOblique(PdfDocument pdfDocument) { | 54 | factory PdfFont.courierBoldOblique(PdfDocument pdfDocument) { |
43 | - return PdfType1Font._create( | 55 | + return PdfType1Font.create( |
44 | pdfDocument, 'Courier-BoldOblique', 0.910, -0.220, const <double>[]); | 56 | pdfDocument, 'Courier-BoldOblique', 0.910, -0.220, const <double>[]); |
45 | } | 57 | } |
46 | 58 | ||
47 | /// Italic monospaced slab serif typeface. | 59 | /// Italic monospaced slab serif typeface. |
48 | factory PdfFont.courierOblique(PdfDocument pdfDocument) { | 60 | factory PdfFont.courierOblique(PdfDocument pdfDocument) { |
49 | - return PdfType1Font._create( | 61 | + return PdfType1Font.create( |
50 | pdfDocument, 'Courier-Oblique', 0.910, -0.220, const <double>[]); | 62 | pdfDocument, 'Courier-Oblique', 0.910, -0.220, const <double>[]); |
51 | } | 63 | } |
52 | 64 | ||
53 | /// Neo-grotesque design sans-serif typeface | 65 | /// Neo-grotesque design sans-serif typeface |
54 | factory PdfFont.helvetica(PdfDocument pdfDocument) { | 66 | factory PdfFont.helvetica(PdfDocument pdfDocument) { |
55 | - return PdfType1Font._create( | ||
56 | - pdfDocument, 'Helvetica', 0.931, -0.225, _helveticaWidths); | 67 | + return PdfType1Font.create( |
68 | + pdfDocument, 'Helvetica', 0.931, -0.225, helveticaWidths); | ||
57 | } | 69 | } |
58 | 70 | ||
59 | /// Bold Neo-grotesque design sans-serif typeface | 71 | /// Bold Neo-grotesque design sans-serif typeface |
60 | factory PdfFont.helveticaBold(PdfDocument pdfDocument) { | 72 | factory PdfFont.helveticaBold(PdfDocument pdfDocument) { |
61 | - return PdfType1Font._create( | ||
62 | - pdfDocument, 'Helvetica-Bold', 0.962, -0.228, _helveticaBoldWidths); | 73 | + return PdfType1Font.create( |
74 | + pdfDocument, 'Helvetica-Bold', 0.962, -0.228, helveticaBoldWidths); | ||
63 | } | 75 | } |
64 | 76 | ||
65 | /// Bold and Italic Neo-grotesque design sans-serif typeface | 77 | /// Bold and Italic Neo-grotesque design sans-serif typeface |
66 | factory PdfFont.helveticaBoldOblique(PdfDocument pdfDocument) { | 78 | factory PdfFont.helveticaBoldOblique(PdfDocument pdfDocument) { |
67 | - return PdfType1Font._create(pdfDocument, 'Helvetica-BoldOblique', 0.962, | ||
68 | - -0.228, _helveticaBoldObliqueWidths); | 79 | + return PdfType1Font.create(pdfDocument, 'Helvetica-BoldOblique', 0.962, |
80 | + -0.228, helveticaBoldObliqueWidths); | ||
69 | } | 81 | } |
70 | 82 | ||
71 | /// Italic Neo-grotesque design sans-serif typeface | 83 | /// Italic Neo-grotesque design sans-serif typeface |
72 | factory PdfFont.helveticaOblique(PdfDocument pdfDocument) { | 84 | factory PdfFont.helveticaOblique(PdfDocument pdfDocument) { |
73 | - return PdfType1Font._create(pdfDocument, 'Helvetica-Oblique', 0.931, -0.225, | ||
74 | - _helveticaObliqueWidths); | 85 | + return PdfType1Font.create(pdfDocument, 'Helvetica-Oblique', 0.931, -0.225, |
86 | + helveticaObliqueWidths); | ||
75 | } | 87 | } |
76 | 88 | ||
77 | /// Serif typeface commissioned by the British newspaper The Times | 89 | /// Serif typeface commissioned by the British newspaper The Times |
78 | factory PdfFont.times(PdfDocument pdfDocument) { | 90 | factory PdfFont.times(PdfDocument pdfDocument) { |
79 | - return PdfType1Font._create( | ||
80 | - pdfDocument, 'Times-Roman', 0.898, -0.218, _timesWidths); | 91 | + return PdfType1Font.create( |
92 | + pdfDocument, 'Times-Roman', 0.898, -0.218, timesWidths); | ||
81 | } | 93 | } |
82 | 94 | ||
83 | /// Bold serif typeface commissioned by the British newspaper The Times | 95 | /// Bold serif typeface commissioned by the British newspaper The Times |
84 | factory PdfFont.timesBold(PdfDocument pdfDocument) { | 96 | factory PdfFont.timesBold(PdfDocument pdfDocument) { |
85 | - return PdfType1Font._create( | ||
86 | - pdfDocument, 'Times-Bold', 0.935, -0.218, _timesBoldWidths); | 97 | + return PdfType1Font.create( |
98 | + pdfDocument, 'Times-Bold', 0.935, -0.218, timesBoldWidths); | ||
87 | } | 99 | } |
88 | 100 | ||
89 | /// Bold and Italic serif typeface commissioned by the British newspaper The Times | 101 | /// Bold and Italic serif typeface commissioned by the British newspaper The Times |
90 | factory PdfFont.timesBoldItalic(PdfDocument pdfDocument) { | 102 | factory PdfFont.timesBoldItalic(PdfDocument pdfDocument) { |
91 | - return PdfType1Font._create( | ||
92 | - pdfDocument, 'Times-BoldItalic', 0.921, -0.218, _timesBoldItalicWidths); | 103 | + return PdfType1Font.create( |
104 | + pdfDocument, 'Times-BoldItalic', 0.921, -0.218, timesBoldItalicWidths); | ||
93 | } | 105 | } |
94 | 106 | ||
95 | /// Italic serif typeface commissioned by the British newspaper The Times | 107 | /// Italic serif typeface commissioned by the British newspaper The Times |
96 | factory PdfFont.timesItalic(PdfDocument pdfDocument) { | 108 | factory PdfFont.timesItalic(PdfDocument pdfDocument) { |
97 | - return PdfType1Font._create( | ||
98 | - pdfDocument, 'Times-Italic', 0.883, -0.217, _timesItalicWidths); | 109 | + return PdfType1Font.create( |
110 | + pdfDocument, 'Times-Italic', 0.883, -0.217, timesItalicWidths); | ||
99 | } | 111 | } |
100 | 112 | ||
101 | /// Complete unaccented serif Greek alphabet (upper and lower case) and a | 113 | /// Complete unaccented serif Greek alphabet (upper and lower case) and a |
102 | /// selection of commonly used mathematical symbols. | 114 | /// selection of commonly used mathematical symbols. |
103 | factory PdfFont.symbol(PdfDocument pdfDocument) { | 115 | factory PdfFont.symbol(PdfDocument pdfDocument) { |
104 | - return PdfType1Font._create( | ||
105 | - pdfDocument, 'Symbol', 1.010, -0.293, _symbolWidths); | 116 | + return PdfType1Font.create( |
117 | + pdfDocument, 'Symbol', 1.010, -0.293, symbolWidths); | ||
106 | } | 118 | } |
107 | 119 | ||
108 | /// Hermann Zapf ornament glyphs or spacers, often employed to create box frames | 120 | /// Hermann Zapf ornament glyphs or spacers, often employed to create box frames |
109 | factory PdfFont.zapfDingbats(PdfDocument pdfDocument) { | 121 | factory PdfFont.zapfDingbats(PdfDocument pdfDocument) { |
110 | - return PdfType1Font._create( | ||
111 | - pdfDocument, 'ZapfDingbats', 0.820, -0.143, _zapfDingbatsWidths); | 122 | + return PdfType1Font.create( |
123 | + pdfDocument, 'ZapfDingbats', 0.820, -0.143, zapfDingbatsWidths); | ||
112 | } | 124 | } |
113 | 125 | ||
114 | static const String _cannotDecodeMessage = | 126 | static const String _cannotDecodeMessage = |
@@ -142,8 +154,8 @@ See https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management | @@ -142,8 +154,8 @@ See https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management | ||
142 | int get unitsPerEm; | 154 | int get unitsPerEm; |
143 | 155 | ||
144 | @override | 156 | @override |
145 | - void _prepare() { | ||
146 | - super._prepare(); | 157 | + void prepare() { |
158 | + super.prepare(); | ||
147 | 159 | ||
148 | params['/Subtype'] = PdfName(subtype); | 160 | params['/Subtype'] = PdfName(subtype); |
149 | params['/Name'] = PdfName(name); | 161 | params['/Name'] = PdfName(name); |
@@ -14,7 +14,10 @@ | @@ -14,7 +14,10 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'data_types.dart'; |
18 | +import 'object.dart'; | ||
19 | +import 'object_stream.dart'; | ||
20 | +import 'ttffont.dart'; | ||
18 | 21 | ||
19 | /// Font descriptor object | 22 | /// Font descriptor object |
20 | class PdfFontDescriptor extends PdfObject { | 23 | class PdfFontDescriptor extends PdfObject { |
@@ -33,8 +36,8 @@ class PdfFontDescriptor extends PdfObject { | @@ -33,8 +36,8 @@ class PdfFontDescriptor extends PdfObject { | ||
33 | final PdfTtfFont ttfFont; | 36 | final PdfTtfFont ttfFont; |
34 | 37 | ||
35 | @override | 38 | @override |
36 | - void _prepare() { | ||
37 | - super._prepare(); | 39 | + void prepare() { |
40 | + super.prepare(); | ||
38 | 41 | ||
39 | params['/FontName'] = PdfName('/' + ttfFont.fontName); | 42 | params['/FontName'] = PdfName('/' + ttfFont.fontName); |
40 | params['/FontFile2'] = file.ref(); | 43 | params['/FontFile2'] = file.ref(); |
@@ -14,7 +14,11 @@ | @@ -14,7 +14,11 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | + | ||
21 | +import 'rect.dart'; | ||
18 | 22 | ||
19 | /// Describe dimensions for glyphs in a font | 23 | /// Describe dimensions for glyphs in a font |
20 | @immutable | 24 | @immutable |
@@ -14,7 +14,12 @@ | @@ -14,7 +14,12 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'package:vector_math/vector_math_64.dart'; |
18 | + | ||
19 | +import 'data_types.dart'; | ||
20 | +import 'document.dart'; | ||
21 | +import 'font.dart'; | ||
22 | +import 'xobject.dart'; | ||
18 | 23 | ||
19 | /// Form XObject | 24 | /// Form XObject |
20 | class PdfFormXObject extends PdfXObject { | 25 | class PdfFormXObject extends PdfXObject { |
@@ -38,8 +43,8 @@ class PdfFormXObject extends PdfXObject { | @@ -38,8 +43,8 @@ class PdfFormXObject extends PdfXObject { | ||
38 | } | 43 | } |
39 | 44 | ||
40 | @override | 45 | @override |
41 | - void _prepare() { | ||
42 | - super._prepare(); | 46 | + void prepare() { |
47 | + super.prepare(); | ||
43 | 48 | ||
44 | // This holds any resources for this FormXObject | 49 | // This holds any resources for this FormXObject |
45 | final resources = PdfDict(); | 50 | final resources = PdfDict(); |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'package:meta/meta.dart'; |
18 | + | ||
19 | +import 'color.dart'; | ||
20 | +import 'data_types.dart'; | ||
21 | +import 'document.dart'; | ||
22 | +import 'object.dart'; | ||
23 | +import 'object_stream.dart'; | ||
18 | 24 | ||
19 | abstract class PdfBaseFunction extends PdfObject { | 25 | abstract class PdfBaseFunction extends PdfObject { |
20 | PdfBaseFunction(PdfDocument pdfDocument) : super(pdfDocument); | 26 | PdfBaseFunction(PdfDocument pdfDocument) : super(pdfDocument); |
@@ -29,7 +35,7 @@ class PdfFunction extends PdfObjectStream implements PdfBaseFunction { | @@ -29,7 +35,7 @@ class PdfFunction extends PdfObjectStream implements PdfBaseFunction { | ||
29 | final List<PdfColor> colors; | 35 | final List<PdfColor> colors; |
30 | 36 | ||
31 | @override | 37 | @override |
32 | - void _prepare() { | 38 | + void prepare() { |
33 | for (final color in colors) { | 39 | for (final color in colors) { |
34 | buf.putBytes(<int>[ | 40 | buf.putBytes(<int>[ |
35 | (color.red * 255.0).round() & 0xff, | 41 | (color.red * 255.0).round() & 0xff, |
@@ -38,7 +44,7 @@ class PdfFunction extends PdfObjectStream implements PdfBaseFunction { | @@ -38,7 +44,7 @@ class PdfFunction extends PdfObjectStream implements PdfBaseFunction { | ||
38 | ]); | 44 | ]); |
39 | } | 45 | } |
40 | 46 | ||
41 | - super._prepare(); | 47 | + super.prepare(); |
42 | 48 | ||
43 | params['/FunctionType'] = const PdfNum(0); | 49 | params['/FunctionType'] = const PdfNum(0); |
44 | params['/BitsPerSample'] = const PdfNum(8); | 50 | params['/BitsPerSample'] = const PdfNum(8); |
@@ -69,8 +75,8 @@ class PdfStitchingFunction extends PdfBaseFunction { | @@ -69,8 +75,8 @@ class PdfStitchingFunction extends PdfBaseFunction { | ||
69 | final double domainEnd; | 75 | final double domainEnd; |
70 | 76 | ||
71 | @override | 77 | @override |
72 | - void _prepare() { | ||
73 | - super._prepare(); | 78 | + void prepare() { |
79 | + super.prepare(); | ||
74 | 80 | ||
75 | params['/FunctionType'] = const PdfNum(3); | 81 | params['/FunctionType'] = const PdfNum(3); |
76 | params['/Functions'] = PdfArray.fromObjects(functions); | 82 | params['/Functions'] = PdfArray.fromObjects(functions); |
@@ -16,7 +16,11 @@ | @@ -16,7 +16,11 @@ | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 | */ | 17 | */ |
18 | 18 | ||
19 | -part of pdf; | 19 | +import 'package:meta/meta.dart'; |
20 | + | ||
21 | +import 'data_types.dart'; | ||
22 | +import 'document.dart'; | ||
23 | +import 'object.dart'; | ||
20 | 24 | ||
21 | /// Graphic state | 25 | /// Graphic state |
22 | @immutable | 26 | @immutable |
@@ -71,8 +75,8 @@ class PdfGraphicStates extends PdfObject { | @@ -71,8 +75,8 @@ class PdfGraphicStates extends PdfObject { | ||
71 | } | 75 | } |
72 | 76 | ||
73 | @override | 77 | @override |
74 | - void _prepare() { | ||
75 | - super._prepare(); | 78 | + void prepare() { |
79 | + super.prepare(); | ||
76 | 80 | ||
77 | for (var index = 0; index < _states.length; index++) { | 81 | for (var index = 0; index < _states.length; index++) { |
78 | params['$_prefix$index'] = _states[index]._output(); | 82 | params['$_prefix$index'] = _states[index]._output(); |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'data_types.dart'; |
18 | +import 'document.dart'; | ||
19 | +import 'font.dart'; | ||
20 | +import 'graphic_state.dart'; | ||
21 | +import 'object.dart'; | ||
22 | +import 'shading.dart'; | ||
23 | +import 'xobject.dart'; | ||
18 | 24 | ||
19 | /// Helper functions for graphic objects | 25 | /// Helper functions for graphic objects |
20 | mixin PdfGraphicStream on PdfObject { | 26 | mixin PdfGraphicStream on PdfObject { |
@@ -75,8 +81,8 @@ mixin PdfGraphicStream on PdfObject { | @@ -75,8 +81,8 @@ mixin PdfGraphicStream on PdfObject { | ||
75 | } | 81 | } |
76 | 82 | ||
77 | @override | 83 | @override |
78 | - void _prepare() { | ||
79 | - super._prepare(); | 84 | + void prepare() { |
85 | + super.prepare(); | ||
80 | 86 | ||
81 | // This holds any resources for this page | 87 | // This holds any resources for this page |
82 | final resources = PdfDict(); | 88 | final resources = PdfDict(); |
@@ -14,7 +14,22 @@ | @@ -14,7 +14,22 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:collection'; |
18 | +import 'dart:math' as math; | ||
19 | + | ||
20 | +import 'package:meta/meta.dart'; | ||
21 | +import 'package:path_parsing/path_parsing.dart'; | ||
22 | +import 'package:vector_math/vector_math_64.dart'; | ||
23 | + | ||
24 | +import 'color.dart'; | ||
25 | +import 'data_types.dart'; | ||
26 | +import 'font.dart'; | ||
27 | +import 'graphic_state.dart'; | ||
28 | +import 'graphic_stream.dart'; | ||
29 | +import 'image.dart'; | ||
30 | +import 'page.dart'; | ||
31 | +import 'shading.dart'; | ||
32 | +import 'stream.dart'; | ||
18 | 33 | ||
19 | /// Shape to be used at the corners of paths that are stroked | 34 | /// Shape to be used at the corners of paths that are stroked |
20 | enum PdfLineJoin { | 35 | enum PdfLineJoin { |
@@ -14,7 +14,15 @@ | @@ -14,7 +14,15 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:typed_data'; |
18 | + | ||
19 | +import 'package:image/image.dart' as im; | ||
20 | +import 'package:meta/meta.dart'; | ||
21 | + | ||
22 | +import 'data_types.dart'; | ||
23 | +import 'document.dart'; | ||
24 | +import 'exif.dart'; | ||
25 | +import 'xobject.dart'; | ||
18 | 26 | ||
19 | /// Represents the position of the first pixel in the data stream | 27 | /// Represents the position of the first pixel in the data stream |
20 | /// This corresponds to the exif orientations | 28 | /// This corresponds to the exif orientations |
@@ -14,7 +14,9 @@ | @@ -14,7 +14,9 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'data_types.dart'; |
18 | +import 'document.dart'; | ||
19 | +import 'object.dart'; | ||
18 | 20 | ||
19 | /// Information object | 21 | /// Information object |
20 | class PdfInfo extends PdfObject { | 22 | class PdfInfo extends PdfObject { |
@@ -14,7 +14,10 @@ | @@ -14,7 +14,10 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'data_types.dart'; |
18 | +import 'document.dart'; | ||
19 | +import 'object.dart'; | ||
20 | +import 'page.dart'; | ||
18 | 21 | ||
19 | /// Pdf Name object | 22 | /// Pdf Name object |
20 | class PdfNames extends PdfObject { | 23 | class PdfNames extends PdfObject { |
@@ -46,8 +49,8 @@ class PdfNames extends PdfObject { | @@ -46,8 +49,8 @@ class PdfNames extends PdfObject { | ||
46 | } | 49 | } |
47 | 50 | ||
48 | @override | 51 | @override |
49 | - void _prepare() { | ||
50 | - super._prepare(); | 52 | + void prepare() { |
53 | + super.prepare(); | ||
51 | 54 | ||
52 | final dests = PdfArray(); | 55 | final dests = PdfArray(); |
53 | 56 |
@@ -14,7 +14,11 @@ | @@ -14,7 +14,11 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'package:meta/meta.dart'; |
18 | + | ||
19 | +import 'data_types.dart'; | ||
20 | +import 'document.dart'; | ||
21 | +import 'stream.dart'; | ||
18 | 22 | ||
19 | /// Base Object used in the PDF file | 23 | /// Base Object used in the PDF file |
20 | class PdfObject { | 24 | class PdfObject { |
@@ -24,7 +28,7 @@ class PdfObject { | @@ -24,7 +28,7 @@ class PdfObject { | ||
24 | this.pdfDocument, [ | 28 | this.pdfDocument, [ |
25 | String type, | 29 | String type, |
26 | ]) : assert(pdfDocument != null), | 30 | ]) : assert(pdfDocument != null), |
27 | - objser = pdfDocument._genSerial() { | 31 | + objser = pdfDocument.genSerial() { |
28 | if (type != null) { | 32 | if (type != null) { |
29 | params['/Type'] = PdfName(type); | 33 | params['/Type'] = PdfName(type); |
30 | } | 34 | } |
@@ -45,16 +49,16 @@ class PdfObject { | @@ -45,16 +49,16 @@ class PdfObject { | ||
45 | final PdfDocument pdfDocument; | 49 | final PdfDocument pdfDocument; |
46 | 50 | ||
47 | /// Writes the object to the output stream. | 51 | /// Writes the object to the output stream. |
48 | - void _write(PdfStream os) { | ||
49 | - _prepare(); | 52 | + void write(PdfStream os) { |
53 | + prepare(); | ||
50 | _writeStart(os); | 54 | _writeStart(os); |
51 | - _writeContent(os); | 55 | + writeContent(os); |
52 | _writeEnd(os); | 56 | _writeEnd(os); |
53 | } | 57 | } |
54 | 58 | ||
55 | /// Prepare the object to be written to the stream | 59 | /// Prepare the object to be written to the stream |
56 | @mustCallSuper | 60 | @mustCallSuper |
57 | - void _prepare() {} | 61 | + void prepare() {} |
58 | 62 | ||
59 | /// The write method should call this before writing anything to the | 63 | /// The write method should call this before writing anything to the |
60 | /// OutputStream. This will send the standard header for each object. | 64 | /// OutputStream. This will send the standard header for each object. |
@@ -62,7 +66,7 @@ class PdfObject { | @@ -62,7 +66,7 @@ class PdfObject { | ||
62 | os.putString('$objser $objgen obj\n'); | 66 | os.putString('$objser $objgen obj\n'); |
63 | } | 67 | } |
64 | 68 | ||
65 | - void _writeContent(PdfStream os) { | 69 | + void writeContent(PdfStream os) { |
66 | if (params.isNotEmpty) { | 70 | if (params.isNotEmpty) { |
67 | params.output(os); | 71 | params.output(os); |
68 | os.putString('\n'); | 72 | os.putString('\n'); |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:typed_data'; |
18 | + | ||
19 | +import 'ascii85.dart'; | ||
20 | +import 'data_types.dart'; | ||
21 | +import 'document.dart'; | ||
22 | +import 'object.dart'; | ||
23 | +import 'stream.dart'; | ||
18 | 24 | ||
19 | /// Stream Object | 25 | /// Stream Object |
20 | class PdfObjectStream extends PdfObject { | 26 | class PdfObjectStream extends PdfObject { |
@@ -34,8 +40,8 @@ class PdfObjectStream extends PdfObject { | @@ -34,8 +40,8 @@ class PdfObjectStream extends PdfObject { | ||
34 | Uint8List _data; | 40 | Uint8List _data; |
35 | 41 | ||
36 | @override | 42 | @override |
37 | - void _prepare() { | ||
38 | - super._prepare(); | 43 | + void prepare() { |
44 | + super.prepare(); | ||
39 | 45 | ||
40 | if (params.containsKey('/Filter') && _data == null) { | 46 | if (params.containsKey('/Filter') && _data == null) { |
41 | // The data is already in the right format | 47 | // The data is already in the right format |
@@ -67,8 +73,8 @@ class PdfObjectStream extends PdfObject { | @@ -67,8 +73,8 @@ class PdfObjectStream extends PdfObject { | ||
67 | } | 73 | } |
68 | 74 | ||
69 | @override | 75 | @override |
70 | - void _writeContent(PdfStream os) { | ||
71 | - super._writeContent(os); | 76 | + void writeContent(PdfStream os) { |
77 | + super.writeContent(os); | ||
72 | 78 | ||
73 | os.putString('stream\n'); | 79 | os.putString('stream\n'); |
74 | os.putBytes(_data); | 80 | os.putBytes(_data); |
@@ -14,7 +14,12 @@ | @@ -14,7 +14,12 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'color.dart'; |
18 | +import 'data_types.dart'; | ||
19 | +import 'document.dart'; | ||
20 | +import 'object.dart'; | ||
21 | +import 'page.dart'; | ||
22 | +import 'rect.dart'; | ||
18 | 23 | ||
19 | /// Outline mode | 24 | /// Outline mode |
20 | enum PdfOutlineMode { | 25 | enum PdfOutlineMode { |
@@ -96,8 +101,8 @@ class PdfOutline extends PdfObject { | @@ -96,8 +101,8 @@ class PdfOutline extends PdfObject { | ||
96 | } | 101 | } |
97 | 102 | ||
98 | @override | 103 | @override |
99 | - void _prepare() { | ||
100 | - super._prepare(); | 104 | + void prepare() { |
105 | + super.prepare(); | ||
101 | 106 | ||
102 | // These are for kids only | 107 | // These are for kids only |
103 | if (parent != null) { | 108 | if (parent != null) { |
@@ -14,7 +14,14 @@ | @@ -14,7 +14,14 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'catalog.dart'; |
18 | +import 'data_types.dart'; | ||
19 | +import 'encryption.dart'; | ||
20 | +import 'info.dart'; | ||
21 | +import 'object.dart'; | ||
22 | +import 'signature.dart'; | ||
23 | +import 'stream.dart'; | ||
24 | +import 'xref.dart'; | ||
18 | 25 | ||
19 | /// PDF document writer | 26 | /// PDF document writer |
20 | class PdfOutput { | 27 | class PdfOutput { |
@@ -61,7 +68,7 @@ class PdfOutput { | @@ -61,7 +68,7 @@ class PdfOutput { | ||
61 | } | 68 | } |
62 | 69 | ||
63 | offsets.add(PdfXref(ob.objser, os.offset)); | 70 | offsets.add(PdfXref(ob.objser, os.offset)); |
64 | - ob._write(os); | 71 | + ob.write(os); |
65 | } | 72 | } |
66 | 73 | ||
67 | /// This closes the Stream, writing the xref table | 74 | /// This closes the Stream, writing the xref table |
@@ -138,7 +145,7 @@ class PdfOutput { | @@ -138,7 +145,7 @@ class PdfOutput { | ||
138 | os.putString('\nstartxref\n$xref\n%%EOF\n'); | 145 | os.putString('\nstartxref\n$xref\n%%EOF\n'); |
139 | 146 | ||
140 | if (signatureID != null) { | 147 | if (signatureID != null) { |
141 | - signatureID._writeSignature(os); | 148 | + signatureID.writeSignature(os); |
142 | } | 149 | } |
143 | } | 150 | } |
144 | 151 |
@@ -14,7 +14,14 @@ | @@ -14,7 +14,14 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'annotation.dart'; |
18 | +import 'data_types.dart'; | ||
19 | +import 'document.dart'; | ||
20 | +import 'graphic_stream.dart'; | ||
21 | +import 'graphics.dart'; | ||
22 | +import 'object.dart'; | ||
23 | +import 'object_stream.dart'; | ||
24 | +import 'page_format.dart'; | ||
18 | 25 | ||
19 | /// Page object, which will hold any contents for this page. | 26 | /// Page object, which will hold any contents for this page. |
20 | class PdfPage extends PdfObject with PdfGraphicStream { | 27 | class PdfPage extends PdfObject with PdfGraphicStream { |
@@ -55,8 +62,8 @@ class PdfPage extends PdfObject with PdfGraphicStream { | @@ -55,8 +62,8 @@ class PdfPage extends PdfObject with PdfGraphicStream { | ||
55 | } | 62 | } |
56 | 63 | ||
57 | @override | 64 | @override |
58 | - void _prepare() { | ||
59 | - super._prepare(); | 65 | + void prepare() { |
66 | + super.prepare(); | ||
60 | 67 | ||
61 | // the /Parent pages object | 68 | // the /Parent pages object |
62 | params['/Parent'] = pdfDocument.pdfPageList.ref(); | 69 | params['/Parent'] = pdfDocument.pdfPageList.ref(); |
@@ -14,7 +14,9 @@ | @@ -14,7 +14,9 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'point.dart'; | ||
18 | 20 | ||
19 | class PdfPageFormat { | 21 | class PdfPageFormat { |
20 | const PdfPageFormat(this.width, this.height, | 22 | const PdfPageFormat(this.width, this.height, |
@@ -14,7 +14,10 @@ | @@ -14,7 +14,10 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'data_types.dart'; |
18 | +import 'document.dart'; | ||
19 | +import 'object.dart'; | ||
20 | +import 'page.dart'; | ||
18 | 21 | ||
19 | /// PdfPageList object | 22 | /// PdfPageList object |
20 | class PdfPageList extends PdfObject { | 23 | class PdfPageList extends PdfObject { |
@@ -28,8 +31,8 @@ class PdfPageList extends PdfObject { | @@ -28,8 +31,8 @@ class PdfPageList extends PdfObject { | ||
28 | PdfPage getPage(int page) => pages[page]; | 31 | PdfPage getPage(int page) => pages[page]; |
29 | 32 | ||
30 | @override | 33 | @override |
31 | - void _prepare() { | ||
32 | - super._prepare(); | 34 | + void prepare() { |
35 | + super.prepare(); | ||
33 | 36 | ||
34 | params['/Kids'] = PdfArray.fromObjects(pages); | 37 | params['/Kids'] = PdfArray.fromObjects(pages); |
35 | params['/Count'] = PdfNum(pages.length); | 38 | params['/Count'] = PdfNum(pages.length); |
@@ -14,7 +14,14 @@ | @@ -14,7 +14,14 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'package:meta/meta.dart'; |
18 | + | ||
19 | +import 'data_types.dart'; | ||
20 | +import 'document.dart'; | ||
21 | +import 'function.dart'; | ||
22 | +import 'object.dart'; | ||
23 | +import 'point.dart'; | ||
24 | +import 'rect.dart'; | ||
18 | 25 | ||
19 | enum PdfShadingType { axial, radial } | 26 | enum PdfShadingType { axial, radial } |
20 | 27 | ||
@@ -60,8 +67,8 @@ class PdfShading extends PdfObject { | @@ -60,8 +67,8 @@ class PdfShading extends PdfObject { | ||
60 | final double radius1; | 67 | final double radius1; |
61 | 68 | ||
62 | @override | 69 | @override |
63 | - void _prepare() { | ||
64 | - super._prepare(); | 70 | + void prepare() { |
71 | + super.prepare(); | ||
65 | 72 | ||
66 | params['/ShadingType'] = PdfNum(shadingType.index + 2); | 73 | params['/ShadingType'] = PdfNum(shadingType.index + 2); |
67 | if (boundingBox != null) { | 74 | if (boundingBox != null) { |
@@ -14,7 +14,12 @@ | @@ -14,7 +14,12 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'package:meta/meta.dart'; |
18 | + | ||
19 | +import 'data_types.dart'; | ||
20 | +import 'document.dart'; | ||
21 | +import 'object.dart'; | ||
22 | +import 'stream.dart'; | ||
18 | 23 | ||
19 | enum PdfSigFlags { signaturesExist, appendOnly } | 24 | enum PdfSigFlags { signaturesExist, appendOnly } |
20 | 25 | ||
@@ -39,15 +44,15 @@ class PdfSignature extends PdfObject { | @@ -39,15 +44,15 @@ class PdfSignature extends PdfObject { | ||
39 | int _offsetEnd; | 44 | int _offsetEnd; |
40 | 45 | ||
41 | @override | 46 | @override |
42 | - void _write(PdfStream os) { | 47 | + void write(PdfStream os) { |
43 | crypto.preSign(this, params); | 48 | crypto.preSign(this, params); |
44 | 49 | ||
45 | _offsetStart = os.offset + '$objser $objgen obj\n'.length; | 50 | _offsetStart = os.offset + '$objser $objgen obj\n'.length; |
46 | - super._write(os); | 51 | + super.write(os); |
47 | _offsetEnd = os.offset; | 52 | _offsetEnd = os.offset; |
48 | } | 53 | } |
49 | 54 | ||
50 | - void _writeSignature(PdfStream os) { | 55 | + void writeSignature(PdfStream os) { |
51 | assert(_offsetStart != null && _offsetEnd != null, | 56 | assert(_offsetStart != null && _offsetEnd != null, |
52 | 'Must reserve the object space before signing the document'); | 57 | 'Must reserve the object space before signing the document'); |
53 | 58 |
@@ -14,7 +14,14 @@ | @@ -14,7 +14,14 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:convert'; |
18 | +import 'dart:math' as math; | ||
19 | +import 'dart:typed_data'; | ||
20 | + | ||
21 | +import 'package:meta/meta.dart'; | ||
22 | +import 'package:utf/utf.dart'; | ||
23 | + | ||
24 | +import 'font_metrics.dart'; | ||
18 | 25 | ||
19 | @immutable | 26 | @immutable |
20 | class TtfGlyphInfo { | 27 | class TtfGlyphInfo { |
@@ -14,7 +14,10 @@ | @@ -14,7 +14,10 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:math' as math; |
18 | +import 'dart:typed_data'; | ||
19 | + | ||
20 | +import 'ttf_parser.dart'; | ||
18 | 21 | ||
19 | /// Generate a TTF font copy with the minimal number of glyph to embedd | 22 | /// Generate a TTF font copy with the minimal number of glyph to embedd |
20 | /// into the PDF document | 23 | /// into the PDF document |
@@ -14,13 +14,27 @@ | @@ -14,13 +14,27 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'dart:convert'; |
18 | +import 'dart:typed_data'; | ||
19 | + | ||
20 | +import 'arabic.dart'; | ||
21 | +import 'array.dart'; | ||
22 | +import 'data_types.dart'; | ||
23 | +import 'document.dart'; | ||
24 | +import 'font.dart'; | ||
25 | +import 'font_descriptor.dart'; | ||
26 | +import 'font_metrics.dart'; | ||
27 | +import 'object_stream.dart'; | ||
28 | +import 'stream.dart'; | ||
29 | +import 'ttf_parser.dart'; | ||
30 | +import 'ttf_writer.dart'; | ||
31 | +import 'unicode_cmap.dart'; | ||
18 | 32 | ||
19 | class PdfTtfFont extends PdfFont { | 33 | class PdfTtfFont extends PdfFont { |
20 | /// Constructs a [PdfTtfFont] | 34 | /// Constructs a [PdfTtfFont] |
21 | PdfTtfFont(PdfDocument pdfDocument, ByteData bytes, {bool protect = false}) | 35 | PdfTtfFont(PdfDocument pdfDocument, ByteData bytes, {bool protect = false}) |
22 | : font = TtfParser(bytes), | 36 | : font = TtfParser(bytes), |
23 | - super._create(pdfDocument, subtype: '/TrueType') { | 37 | + super.create(pdfDocument, subtype: '/TrueType') { |
24 | file = PdfObjectStream(pdfDocument, isBinary: true); | 38 | file = PdfObjectStream(pdfDocument, isBinary: true); |
25 | unicodeCMap = PdfUnicodeCmap(pdfDocument, protect); | 39 | unicodeCMap = PdfUnicodeCmap(pdfDocument, protect); |
26 | descriptor = PdfFontDescriptor(this, file); | 40 | descriptor = PdfFontDescriptor(this, file); |
@@ -60,7 +74,7 @@ class PdfTtfFont extends PdfFont { | @@ -60,7 +74,7 @@ class PdfTtfFont extends PdfFont { | ||
60 | return PdfFontMetrics.zero; | 74 | return PdfFontMetrics.zero; |
61 | } | 75 | } |
62 | 76 | ||
63 | - if (PdfArabic._isArabicDiacriticValue(charCode)) { | 77 | + if (PdfArabic.isArabicDiacriticValue(charCode)) { |
64 | final metric = font.glyphInfoMap[g] ?? PdfFontMetrics.zero; | 78 | final metric = font.glyphInfoMap[g] ?? PdfFontMetrics.zero; |
65 | return metric.copyWith(advanceWidth: 0); | 79 | return metric.copyWith(advanceWidth: 0); |
66 | } | 80 | } |
@@ -130,8 +144,8 @@ class PdfTtfFont extends PdfFont { | @@ -130,8 +144,8 @@ class PdfTtfFont extends PdfFont { | ||
130 | } | 144 | } |
131 | 145 | ||
132 | @override | 146 | @override |
133 | - void _prepare() { | ||
134 | - super._prepare(); | 147 | + void prepare() { |
148 | + super.prepare(); | ||
135 | 149 | ||
136 | if (font.unicode) { | 150 | if (font.unicode) { |
137 | _buildType0(params); | 151 | _buildType0(params); |
@@ -14,7 +14,11 @@ | @@ -14,7 +14,11 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'data_types.dart'; |
18 | +import 'document.dart'; | ||
19 | +import 'font.dart'; | ||
20 | +import 'font_metrics.dart'; | ||
21 | +import 'ttffont.dart'; | ||
18 | 22 | ||
19 | /// Type 1 font object. | 23 | /// Type 1 font object. |
20 | /// this font is a default PDF font available in all PDF readers, | 24 | /// this font is a default PDF font available in all PDF readers, |
@@ -26,14 +30,14 @@ part of pdf; | @@ -26,14 +30,14 @@ part of pdf; | ||
26 | /// see https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management | 30 | /// see https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management |
27 | class PdfType1Font extends PdfFont { | 31 | class PdfType1Font extends PdfFont { |
28 | /// Constructs a [PdfTtfFont] | 32 | /// Constructs a [PdfTtfFont] |
29 | - PdfType1Font._create(PdfDocument pdfDocument, this.fontName, this.ascent, | 33 | + PdfType1Font.create(PdfDocument pdfDocument, this.fontName, this.ascent, |
30 | this.descent, this.widths) | 34 | this.descent, this.widths) |
31 | : assert(() { | 35 | : assert(() { |
32 | print( | 36 | print( |
33 | '$fontName has no Unicode support see https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management'); | 37 | '$fontName has no Unicode support see https://github.com/DavBfr/dart_pdf/wiki/Fonts-Management'); |
34 | return true; | 38 | return true; |
35 | }()), | 39 | }()), |
36 | - super._create(pdfDocument, subtype: '/Type1'); | 40 | + super.create(pdfDocument, subtype: '/Type1'); |
37 | 41 | ||
38 | @override | 42 | @override |
39 | final String fontName; | 43 | final String fontName; |
@@ -51,8 +55,8 @@ class PdfType1Font extends PdfFont { | @@ -51,8 +55,8 @@ class PdfType1Font extends PdfFont { | ||
51 | final List<double> widths; | 55 | final List<double> widths; |
52 | 56 | ||
53 | @override | 57 | @override |
54 | - void _prepare() { | ||
55 | - super._prepare(); | 58 | + void prepare() { |
59 | + super.prepare(); | ||
56 | 60 | ||
57 | params['/BaseFont'] = PdfName('/' + fontName); | 61 | params['/BaseFont'] = PdfName('/' + fontName); |
58 | } | 62 | } |
@@ -14,9 +14,7 @@ | @@ -14,9 +14,7 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | ||
18 | - | ||
19 | -const List<double> _helveticaWidths = <double>[ | 17 | +const List<double> helveticaWidths = <double>[ |
20 | 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, // | 18 | 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, // |
21 | 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, // | 19 | 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, // |
22 | 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, // | 20 | 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, 0.500, // |
@@ -45,7 +43,7 @@ const List<double> _helveticaWidths = <double>[ | @@ -45,7 +43,7 @@ const List<double> _helveticaWidths = <double>[ | ||
45 | 0.500 | 43 | 0.500 |
46 | ]; | 44 | ]; |
47 | 45 | ||
48 | -const List<double> _helveticaBoldWidths = <double>[ | 46 | +const List<double> helveticaBoldWidths = <double>[ |
49 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // | 47 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // |
50 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // | 48 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // |
51 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // | 49 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // |
@@ -74,7 +72,7 @@ const List<double> _helveticaBoldWidths = <double>[ | @@ -74,7 +72,7 @@ const List<double> _helveticaBoldWidths = <double>[ | ||
74 | 0.556 | 72 | 0.556 |
75 | ]; | 73 | ]; |
76 | 74 | ||
77 | -const List<double> _helveticaBoldObliqueWidths = <double>[ | 75 | +const List<double> helveticaBoldObliqueWidths = <double>[ |
78 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // | 76 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // |
79 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // | 77 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // |
80 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // | 78 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // |
@@ -103,7 +101,7 @@ const List<double> _helveticaBoldObliqueWidths = <double>[ | @@ -103,7 +101,7 @@ const List<double> _helveticaBoldObliqueWidths = <double>[ | ||
103 | 0.556 | 101 | 0.556 |
104 | ]; | 102 | ]; |
105 | 103 | ||
106 | -const List<double> _helveticaObliqueWidths = <double>[ | 104 | +const List<double> helveticaObliqueWidths = <double>[ |
107 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // | 105 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // |
108 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // | 106 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // |
109 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // | 107 | 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, 0.278, // |
@@ -132,7 +130,7 @@ const List<double> _helveticaObliqueWidths = <double>[ | @@ -132,7 +130,7 @@ const List<double> _helveticaObliqueWidths = <double>[ | ||
132 | 0.500 | 130 | 0.500 |
133 | ]; | 131 | ]; |
134 | 132 | ||
135 | -const List<double> _timesWidths = <double>[ | 133 | +const List<double> timesWidths = <double>[ |
136 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 134 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
137 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 135 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
138 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 136 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
@@ -161,7 +159,7 @@ const List<double> _timesWidths = <double>[ | @@ -161,7 +159,7 @@ const List<double> _timesWidths = <double>[ | ||
161 | 0.500, 0.500, 0.500, 0.500 | 159 | 0.500, 0.500, 0.500, 0.500 |
162 | ]; | 160 | ]; |
163 | 161 | ||
164 | -const List<double> _timesBoldWidths = <double>[ | 162 | +const List<double> timesBoldWidths = <double>[ |
165 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 163 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
166 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 164 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
167 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 165 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
@@ -189,7 +187,7 @@ const List<double> _timesBoldWidths = <double>[ | @@ -189,7 +187,7 @@ const List<double> _timesBoldWidths = <double>[ | ||
189 | 0.500, 0.570, 0.500, 0.556, 0.556, 0.556, 0.556, 0.500, 0.556, 0.500 | 187 | 0.500, 0.570, 0.500, 0.556, 0.556, 0.556, 0.556, 0.500, 0.556, 0.500 |
190 | ]; | 188 | ]; |
191 | 189 | ||
192 | -const List<double> _timesBoldItalicWidths = <double>[ | 190 | +const List<double> timesBoldItalicWidths = <double>[ |
193 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 191 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
194 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 192 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
195 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 193 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
@@ -218,7 +216,7 @@ const List<double> _timesBoldItalicWidths = <double>[ | @@ -218,7 +216,7 @@ const List<double> _timesBoldItalicWidths = <double>[ | ||
218 | 0.556, 0.444, 0.500, 0.444 | 216 | 0.556, 0.444, 0.500, 0.444 |
219 | ]; | 217 | ]; |
220 | 218 | ||
221 | -const List<double> _timesItalicWidths = <double>[ | 219 | +const List<double> timesItalicWidths = <double>[ |
222 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 220 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
223 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 221 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
224 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // | 222 | 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250, // |
@@ -247,7 +245,7 @@ const List<double> _timesItalicWidths = <double>[ | @@ -247,7 +245,7 @@ const List<double> _timesItalicWidths = <double>[ | ||
247 | 0.500, 0.500, 0.444, 0.500, 0.444 | 245 | 0.500, 0.500, 0.444, 0.500, 0.444 |
248 | ]; | 246 | ]; |
249 | 247 | ||
250 | -const List<double> _symbolWidths = <double>[ | 248 | +const List<double> symbolWidths = <double>[ |
251 | 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, // | 249 | 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, // |
252 | 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, // | 250 | 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, // |
253 | 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, // | 251 | 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, 0.587, // |
@@ -276,7 +274,7 @@ const List<double> _symbolWidths = <double>[ | @@ -276,7 +274,7 @@ const List<double> _symbolWidths = <double>[ | ||
276 | 0.384, 0.494, 0.494, 0.494, 0.587 | 274 | 0.384, 0.494, 0.494, 0.494, 0.587 |
277 | ]; | 275 | ]; |
278 | 276 | ||
279 | -const List<double> _zapfDingbatsWidths = <double>[ | 277 | +const List<double> zapfDingbatsWidths = <double>[ |
280 | 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, // | 278 | 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, // |
281 | 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, // | 279 | 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, // |
282 | 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, // | 280 | 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, 0.746, // |
@@ -14,7 +14,8 @@ | @@ -14,7 +14,8 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'document.dart'; |
18 | +import 'object_stream.dart'; | ||
18 | 19 | ||
19 | /// Unicode character map object | 20 | /// Unicode character map object |
20 | class PdfUnicodeCmap extends PdfObjectStream { | 21 | class PdfUnicodeCmap extends PdfObjectStream { |
@@ -28,7 +29,7 @@ class PdfUnicodeCmap extends PdfObjectStream { | @@ -28,7 +29,7 @@ class PdfUnicodeCmap extends PdfObjectStream { | ||
28 | final bool protect; | 29 | final bool protect; |
29 | 30 | ||
30 | @override | 31 | @override |
31 | - void _prepare() { | 32 | + void prepare() { |
32 | if (protect) { | 33 | if (protect) { |
33 | cmap.fillRange(1, cmap.length, 0x20); | 34 | cmap.fillRange(1, cmap.length, 0x20); |
34 | } | 35 | } |
@@ -62,6 +63,6 @@ class PdfUnicodeCmap extends PdfObjectStream { | @@ -62,6 +63,6 @@ class PdfUnicodeCmap extends PdfObjectStream { | ||
62 | 'CMapName currentdict /CMap defineresource pop\n' | 63 | 'CMapName currentdict /CMap defineresource pop\n' |
63 | 'end\n' | 64 | 'end\n' |
64 | 'end'); | 65 | 'end'); |
65 | - super._prepare(); | 66 | + super.prepare(); |
66 | } | 67 | } |
67 | } | 68 | } |
@@ -14,7 +14,9 @@ | @@ -14,7 +14,9 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | 17 | +import 'data_types.dart'; |
18 | +import 'document.dart'; | ||
19 | +import 'object_stream.dart'; | ||
18 | 20 | ||
19 | class PdfXObject extends PdfObjectStream { | 21 | class PdfXObject extends PdfObjectStream { |
20 | PdfXObject(PdfDocument pdfDocument, String subtype, {bool isBinary = false}) | 22 | PdfXObject(PdfDocument pdfDocument, String subtype, {bool isBinary = false}) |
@@ -14,8 +14,6 @@ | @@ -14,8 +14,6 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of pdf; | ||
18 | - | ||
19 | /// Cross-reference for a Pdf Object | 17 | /// Cross-reference for a Pdf Object |
20 | class PdfXref { | 18 | class PdfXref { |
21 | /// Creates a cross-reference for a Pdf Object | 19 | /// Creates a cross-reference for a Pdf Object |
@@ -14,54 +14,41 @@ | @@ -14,54 +14,41 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -library widget; | ||
18 | - | ||
19 | -import 'dart:collection'; | ||
20 | -import 'dart:convert'; | ||
21 | -import 'dart:math' as math; | ||
22 | -import 'dart:typed_data'; | ||
23 | - | ||
24 | -import 'package:barcode/barcode.dart'; | ||
25 | -import 'package:image/image.dart' as im; | ||
26 | -import 'package:meta/meta.dart'; | ||
27 | -import 'package:pdf/pdf.dart'; | ||
28 | -import 'package:vector_math/vector_math_64.dart'; | ||
29 | - | ||
30 | export 'package:barcode/barcode.dart'; | 17 | export 'package:barcode/barcode.dart'; |
31 | 18 | ||
32 | -part 'widgets/annotations.dart'; | ||
33 | -part 'widgets/barcode.dart'; | ||
34 | -part 'widgets/basic.dart'; | ||
35 | -part 'widgets/chart/bar_chart.dart'; | ||
36 | -part 'widgets/chart/chart.dart'; | ||
37 | -part 'widgets/chart/grid_axis.dart'; | ||
38 | -part 'widgets/chart/grid_cartesian.dart'; | ||
39 | -part 'widgets/chart/legend.dart'; | ||
40 | -part 'widgets/chart/line_chart.dart'; | ||
41 | -part 'widgets/clip.dart'; | ||
42 | -part 'widgets/container.dart'; | ||
43 | -part 'widgets/content.dart'; | ||
44 | -part 'widgets/decoration.dart'; | ||
45 | -part 'widgets/document.dart'; | ||
46 | -part 'widgets/flex.dart'; | ||
47 | -part 'widgets/font.dart'; | ||
48 | -part 'widgets/forms.dart'; | ||
49 | -part 'widgets/geometry.dart'; | ||
50 | -part 'widgets/grid_view.dart'; | ||
51 | -part 'widgets/icon.dart'; | ||
52 | -part 'widgets/image.dart'; | ||
53 | -part 'widgets/image_provider.dart'; | ||
54 | -part 'widgets/multi_page.dart'; | ||
55 | -part 'widgets/page.dart'; | ||
56 | -part 'widgets/page_theme.dart'; | ||
57 | -part 'widgets/partitions.dart'; | ||
58 | -part 'widgets/placeholders.dart'; | ||
59 | -part 'widgets/progress.dart'; | ||
60 | -part 'widgets/qrcode.dart'; | ||
61 | -part 'widgets/stack.dart'; | ||
62 | -part 'widgets/table.dart'; | ||
63 | -part 'widgets/text.dart'; | ||
64 | -part 'widgets/text_style.dart'; | ||
65 | -part 'widgets/theme.dart'; | ||
66 | -part 'widgets/widget.dart'; | ||
67 | -part 'widgets/wrap.dart'; | 19 | +export 'widgets/annotations.dart'; |
20 | +export 'widgets/barcode.dart'; | ||
21 | +export 'widgets/basic.dart'; | ||
22 | +export 'widgets/chart/bar_chart.dart'; | ||
23 | +export 'widgets/chart/chart.dart'; | ||
24 | +export 'widgets/chart/grid_axis.dart'; | ||
25 | +export 'widgets/chart/grid_cartesian.dart'; | ||
26 | +export 'widgets/chart/legend.dart'; | ||
27 | +export 'widgets/chart/line_chart.dart'; | ||
28 | +export 'widgets/clip.dart'; | ||
29 | +export 'widgets/container.dart'; | ||
30 | +export 'widgets/content.dart'; | ||
31 | +export 'widgets/decoration.dart'; | ||
32 | +export 'widgets/document.dart'; | ||
33 | +export 'widgets/flex.dart'; | ||
34 | +export 'widgets/font.dart'; | ||
35 | +export 'widgets/forms.dart'; | ||
36 | +export 'widgets/geometry.dart'; | ||
37 | +export 'widgets/grid_view.dart'; | ||
38 | +export 'widgets/icon.dart'; | ||
39 | +export 'widgets/image.dart'; | ||
40 | +export 'widgets/image_provider.dart'; | ||
41 | +export 'widgets/multi_page.dart'; | ||
42 | +export 'widgets/page.dart'; | ||
43 | +export 'widgets/page_theme.dart'; | ||
44 | +export 'widgets/partitions.dart'; | ||
45 | +export 'widgets/placeholders.dart'; | ||
46 | +export 'widgets/progress.dart'; | ||
47 | +export 'widgets/qrcode.dart'; | ||
48 | +export 'widgets/stack.dart'; | ||
49 | +export 'widgets/table.dart'; | ||
50 | +export 'widgets/text.dart'; | ||
51 | +export 'widgets/text_style.dart'; | ||
52 | +export 'widgets/theme.dart'; | ||
53 | +export 'widgets/widget.dart'; | ||
54 | +export 'widgets/wrap.dart'; |
@@ -14,7 +14,15 @@ | @@ -14,7 +14,15 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:pdf/pdf.dart'; | ||
19 | +import 'package:vector_math/vector_math_64.dart'; | ||
20 | + | ||
21 | +import 'basic.dart'; | ||
22 | +import 'geometry.dart'; | ||
23 | +import 'text_style.dart'; | ||
24 | +import 'theme.dart'; | ||
25 | +import 'widget.dart'; | ||
18 | 26 | ||
19 | class Anchor extends SingleChildWidget { | 27 | class Anchor extends SingleChildWidget { |
20 | Anchor({ | 28 | Anchor({ |
@@ -14,7 +14,21 @@ | @@ -14,7 +14,21 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:convert'; |
18 | +import 'dart:typed_data'; | ||
19 | + | ||
20 | +import 'package:barcode/barcode.dart'; | ||
21 | +import 'package:meta/meta.dart'; | ||
22 | +import 'package:pdf/pdf.dart'; | ||
23 | + | ||
24 | +import 'basic.dart'; | ||
25 | +import 'container.dart'; | ||
26 | +import 'decoration.dart'; | ||
27 | +import 'font.dart'; | ||
28 | +import 'geometry.dart'; | ||
29 | +import 'text_style.dart'; | ||
30 | +import 'theme.dart'; | ||
31 | +import 'widget.dart'; | ||
18 | 32 | ||
19 | class _BarcodeWidget extends Widget { | 33 | class _BarcodeWidget extends Widget { |
20 | _BarcodeWidget({ | 34 | _BarcodeWidget({ |
@@ -14,7 +14,16 @@ | @@ -14,7 +14,16 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | +import 'package:vector_math/vector_math_64.dart'; | ||
22 | + | ||
23 | +import 'container.dart'; | ||
24 | +import 'decoration.dart'; | ||
25 | +import 'geometry.dart'; | ||
26 | +import 'widget.dart'; | ||
18 | 27 | ||
19 | enum BoxFit { fill, contain, cover, fitWidth, fitHeight, none, scaleDown } | 28 | enum BoxFit { fill, contain, cover, fitWidth, fitHeight, none, scaleDown } |
20 | 29 |
@@ -14,7 +14,15 @@ | @@ -14,7 +14,15 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:pdf/pdf.dart'; | ||
19 | + | ||
20 | +import '../flex.dart'; | ||
21 | +import '../geometry.dart'; | ||
22 | +import '../widget.dart'; | ||
23 | +import 'chart.dart'; | ||
24 | +import 'grid_cartesian.dart'; | ||
25 | +import 'line_chart.dart'; | ||
18 | 26 | ||
19 | class BarDataSet extends Dataset { | 27 | class BarDataSet extends Dataset { |
20 | BarDataSet({ | 28 | BarDataSet({ |
@@ -14,7 +14,16 @@ | @@ -14,7 +14,16 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:pdf/pdf.dart'; | ||
19 | +import 'package:vector_math/vector_math_64.dart'; | ||
20 | + | ||
21 | +import '../container.dart'; | ||
22 | +import '../decoration.dart'; | ||
23 | +import '../flex.dart'; | ||
24 | +import '../geometry.dart'; | ||
25 | +import '../stack.dart'; | ||
26 | +import '../widget.dart'; | ||
18 | 27 | ||
19 | /// This widget is in preview and the API is subject to change | 28 | /// This widget is in preview and the API is subject to change |
20 | class Chart extends Widget implements Inherited { | 29 | class Chart extends Widget implements Inherited { |
@@ -14,7 +14,17 @@ | @@ -14,7 +14,17 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:pdf/pdf.dart'; | ||
20 | + | ||
21 | +import '../flex.dart'; | ||
22 | +import '../geometry.dart'; | ||
23 | +import '../text_style.dart'; | ||
24 | +import '../theme.dart'; | ||
25 | +import '../widget.dart'; | ||
26 | +import 'chart.dart'; | ||
27 | +import 'grid_cartesian.dart'; | ||
18 | 28 | ||
19 | typedef GridAxisFormat = String Function(num value); | 29 | typedef GridAxisFormat = String Function(num value); |
20 | 30 | ||
@@ -53,7 +63,7 @@ abstract class GridAxis extends Widget { | @@ -53,7 +63,7 @@ abstract class GridAxis extends Widget { | ||
53 | 63 | ||
54 | final double margin; | 64 | final double margin; |
55 | 65 | ||
56 | - double _crossAxisPosition = 0; | 66 | + double crossAxisPosition = 0; |
57 | 67 | ||
58 | double _textMargin; | 68 | double _textMargin; |
59 | 69 | ||
@@ -173,7 +183,7 @@ class FixedAxis<T extends num> extends GridAxis { | @@ -173,7 +183,7 @@ class FixedAxis<T extends num> extends GridAxis { | ||
173 | double toChart(num input) { | 183 | double toChart(num input) { |
174 | final offset = transfer(values.first); | 184 | final offset = transfer(values.first); |
175 | final total = transfer(values.last) - offset; | 185 | final total = transfer(values.last) - offset; |
176 | - final start = _crossAxisPosition + _marginStart; | 186 | + final start = crossAxisPosition + _marginStart; |
177 | switch (direction) { | 187 | switch (direction) { |
178 | case Axis.horizontal: | 188 | case Axis.horizontal: |
179 | return box.left + | 189 | return box.left + |
@@ -219,7 +229,7 @@ class FixedAxis<T extends num> extends GridAxis { | @@ -219,7 +229,7 @@ class FixedAxis<T extends num> extends GridAxis { | ||
219 | _axisTick ??= false; | 229 | _axisTick ??= false; |
220 | final minStart = metricsFirst.maxWidth / 2; | 230 | final minStart = metricsFirst.maxWidth / 2; |
221 | _marginEnd = math.max(_marginEnd, metrics.maxWidth / 2); | 231 | _marginEnd = math.max(_marginEnd, metrics.maxWidth / 2); |
222 | - _crossAxisPosition = math.max(_crossAxisPosition, minStart); | 232 | + crossAxisPosition = math.max(crossAxisPosition, minStart); |
223 | axisPosition = math.max(axisPosition, maxHeight + _textMargin); | 233 | axisPosition = math.max(axisPosition, maxHeight + _textMargin); |
224 | box = PdfRect(0, 0, size.x, axisPosition); | 234 | box = PdfRect(0, 0, size.x, axisPosition); |
225 | break; | 235 | break; |
@@ -229,7 +239,7 @@ class FixedAxis<T extends num> extends GridAxis { | @@ -229,7 +239,7 @@ class FixedAxis<T extends num> extends GridAxis { | ||
229 | _marginEnd = math.max(_marginEnd, metrics.maxHeight / 2); | 239 | _marginEnd = math.max(_marginEnd, metrics.maxHeight / 2); |
230 | final minStart = metricsFirst.maxHeight / 2; | 240 | final minStart = metricsFirst.maxHeight / 2; |
231 | _marginEnd = math.max(_marginEnd, metrics.maxWidth / 2); | 241 | _marginEnd = math.max(_marginEnd, metrics.maxWidth / 2); |
232 | - _crossAxisPosition = math.max(_crossAxisPosition, minStart); | 242 | + crossAxisPosition = math.max(crossAxisPosition, minStart); |
233 | axisPosition = math.max(axisPosition, maxWidth + _textMargin); | 243 | axisPosition = math.max(axisPosition, maxWidth + _textMargin); |
234 | box = PdfRect(0, 0, axisPosition, size.y); | 244 | box = PdfRect(0, 0, axisPosition, size.y); |
235 | break; | 245 | break; |
@@ -239,13 +249,13 @@ class FixedAxis<T extends num> extends GridAxis { | @@ -239,13 +249,13 @@ class FixedAxis<T extends num> extends GridAxis { | ||
239 | void _drawYValues(Context context) { | 249 | void _drawYValues(Context context) { |
240 | context.canvas | 250 | context.canvas |
241 | ..moveTo(axisPosition, box.top) | 251 | ..moveTo(axisPosition, box.top) |
242 | - ..lineTo(axisPosition, box.bottom + _crossAxisPosition); | 252 | + ..lineTo(axisPosition, box.bottom + crossAxisPosition); |
243 | 253 | ||
244 | if (_axisTick && _textMargin > 0) { | 254 | if (_axisTick && _textMargin > 0) { |
245 | context.canvas | 255 | context.canvas |
246 | - ..moveTo(axisPosition, box.bottom + _crossAxisPosition) | 256 | + ..moveTo(axisPosition, box.bottom + crossAxisPosition) |
247 | ..lineTo( | 257 | ..lineTo( |
248 | - axisPosition - _textMargin / 2, box.bottom + _crossAxisPosition); | 258 | + axisPosition - _textMargin / 2, box.bottom + crossAxisPosition); |
249 | } | 259 | } |
250 | 260 | ||
251 | if (ticks && _textMargin > 0) { | 261 | if (ticks && _textMargin > 0) { |
@@ -284,13 +294,13 @@ class FixedAxis<T extends num> extends GridAxis { | @@ -284,13 +294,13 @@ class FixedAxis<T extends num> extends GridAxis { | ||
284 | 294 | ||
285 | void _drawXValues(Context context) { | 295 | void _drawXValues(Context context) { |
286 | context.canvas | 296 | context.canvas |
287 | - ..moveTo(box.left + _crossAxisPosition, axisPosition) | 297 | + ..moveTo(box.left + crossAxisPosition, axisPosition) |
288 | ..lineTo(box.right, axisPosition); | 298 | ..lineTo(box.right, axisPosition); |
289 | 299 | ||
290 | if (_axisTick && _textMargin > 0) { | 300 | if (_axisTick && _textMargin > 0) { |
291 | context.canvas | 301 | context.canvas |
292 | - ..moveTo(box.left + _crossAxisPosition, axisPosition) | ||
293 | - ..lineTo(box.left + _crossAxisPosition, axisPosition - _textMargin); | 302 | + ..moveTo(box.left + crossAxisPosition, axisPosition) |
303 | + ..lineTo(box.left + crossAxisPosition, axisPosition - _textMargin); | ||
294 | } | 304 | } |
295 | 305 | ||
296 | if (ticks && _textMargin > 0) { | 306 | if (ticks && _textMargin > 0) { |
@@ -379,8 +389,8 @@ class FixedAxis<T extends num> extends GridAxis { | @@ -379,8 +389,8 @@ class FixedAxis<T extends num> extends GridAxis { | ||
379 | case Axis.vertical: | 389 | case Axis.vertical: |
380 | context.canvas | 390 | context.canvas |
381 | ..setFillColor(PdfColors.grey300) | 391 | ..setFillColor(PdfColors.grey300) |
382 | - ..drawRect(box.x, box.y + _crossAxisPosition, box.width, | ||
383 | - box.height - _crossAxisPosition) | 392 | + ..drawRect(box.x, box.y + crossAxisPosition, box.width, |
393 | + box.height - crossAxisPosition) | ||
384 | ..fillPath(); | 394 | ..fillPath(); |
385 | break; | 395 | break; |
386 | } | 396 | } |
@@ -14,7 +14,16 @@ | @@ -14,7 +14,16 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | + | ||
22 | +import '../flex.dart'; | ||
23 | +import '../geometry.dart'; | ||
24 | +import '../widget.dart'; | ||
25 | +import 'chart.dart'; | ||
26 | +import 'grid_axis.dart'; | ||
18 | 27 | ||
19 | class CartesianGrid extends ChartGrid { | 28 | class CartesianGrid extends ChartGrid { |
20 | CartesianGrid({ | 29 | CartesianGrid({ |
@@ -41,18 +50,18 @@ class CartesianGrid extends ChartGrid { | @@ -41,18 +50,18 @@ class CartesianGrid extends ChartGrid { | ||
41 | // In simple conditions, this loop will run only 2 times. | 50 | // In simple conditions, this loop will run only 2 times. |
42 | var count = 5; | 51 | var count = 5; |
43 | while (count-- > 0) { | 52 | while (count-- > 0) { |
44 | - _xAxis._crossAxisPosition = _yAxis.axisPosition; | 53 | + _xAxis.crossAxisPosition = _yAxis.axisPosition; |
45 | _xAxis.axisPosition = | 54 | _xAxis.axisPosition = |
46 | - math.max(_xAxis.axisPosition, _yAxis._crossAxisPosition); | 55 | + math.max(_xAxis.axisPosition, _yAxis.crossAxisPosition); |
47 | _xAxis.layout(context, constraints); | 56 | _xAxis.layout(context, constraints); |
48 | assert(_xAxis.box != null); | 57 | assert(_xAxis.box != null); |
49 | - _yAxis._crossAxisPosition = _xAxis.axisPosition; | 58 | + _yAxis.crossAxisPosition = _xAxis.axisPosition; |
50 | _yAxis.axisPosition = | 59 | _yAxis.axisPosition = |
51 | - math.max(_yAxis.axisPosition, _xAxis._crossAxisPosition); | 60 | + math.max(_yAxis.axisPosition, _xAxis.crossAxisPosition); |
52 | _yAxis.layout(context, constraints); | 61 | _yAxis.layout(context, constraints); |
53 | assert(_yAxis.box != null); | 62 | assert(_yAxis.box != null); |
54 | - if (_yAxis._crossAxisPosition == _xAxis.axisPosition && | ||
55 | - _xAxis._crossAxisPosition == _yAxis.axisPosition) { | 63 | + if (_yAxis.crossAxisPosition == _xAxis.axisPosition && |
64 | + _xAxis.crossAxisPosition == _yAxis.axisPosition) { | ||
56 | break; | 65 | break; |
57 | } | 66 | } |
58 | } | 67 | } |
@@ -14,7 +14,19 @@ | @@ -14,7 +14,19 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:pdf/pdf.dart'; |
18 | + | ||
19 | +import '../basic.dart'; | ||
20 | +import '../container.dart'; | ||
21 | +import '../decoration.dart'; | ||
22 | +import '../flex.dart'; | ||
23 | +import '../geometry.dart'; | ||
24 | +import '../text.dart'; | ||
25 | +import '../text_style.dart'; | ||
26 | +import '../theme.dart'; | ||
27 | +import '../widget.dart'; | ||
28 | +import '../wrap.dart'; | ||
29 | +import 'chart.dart'; | ||
18 | 30 | ||
19 | class ChartLegend extends StatelessWidget { | 31 | class ChartLegend extends StatelessWidget { |
20 | ChartLegend({ | 32 | ChartLegend({ |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:pdf/pdf.dart'; | ||
19 | + | ||
20 | +import '../geometry.dart'; | ||
21 | +import '../widget.dart'; | ||
22 | +import 'chart.dart'; | ||
23 | +import 'grid_cartesian.dart'; | ||
18 | 24 | ||
19 | class LineChartValue extends ChartValue { | 25 | class LineChartValue extends ChartValue { |
20 | const LineChartValue(this.x, this.y); | 26 | const LineChartValue(this.x, this.y); |
@@ -14,7 +14,10 @@ | @@ -14,7 +14,10 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:pdf/pdf.dart'; |
18 | +import 'package:vector_math/vector_math_64.dart'; | ||
19 | + | ||
20 | +import 'widget.dart'; | ||
18 | 21 | ||
19 | class ClipRect extends SingleChildWidget { | 22 | class ClipRect extends SingleChildWidget { |
20 | ClipRect({Widget child}) : super(child: child); | 23 | ClipRect({Widget child}) : super(child: child); |
@@ -14,7 +14,14 @@ | @@ -14,7 +14,14 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:pdf/pdf.dart'; | ||
19 | +import 'package:vector_math/vector_math_64.dart'; | ||
20 | + | ||
21 | +import 'basic.dart'; | ||
22 | +import 'decoration.dart'; | ||
23 | +import 'geometry.dart'; | ||
24 | +import 'widget.dart'; | ||
18 | 25 | ||
19 | class DecoratedBox extends SingleChildWidget { | 26 | class DecoratedBox extends SingleChildWidget { |
20 | DecoratedBox( | 27 | DecoratedBox( |
@@ -14,7 +14,21 @@ | @@ -14,7 +14,21 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | + | ||
22 | +import 'annotations.dart'; | ||
23 | +import 'basic.dart'; | ||
24 | +import 'container.dart'; | ||
25 | +import 'decoration.dart'; | ||
26 | +import 'flex.dart'; | ||
27 | +import 'geometry.dart'; | ||
28 | +import 'text.dart'; | ||
29 | +import 'text_style.dart'; | ||
30 | +import 'theme.dart'; | ||
31 | +import 'widget.dart'; | ||
18 | 32 | ||
19 | class Header extends StatelessWidget { | 33 | class Header extends StatelessWidget { |
20 | Header({ | 34 | Header({ |
@@ -14,7 +14,17 @@ | @@ -14,7 +14,17 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:image/image.dart' as im; | ||
20 | +import 'package:meta/meta.dart'; | ||
21 | +import 'package:pdf/pdf.dart'; | ||
22 | +import 'package:vector_math/vector_math_64.dart'; | ||
23 | + | ||
24 | +import 'basic.dart'; | ||
25 | +import 'geometry.dart'; | ||
26 | +import 'image_provider.dart'; | ||
27 | +import 'widget.dart'; | ||
18 | 28 | ||
19 | enum DecorationPosition { background, foreground } | 29 | enum DecorationPosition { background, foreground } |
20 | 30 |
@@ -14,7 +14,12 @@ | @@ -14,7 +14,12 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:typed_data'; |
18 | + | ||
19 | +import 'package:pdf/pdf.dart'; | ||
20 | + | ||
21 | +import 'page.dart'; | ||
22 | +import 'theme.dart'; | ||
18 | 23 | ||
19 | class Document { | 24 | class Document { |
20 | Document( | 25 | Document( |
@@ -14,7 +14,16 @@ | @@ -14,7 +14,16 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | +import 'package:vector_math/vector_math_64.dart'; | ||
22 | + | ||
23 | +import 'basic.dart'; | ||
24 | +import 'geometry.dart'; | ||
25 | +import 'multi_page.dart'; | ||
26 | +import 'widget.dart'; | ||
18 | 27 | ||
19 | enum FlexFit { | 28 | enum FlexFit { |
20 | tight, | 29 | tight, |
@@ -14,7 +14,12 @@ | @@ -14,7 +14,12 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:typed_data'; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | + | ||
22 | +import 'widget.dart'; | ||
18 | 23 | ||
19 | enum Type1Fonts { | 24 | enum Type1Fonts { |
20 | courier, | 25 | courier, |
@@ -14,7 +14,16 @@ | @@ -14,7 +14,16 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:pdf/pdf.dart'; | ||
19 | +import 'package:vector_math/vector_math_64.dart'; | ||
20 | + | ||
21 | +import 'container.dart'; | ||
22 | +import 'decoration.dart'; | ||
23 | +import 'geometry.dart'; | ||
24 | +import 'text_style.dart'; | ||
25 | +import 'theme.dart'; | ||
26 | +import 'widget.dart'; | ||
18 | 27 | ||
19 | class Checkbox extends SingleChildWidget { | 28 | class Checkbox extends SingleChildWidget { |
20 | Checkbox({ | 29 | Checkbox({ |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | +import 'package:vector_math/vector_math_64.dart'; | ||
22 | + | ||
23 | +import 'basic.dart'; | ||
18 | 24 | ||
19 | @immutable | 25 | @immutable |
20 | class BoxConstraints { | 26 | class BoxConstraints { |
@@ -14,7 +14,16 @@ | @@ -14,7 +14,16 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | +import 'package:vector_math/vector_math_64.dart'; | ||
22 | + | ||
23 | +import 'flex.dart'; | ||
24 | +import 'geometry.dart'; | ||
25 | +import 'multi_page.dart'; | ||
26 | +import 'widget.dart'; | ||
18 | 27 | ||
19 | class _GridViewContext extends WidgetContext { | 28 | class _GridViewContext extends WidgetContext { |
20 | int firstChild = 0; | 29 | int firstChild = 0; |
@@ -14,7 +14,17 @@ | @@ -14,7 +14,17 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:pdf/pdf.dart'; | ||
19 | +import 'package:vector_math/vector_math_64.dart'; | ||
20 | + | ||
21 | +import 'basic.dart'; | ||
22 | +import 'font.dart'; | ||
23 | +import 'geometry.dart'; | ||
24 | +import 'text.dart'; | ||
25 | +import 'text_style.dart'; | ||
26 | +import 'theme.dart'; | ||
27 | +import 'widget.dart'; | ||
18 | 28 | ||
19 | /// A description of an icon fulfilled by a font glyph. | 29 | /// A description of an icon fulfilled by a font glyph. |
20 | @immutable | 30 | @immutable |
@@ -14,7 +14,14 @@ | @@ -14,7 +14,14 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:pdf/pdf.dart'; | ||
19 | +import 'package:vector_math/vector_math_64.dart'; | ||
20 | + | ||
21 | +import 'basic.dart'; | ||
22 | +import 'geometry.dart'; | ||
23 | +import 'image_provider.dart'; | ||
24 | +import 'widget.dart'; | ||
18 | 25 | ||
19 | void _paintImage({ | 26 | void _paintImage({ |
20 | @required PdfGraphics canvas, | 27 | @required PdfGraphics canvas, |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:typed_data'; |
18 | + | ||
19 | +import 'package:image/image.dart' as im; | ||
20 | +import 'package:meta/meta.dart'; | ||
21 | +import 'package:pdf/pdf.dart'; | ||
22 | + | ||
23 | +import 'widget.dart'; | ||
18 | 24 | ||
19 | /// Identifies an image without committing to the precise final asset | 25 | /// Identifies an image without committing to the precise final asset |
20 | abstract class ImageProvider { | 26 | abstract class ImageProvider { |
@@ -14,7 +14,21 @@ | @@ -14,7 +14,21 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | +import 'package:vector_math/vector_math_64.dart'; | ||
22 | + | ||
23 | +import 'document.dart'; | ||
24 | +import 'flex.dart'; | ||
25 | +import 'geometry.dart'; | ||
26 | +import 'page.dart'; | ||
27 | +import 'page_theme.dart'; | ||
28 | +import 'text.dart'; | ||
29 | +import 'text_style.dart'; | ||
30 | +import 'theme.dart'; | ||
31 | +import 'widget.dart'; | ||
18 | 32 | ||
19 | abstract class WidgetContext { | 33 | abstract class WidgetContext { |
20 | WidgetContext clone(); | 34 | WidgetContext clone(); |
@@ -14,7 +14,19 @@ | @@ -14,7 +14,19 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | +import 'package:vector_math/vector_math_64.dart'; | ||
22 | + | ||
23 | +import 'document.dart'; | ||
24 | +import 'geometry.dart'; | ||
25 | +import 'page_theme.dart'; | ||
26 | +import 'text.dart'; | ||
27 | +import 'text_style.dart'; | ||
28 | +import 'theme.dart'; | ||
29 | +import 'widget.dart'; | ||
18 | 30 | ||
19 | typedef BuildCallback = Widget Function(Context context); | 31 | typedef BuildCallback = Widget Function(Context context); |
20 | typedef BuildListCallback = List<Widget> Function(Context context); | 32 | typedef BuildListCallback = List<Widget> Function(Context context); |
@@ -84,12 +96,10 @@ class Page { | @@ -84,12 +96,10 @@ class Page { | ||
84 | ..fillPath(); | 96 | ..fillPath(); |
85 | } | 97 | } |
86 | 98 | ||
87 | - @protected | ||
88 | void generate(Document document) { | 99 | void generate(Document document) { |
89 | _pdfPage = PdfPage(document.document, pageFormat: pageFormat); | 100 | _pdfPage = PdfPage(document.document, pageFormat: pageFormat); |
90 | } | 101 | } |
91 | 102 | ||
92 | - @protected | ||
93 | void postProcess(Document document) { | 103 | void postProcess(Document document) { |
94 | final canvas = _pdfPage.getGraphics(); | 104 | final canvas = _pdfPage.getGraphics(); |
95 | final _margin = margin; | 105 | final _margin = margin; |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:pdf/pdf.dart'; | ||
19 | + | ||
20 | +import 'geometry.dart'; | ||
21 | +import 'page.dart'; | ||
22 | +import 'text.dart'; | ||
23 | +import 'theme.dart'; | ||
18 | 24 | ||
19 | @immutable | 25 | @immutable |
20 | class PageTheme { | 26 | class PageTheme { |
@@ -14,7 +14,16 @@ | @@ -14,7 +14,16 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | +import 'package:vector_math/vector_math_64.dart'; | ||
22 | + | ||
23 | +import 'flex.dart'; | ||
24 | +import 'geometry.dart'; | ||
25 | +import 'multi_page.dart'; | ||
26 | +import 'widget.dart'; | ||
18 | 27 | ||
19 | class Partition implements SpanningWidget { | 28 | class Partition implements SpanningWidget { |
20 | Partition({ | 29 | Partition({ |
@@ -14,7 +14,16 @@ | @@ -14,7 +14,16 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:pdf/pdf.dart'; | ||
20 | + | ||
21 | +import 'basic.dart'; | ||
22 | +import 'geometry.dart'; | ||
23 | +import 'image.dart'; | ||
24 | +import 'text.dart'; | ||
25 | +import 'text_style.dart'; | ||
26 | +import 'widget.dart'; | ||
18 | 27 | ||
19 | class Placeholder extends Widget { | 28 | class Placeholder extends Widget { |
20 | Placeholder( | 29 | Placeholder( |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | + | ||
22 | +import 'geometry.dart'; | ||
23 | +import 'widget.dart'; | ||
18 | 24 | ||
19 | class CircularProgressIndicator extends Widget { | 25 | class CircularProgressIndicator extends Widget { |
20 | CircularProgressIndicator( | 26 | CircularProgressIndicator( |
@@ -14,7 +14,14 @@ | @@ -14,7 +14,14 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:barcode/barcode.dart'; |
18 | +import 'package:meta/meta.dart'; | ||
19 | +import 'package:pdf/pdf.dart'; | ||
20 | + | ||
21 | +import 'barcode.dart'; | ||
22 | +import 'decoration.dart'; | ||
23 | +import 'geometry.dart'; | ||
24 | +import 'widget.dart'; | ||
18 | 25 | ||
19 | typedef QrError = void Function(dynamic error); | 26 | typedef QrError = void Function(dynamic error); |
20 | 27 |
@@ -14,7 +14,14 @@ | @@ -14,7 +14,14 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | +import 'package:vector_math/vector_math_64.dart'; | ||
22 | + | ||
23 | +import 'geometry.dart'; | ||
24 | +import 'widget.dart'; | ||
18 | 25 | ||
19 | /// How to size the non-positioned children of a [Stack]. | 26 | /// How to size the non-positioned children of a [Stack]. |
20 | enum StackFit { loose, expand, passthrough } | 27 | enum StackFit { loose, expand, passthrough } |
@@ -14,7 +14,21 @@ | @@ -14,7 +14,21 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | +import 'package:vector_math/vector_math_64.dart'; | ||
22 | + | ||
23 | +import 'container.dart'; | ||
24 | +import 'decoration.dart'; | ||
25 | +import 'flex.dart'; | ||
26 | +import 'geometry.dart'; | ||
27 | +import 'multi_page.dart'; | ||
28 | +import 'text.dart'; | ||
29 | +import 'text_style.dart'; | ||
30 | +import 'theme.dart'; | ||
31 | +import 'widget.dart'; | ||
18 | 32 | ||
19 | /// A horizontal group of cells in a [Table]. | 33 | /// A horizontal group of cells in a [Table]. |
20 | @immutable | 34 | @immutable |
@@ -14,7 +14,17 @@ | @@ -14,7 +14,17 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:meta/meta.dart'; | ||
20 | +import 'package:pdf/pdf.dart'; | ||
21 | + | ||
22 | +import 'annotations.dart'; | ||
23 | +import 'document.dart'; | ||
24 | +import 'geometry.dart'; | ||
25 | +import 'text_style.dart'; | ||
26 | +import 'theme.dart'; | ||
27 | +import 'widget.dart'; | ||
18 | 28 | ||
19 | enum TextAlign { left, right, center, justify } | 29 | enum TextAlign { left, right, center, justify } |
20 | 30 |
@@ -14,7 +14,13 @@ | @@ -14,7 +14,13 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | +import 'package:pdf/pdf.dart'; | ||
19 | + | ||
20 | +import 'decoration.dart'; | ||
21 | +import 'font.dart'; | ||
22 | +import 'text.dart'; | ||
23 | +import 'widget.dart'; | ||
18 | 24 | ||
19 | enum FontWeight { normal, bold } | 25 | enum FontWeight { normal, bold } |
20 | 26 |
@@ -14,7 +14,14 @@ | @@ -14,7 +14,14 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'package:meta/meta.dart'; |
18 | + | ||
19 | +import 'basic.dart'; | ||
20 | +import 'font.dart'; | ||
21 | +import 'icon.dart'; | ||
22 | +import 'text.dart'; | ||
23 | +import 'text_style.dart'; | ||
24 | +import 'widget.dart'; | ||
18 | 25 | ||
19 | @immutable | 26 | @immutable |
20 | class ThemeData extends Inherited { | 27 | class ThemeData extends Inherited { |
@@ -14,7 +14,16 @@ | @@ -14,7 +14,16 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:collection'; |
18 | +import 'dart:math' as math; | ||
19 | + | ||
20 | +import 'package:meta/meta.dart'; | ||
21 | +import 'package:pdf/pdf.dart'; | ||
22 | +import 'package:vector_math/vector_math_64.dart'; | ||
23 | + | ||
24 | +import 'document.dart'; | ||
25 | +import 'geometry.dart'; | ||
26 | +import 'page.dart'; | ||
18 | 27 | ||
19 | @immutable | 28 | @immutable |
20 | class Context { | 29 | class Context { |
@@ -106,13 +115,11 @@ abstract class Widget { | @@ -106,13 +115,11 @@ abstract class Widget { | ||
106 | 115 | ||
107 | /// First widget pass to calculate the children layout and | 116 | /// First widget pass to calculate the children layout and |
108 | /// bounding [box] | 117 | /// bounding [box] |
109 | - @protected | ||
110 | void layout(Context context, BoxConstraints constraints, | 118 | void layout(Context context, BoxConstraints constraints, |
111 | {bool parentUsesSize = false}); | 119 | {bool parentUsesSize = false}); |
112 | 120 | ||
113 | /// Draw itself and its children, according to the calculated | 121 | /// Draw itself and its children, according to the calculated |
114 | /// [box.offset] | 122 | /// [box.offset] |
115 | - @protected | ||
116 | @mustCallSuper | 123 | @mustCallSuper |
117 | void paint(Context context) { | 124 | void paint(Context context) { |
118 | assert(() { | 125 | assert(() { |
@@ -14,7 +14,15 @@ | @@ -14,7 +14,15 @@ | ||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -part of widget; | 17 | +import 'dart:math' as math; |
18 | + | ||
19 | +import 'package:pdf/pdf.dart'; | ||
20 | +import 'package:vector_math/vector_math_64.dart'; | ||
21 | + | ||
22 | +import 'flex.dart'; | ||
23 | +import 'geometry.dart'; | ||
24 | +import 'multi_page.dart'; | ||
25 | +import 'widget.dart'; | ||
18 | 26 | ||
19 | /// How [Wrap] should align objects. | 27 | /// How [Wrap] should align objects. |
20 | enum WrapAlignment { | 28 | enum WrapAlignment { |
@@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
17 | import 'dart:io'; | 17 | import 'dart:io'; |
18 | 18 | ||
19 | import 'package:pdf/pdf.dart'; | 19 | import 'package:pdf/pdf.dart'; |
20 | +import 'package:pdf/src/ttf_writer.dart'; | ||
20 | import 'package:test/test.dart'; | 21 | import 'package:test/test.dart'; |
21 | 22 | ||
22 | void printText( | 23 | void printText( |
-
Please register or login to post a comment