Build 4.0.0.49 of xlsgen adds support for custom print paper sizes.
Currently, the PaperSize property of the
page setup interface in the xlsgen object model lets you select a paper size among roughly 40. But should one not be listed, you would be out of luck.
Thanks to a new property being introduced with this build, called PaperSizeForPrinter, a custom paper print size can be passed, used and stored in the Excel file. This property combines a printer (name) and a paper print size (such as "A8"). The reason of the association is because it does not make sense to try to use a custom paper print size if the printer does not support it. Indeed, when a printer is installed on a computer, it lists the paper print sizes it supports. Also xlsgen must map the user-friendly paper print size to the internal ID of the paper print size known by the printer.
Here is how to set the "A8" size to the printer "PDFCreator", a virtual printer for creating PDF files :
workbook->WorksheetByName[L"Sheet1"]->PageSetup->PaperSizeForPrinter[L"PDFCreator"] = L"A8";
If you'd rather not name the printer, and use the implicit name of the default printer, use :
workbook->WorksheetByName[L"Sheet1"]->PageSetup->PaperSizeForPrinter[L""] = L"A8";