David PHAM-VAN

Update constant case in all files

... ... @@ -15,7 +15,7 @@ The coordinate system is using the internal Pdf system:
Example:
```dart
final pdf = new PDFDocument();
final page = new PDFPage(pdf, pageFormat: PDFPageFormat.LETTER);
final page = new PDFPage(pdf, pageFormat: PDFPageFormat.letter);
final g = page.getGraphics();
final font = new PDFFont(pdf);
... ... @@ -24,7 +24,7 @@ g.drawRect(50.0, 30.0, 100.0, 50.0);
g.fillPath();
g.setColor(new PDFColor(0.3, 0.3, 0.3));
g.drawString(font, 12.0, "Hello World!", 5.0 * PDFPageFormat.MM, 300.0);
g.drawString(font, 12.0, "Hello World!", 5.0 * PDFPageFormat.mm, 300.0);
var file = new File('file.pdf');
file.writeAsBytesSync(pdf.save());
... ...
... ... @@ -4,19 +4,19 @@ import 'package:pdf/pdf.dart';
void main() {
final pdf = new PDFDocument(deflate: zlib.encode);
final page = new PDFPage(pdf, pageFormat: PDFPageFormat.LETTER);
final page = new PDFPage(pdf, pageFormat: PDFPageFormat.letter);
final g = page.getGraphics();
final font = new PDFFont(pdf);
final top = page.pageFormat.height;
g.setColor(new PDFColor(0.0, 1.0, 1.0));
g.drawRect(50.0 * PDFPageFormat.MM, top - 80.0 * PDFPageFormat.MM,
100.0 * PDFPageFormat.MM, 50.0 * PDFPageFormat.MM);
g.drawRect(50.0 * PDFPageFormat.mm, top - 80.0 * PDFPageFormat.mm,
100.0 * PDFPageFormat.mm, 50.0 * PDFPageFormat.mm);
g.fillPath();
g.setColor(new PDFColor(0.3, 0.3, 0.3));
g.drawString(font, 12.0, "Hello World!", 10.0 * PDFPageFormat.MM,
top - 10.0 * PDFPageFormat.MM);
g.drawString(font, 12.0, "Hello World!", 10.0 * PDFPageFormat.mm,
top - 10.0 * PDFPageFormat.mm);
var file = new File('example.pdf');
file.writeAsBytesSync(pdf.save());
... ...
... ... @@ -51,7 +51,7 @@ class PDFPage extends PDFObject {
PDFPage(PDFDocument pdfDocument, {this.pageFormat})
: super(pdfDocument, "/Page") {
pdfDocument.pdfPageList.pages.add(this);
if (pageFormat == null) pageFormat = PDFPageFormat.A4;
if (pageFormat == null) pageFormat = PDFPageFormat.a4;
}
/// This returns a PDFGraphics object, which can then be used to render
... ...
... ... @@ -6,7 +6,7 @@ import "package:test/test.dart";
void main() {
test('Pdf1', () {
var pdf = new PDFDocument();
var page = new PDFPage(pdf, pageFormat: PDFPageFormat.A4);
var page = new PDFPage(pdf, pageFormat: PDFPageFormat.a4);
var g = page.getGraphics();
g.drawLine(30.0, 30.0, 200.0, 200.0);
... ...