In Excel there is a nice option when saving Excel workbook to PDF called ‘Ignore print areas’,
Is there any property in Aspose object model which can be used, so the result of Workbook.Save(PdfPath, Aspose.Cells.SaveFormat.Pdf) will also ignore the print areas?
Thanks in advance.
Thanks for your posting and using Aspose.Cells.
Please use the following code to ignore the print area of the worksheet.
Worksheet.PageSetup.PrintArea = “”;
Thank you for suggestion.In general the approach works fine. But for some documents it doesn't work (like the one in attach)
What can I do wrong?
The code I am using:
Dim AsposeDocument As New Aspose.Cells.Workbook(fileName)
If AsposeDocument.Worksheets.Count > 0 _
AndAlso AsposeDocument.Worksheets.ActiveSheetIndex >= 0 Then
AsposeDocument.Worksheets(AsposeDocument.Worksheets.ActiveSheetIndex).PageSetup.PrintArea = ""
Thanks for the template file and sample code.
Please try our latest version/fix: Aspose.Cells for .NET v220.127.116.11
I have tested your scenario/ case using your template file and sample code with v18.104.22.168, it works fine. Your template file has 4 pages (in total) for the only worksheet in it (you may confirm this by taking print preview in MS Excel). The output PDF file (attached) has also 4 pages.
Let us know if there is still any issue.
Thanks a lot for reply. The latest Aspose Cells version really fixes the problem. I will apply it in our application.
Good to know that your issue is sorted out by the new fix/version. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.