I use viewer to view spreadsheet as pdf.
viewer.View(pdfViewOptions)
with spreadsheetOptions
I notice that we have in output file margins around spreadsheet data.
I not found any options to configure that.
Can I set these margins to another value (or disable it)?
I Use .NET 6 and GroupDocs.Viewer 22.11.0
@D04486411
Setting margins is not supported at the moment. This feature may be added in future versions of GroupDocs.Viewer. I have planned this feature for investigation in our internal bug tracker. The feature ID is VIEWERNET-4212.
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-4212
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.
@D04486411
This feature was added in GroupDocs.Viewer for .NET 23.4. The package is available at
You can use the following code to set margins in the output PDF
using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
// ...
using (var viewer = new Viewer("invoice.xlsx"))
{
var viewOptions = new PdfViewOptions();
// Set margins for worksheets in the output pdf pages
viewOptions.SpreadsheetOptions.LeftMargin = 0;
viewOptions.SpreadsheetOptions.RightMargin = 0.5;
viewOptions.SpreadsheetOptions.TopMargin = 1;
viewOptions.SpreadsheetOptions.BottomMargin = -10; // set to default value
viewer.View(viewOptions);
}
Have a nice day!