Hi Nilofer,
Thank you for contacting Syncfusion support.
Regarding query related to setting Paper Size.
XlsIO has support for setting the page size using PaperSize property in IWorksheet.PageSetup. Even though when a different page size is set, while printing the document the page size is overridden by the page setting of printer which is chosen(This overriding behavior is seen in Microsoft Excel also).
Regarding query related to changing Active Printer
Currently, XlsIO does not have support to change active printer or printing a document, but as a workaround you can use the below code to print the XlsIO generated document to your desired printer( which already has the required ISO ID-1 paper size as its default one).
[DllImport("Winspool.drv")]
private static extern bool SetDefaultPrinter(string printerName);
static void Main(string[] args)
{
// Change the default printer to XPS Document Writer
SetDefaultPrinter("Microsoft XPS Document Writer");
//Print an Excel document
System.Diagnostics.Process pr = new System.Diagnostics.Process();
pr.StartInfo.Verb = "Print";
pr.StartInfo.FileName = "Sample.xls";
pr.Start();
} |
Please let us know if you any further queries.
Regards,
Kesavan