【问题标题】:Flutter pdf packe fullfill all the a4 format?Flutter pdf 包是否满足所有 a4 格式?
【发布时间】:2022-01-23 11:50:00
【问题描述】:

我正在使用 Flutter pdf 插件。这是我的代码:

pdf.addPage(pw.Page(
          pageFormat: PdfPageFormat.a4,
          build: (pw.Context contex) {
            return  pw.Image(image,fit:pw.BoxFit.fill);//pw.Container(


                //child:
                    //pw.Image(image,fit:pw.BoxFit.fill));
          }));

问题是我想让图片满足所有的pdf页面。

但它看起来像这样:

边缘有空格。

【问题讨论】:

    标签: flutter flutter-plugin


    【解决方案1】:

    我使用了 FullPage,它成功了。

     pdf.addPage(pw.Page(
                  pageFormat: PdfPageFormat.a4,
                  build: (pw.Context contex) {
                    return pw.FullPage(
                        ignoreMargins: true,
                        child: pw.Image(image,fit: pw.BoxFit.fill),
                      );
                    //pw.Container(
        
        
                        //child:
                            //pw.Image(image,fit:pw.BoxFit.fill));
                  }));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-10
      • 2013-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-13
      • 1970-01-01
      相关资源
      最近更新 更多