Hi is it sufficient to set the Doocument PaperSize(assume that’s the PaperSize available from the Printer) in order to change/set the paper size using Aspose’s “Document.Print(PrinterSettings)”?.
Like the code snippet below:
public static void SetupPaperSize(Document doc, PaperSize pSize)
{
PaperSize defaultPaperSize = 0;
defaultPaperSize = doc.Sections[0].PageSetup.PaperSize;
foreach (Section section in doc.Sections)
{
defaultPaperSize = section.PageSetup.PaperSize;
section.PageSetup.PaperSize = pSize;
}
InfoLog.Info($" : Node : Paper size changed from {defaultPaperSize.ToString()} to {pSize.ToString()}");
}
How about the ‘DefaultPageSettings.PaperSize’ for the printerSettings passed to the Print method, is that need to be changed as well for the PaperSize change for Print. One thing I noticed is that PaperSize from Microsoft is taking a ’ System.Drawing.Printing’, which is different from Aspose’s PaperSize.
Thanks