Picture in Spreed Sheet won't be rendered when rendering as PDF

Hello,

Pictures in excel file won’t be rendered if rendering as PDF. But render as PNG is OK.

groupdocs-viewer:24.8
Java 21

the following attachment could be used to reproduce this problem.
spread sheet with picture.zip (448.8 KB)

Testing codes:

package com.groupdocs.viewer.examples;

import com.groupdocs.viewer.Viewer;
import com.groupdocs.viewer.options.PdfViewOptions;
import com.groupdocs.viewer.options.PngViewOptions;

public class SpreedSheetWithPictureTest {
    public static void main(String[] args) {
        // TODO need to change the path of excel file
        String path = "C:\\Work\\Doc\\dms\\spread sheet with picture.xls";

        // render as PNG, picture will be presented in the output, it is OK.
        {
            PngViewOptions viewOptions = new PngViewOptions();
            viewOptions.setMaxWidth(1024);
            viewOptions.getSpreadsheetOptions().setRenderGridLines(true);

            try (Viewer viewer = new Viewer(path)) {
                viewer.view(viewOptions);
            }
        }

        // FIXME render as PDF, picture won't be presented in the output
        {
            PdfViewOptions viewOptions = new PdfViewOptions();
            viewOptions.getSpreadsheetOptions().setRenderGridLines(true);

            try (Viewer viewer = new Viewer(path)) {
                viewer.view(viewOptions);
            }
        }
    }
}

Thanks & Regards
Aray

@ArayCN

Thank you for reporting this issue. I have reproduced it. We’ll investigate it an update you. As a workaround you can try rendering a complete worksheet with the following options set:

 // TODO need to change the path of excel file
 String path = "spread sheet with picture.xls";
 
 {
     PngViewOptions viewOptions = new PngViewOptions();
     viewOptions.setSpreadsheetOptions(SpreadsheetOptions.forOnePagePerSheet());
     viewOptions.getSpreadsheetOptions().setRenderGridLines(true);
 
     try (Viewer viewer = new Viewer(path)) {
         viewer.view(viewOptions);
     }
 }
 
 {
     PdfViewOptions viewOptions = new PdfViewOptions();
     viewOptions.setSpreadsheetOptions(SpreadsheetOptions.forOnePagePerSheet());
     viewOptions.getSpreadsheetOptions().setRenderGridLines(true);
 
     try (Viewer viewer = new Viewer(path)) {
         viewer.view(viewOptions);
     }
 }

The expected output is going to be the following:

The issue ID for reference is VIEWERJAVA-3721.