The reason why there is no
PaperType.A1 is because these types are provided by printer drivers, not by file format’s specification.
Or to put this differently, if you have machines with different printer drivers you can end up creating an Excel file with “A0” paper type on one machine, but that same Excel file on another machine may have an unrecognised targeted paper type.
So in short, they are not universal, for Excel files they are driver dependent.
Anyway, you could iterate through your installed printers, check their supported paper types, create a
PrintTicket that specifies using it, and then assign that ticket to your file with
But I think that setting the custome type is easier, see the following:
var workbook = new ExcelFile();
var worksheet = workbook.Worksheets.Add("Sheet1");
var printTicket = new System.Printing.PrintTicket();
printTicket.PageMediaSize = new System.Printing.PageMediaSize(3500 , 2500);
// In that older version you need to use this:
worksheet.PrintOptions.PaperType = (PaperType)(-1);
// But in the newer versions you can use this instead:
//worksheet.PrintOptions.PaperType = PaperType.Custom;
I hope this helps.