Free Support Forum - aspose.com

Insertion of extra Space in the exported pdf

Hello Aspose Team,

We are facing a issue in the export of the attached template. The template itself is fine as there are 3 extra lines between the end of the data and the bottom of page. However, the equivalent of 6 lines is being added when exported and the Template bleeds to second page by 3 lines . Please look at into this issue.

Sample Code:

    FileInputStream io = new FileInputStream(new File("/home/asthapa/Pa-front/project/exportCheck/ReportTemplates/coverageCode.xlsx"));

    Workbook workbook = new Workbook(io);
    workbook.calculateFormula();
    for (int m = 0; m < workbook.getWorksheets().getCount(); m++) {
        workbook.getWorksheets().get(m).getShapes().updateSelectedValue();
    }
    //Removes excess blank page. Can be replicated without the following loop code.
    for (int j = 0; j < workbook.getWorksheets().getCount(); j++) {
        if (shouldExclude(workbook.getWorksheets().get(j).getName())) {
            workbook.getWorksheets().get(j).setVisible(false);
        } else {
            removeBlankRowsAndColumns(workbook.getWorksheets().get(j));
        }
    }
    workbook.save("output.pdf");

sampleTemplate.zip (37.5 KB)

Thanks,
Astha

@aasthapa

We have moved this post to Aspose.Cells forum where you will be assisted shortly.

@aasthapa,
I have created the output Pdf file without the loop code but there are many pages including the blank ones. Could you please share screenshots and page numbers for the problem, for our analysis.
output.pdf (98.5 KB)

The issue exists in the second last and last page where the template is bleeding from second last to the last page.

Here is the screenshot. issuePage.png (27.1 KB)

Here is also the final pdf output when the second loop is executed. output.pdf (63.0 KB)

Thanks,
Astha

@aasthapa,
I have converted the template file to PDF using MS Excel but couldn’t observe this issue when compared with the output file created by Aspose.Cells. Could you please identify the issue by comparing the PDF file generated by MS Excel and output by Aspose.Cells?
Comparison.png (605.7 KB)