Flutter PDF Rotation

Viewed 317
1 Answers

Try this. Comments in code.

pdf.addPage(
      pw.Page(
        pageTheme: pw.PageTheme(
          // orientation:  pw.PageOrientation.landscape, //this set the orientation of the content of the page, not the page itself. Which confuses most people
          pageFormat: PdfPageFormat.a4.landscape, //this is what you want
...
      ),
      build: (ctx) => ChildWidget(),
...

Source: https://github.com/DavBfr/dart_pdf/issues/557

Related