I copied this code from sample:
// Create PdfViewer object
PdfViewer viewer = new PdfViewer();
// Open input PDF file
viewer.BindPdf(InputFile);
// Set attributes for printing
viewer.AutoResize = true; // Print the file with adjusted size
viewer.AutoRotate = true; // Print the file with adjusted rotation
// Create objects for printer and page settings and PrintDocument
System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings
{
// Set PageSize (if required)
PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169),
// Set PageMargins (if required)
Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0)
};
System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog();
if (printDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
// Document printing code goes here
// Print document using printer and page settings
System.Drawing.Printing.PrinterSettings ps = printDialog.PrinterSettings;
viewer.PrintDocumentWithSettings(pgs, ps);
}
// Close the PDF file after priting
viewer.Close();
It is erroring out on the viewer.PrintDocumentWithSettings(pgs, ps);
Cannot convert from System.Drawing.Printing.PageSettings to Aspose.pdf.Printing.PageSettings.
I grabbed Aspose.pdf from nuget and installed version 24.2.0. Do I have the correct version for the code sample?