Some of the images are not showing while I generate pdf from list of images.

for (var i = 0; i < exteriorImageList.length; i++) {

      PdfBitmap x =

          PdfBitmap(File(exteriorImageList[i].path).readAsBytesSync());

      double imgh = x.height.toDouble();

      double imgw = x.width.toDouble();


      document.pageSettings.orientation = PdfPageOrientation.landscape;

      if (imgw > imgh) {

        print("land EX");


        document.pageSettings.orientation = PdfPageOrientation.landscape;

        final page = document.pages.add();

        page.graphics.drawImage(

          PdfBitmap(File(exteriorImageList[i].path).readAsBytesSync()),

          Rect.fromLTWH(

              0, 0, page.getClientSize().width, page.getClientSize().height),

        );

      } else {

        print("port EX");

        //document.pageSettings.orientation = PdfPageOrientation.portrait;

        final page = document.pages.add();

        page.graphics.drawImage(

          PdfBitmap(File(exteriorImageList[i].path).readAsBytesSync()),

          Rect.fromLTWH(0, 0, page.graphics.clientSize.width,

              page.graphics.clientSize.height),

        );

      }

    }


1 Reply

GK Gowthamraj Kumar Syncfusion Team September 6, 2022 11:44 AM UTC

Hi Smith,


We suspect that the problem may occur only in particular input images specific. We request you to share the input images, complete code snippet, product version, and output document to check this on our end. So, it will be helpful for us to analyze and assist you further on this. 


Regards,

Gowthamraj K


Loader.
Up arrow icon