Buttons in Excel-Worksheet are missing after PDF convertion

Hello,

some buttons in a Excel worksheet disappear when it is converted. The buttons in the second sheet are visible in the PDF, the buttons an the third sheet not.
I won’t include my code as it also happens when I use the online demo app of the Aspose site to convert the file to PDF.
Can you recommend a workaround?

Kind regards,
Bea
ExcelTest_xlsx.zip (217.5 KB)

@bea.grosse-venhaus,

Thanks for the sample XLSX file.

Please notice, I am able to reproduce the issue as you mentioned by converting your template Excel file to PDF file format. I found buttons in Excel worksheet are missing in Excel to PDF conversion. The buttons in the second sheet are visible in the PDF but the buttons in the third sheet are not shown in the output PDF. I have logged a ticket with an id “CELLSNET-52356” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

Thank you, @Amjad_Sahi, for the fast reply!

@bea.grosse-venhaus,

After further evaluation of your issue we found it is not an issue with the APIs. Please open your Excel XLSX file into MS Excel, take the print preview of the third sheet manually and you will notice MS Excel also does not print/show the two buttons. For confirmation (that the button will not be rendered), right click on any button, click Format Shape option and then select Size & Properties icon. You will find that “Print object” option is not selected. Once you select/check it and then take the print preview of the sheet, you will notice the button is shown. So, either you may check “Print object” option for the two buttons/shapes or set Shape.IsPrintable Boolean attribute to “true” in code (dynamically) via Aspose.Cells APIs. See the following sample code that you may try for your reference. I have tested with the following sample code and the buttons are shown in the output PDF:
e.g.
Sample code:

Workbook workbook = new Workbook("e:\\test2\\ExcelTest_xlsx.xlsx");
//Get the third worksheet
Worksheet worksheet = workbook.Worksheets[2];
foreach (Shape shape in worksheet.Shapes)
{
    if (shape.IsPrintable == false)
    {
        shape.IsPrintable = true;
    }
}

workbook.Save("e:\\test2\\out1.pdf"); 

Let us know if you still have any issue.

Thank you very much for your feedback. I wasn’t aware of this Excel feature.

Kind regards,
Bea

@bea.grosse-venhaus,

You are welcome.