title: Flutter creat pdf file with different page size and font size
body: <p>Here with the code to create a pdf file for flutter. I am using plugin <a href="https://pub.dartlang.org/packages/pdf#-example-tab-" rel="noreferrer">pdf 1.0.6</a>.</p>
  
  <p>My questions:</p>
  
  <ul>
  <li>How to create a pdf file width 75mm with auto height to fit the
  content?</li>
  <li><p>How to create multi lines of text with different font size?  </p>
  
  <pre><code>PDFDocument _generateDocument() {
  final pdf = new PDFDocument(deflate: zlib.encode);
  final page = new PDFPage(pdf, pageFormat: PDFPageFormat.A4);
  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.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);
  
  return pdf;
  </code></pre>
  
  <p>}</p></li>
  </ul>