Hello,
Using GroupDocs Viewer 19.9, we are using CellsOptions.RenderPrintAreaOnly to render the print area of our file. It is working fine, but we would like to upgrade this, by breaking this print area into several pages, as Excel would do when printing the file.
We tried with the lastest stable version, that is to say 23.1 at the moment, the function SpreadsheetOptions.ForRenderingByPageBreak(), which is quite useful to render by page break, but sadly it renders the entire sheet, which is not something we want.
So, is there at the moment any easy way to render a Excel file by page break, and to only render the print area ? That is to say by using a single function, or to adjust a few options. If not, is it an option that may be implemented in future releases ?
Thank you in advance for your answers,
@Alix_GarotAdrian
Thank you for the detailed explanation of the feature you need. I have scheduled the investigation and will update you about the results.
@Alix_GarotAdrian
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): VIEWERNET-4289
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
1 Like
@Alix_GarotAdrian
This feature has been added in GroupDocs.Viewer for .NET 23.10. The following code examples show how to use this feature.
Example 1: Render by page breaks to PDF
using (var viewer = new Viewer("products.xlsx"))
{
var viewOptions = new PdfViewOptions("output.pdf");
viewOptions.SpreadsheetOptions = SpreadsheetOptions.ForRenderingPrintAreaAndPageBreaks();
viewer.View(viewOptions);
}
Example 2: Render by page breaks to HTML
using (var viewer = new Viewer("products.xlsx"))
{
HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources("page_{0}.html");
viewOptions.SpreadsheetOptions = SpreadsheetOptions.ForRenderingPrintAreaAndPageBreaks();
viewer.View(viewOptions);
}
Please let us know if you have any questions.