Duplex Mode print not work

aspose.png (27.2 KB)

Hi !
I have been struggling for a few days to print on both sides with the Aspose.PDF module.
I tried all the known variants and I can’t understand where I’m wrong.

I used other printing components that are functional, but Aspose.PDF does not want …

Can you help me ?

    public void PrintingPDFHidePrintDialog(string vs_file)
    {
        // Create PdfViewer object
        PdfViewer viewer = new PdfViewer();

        // Open input PDF file
        viewer.BindPdf(vs_file);

        // Set attributes for printing
        viewer.AutoResize = true;         // Print the file with adjusted size
        viewer.AutoRotate = true;         // Print the file with adjusted rotation

        viewer.PrintPageDialog = false;   // Do not produce the page number dialog when printing

        // Create objects for printer and page settings and PrintDocument
        System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
        System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();

        ps.FromPage = 1;
        ps.ToPage = 3;
        ps.PrintRange = PrintRange.SomePages;
        // Set XPS/PDF printer name
        ps.PrinterName = cbx_imprimanta.Text;




        // Set PageSize (if required)
        pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);



        // Set PageMargins (if required)
        pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);


        if (ps.CanDuplex)
        {
            ps.Duplex = Duplex.Vertical;
            MessageBox.Show("Duplex.OK");
        }
        else
        {
            MessageBox.Show("No Duplex.Mode");
        }


        // Print document using printer and page settings
        viewer.PrintDocumentWithSettings(pgs, ps);

        // Close the PDF file after priting
        viewer.Close();
    }

@brenet

In case you are using old version of Aspose.PDF, we suggest you please upgrade to the latest version of Aspose.PDF for .NET 22.3 and let us know how it goes on your side.

If you still face problem, please attach your input PDF here for testing. We will investigate the issue and provide you more information on it.

about_system.png (41.0 KB)
multipage.pdf (180.6 KB)
Hi !
I am using the latest version 22.3, as the work project has 3 days, and I installed the components from Nuget.

Thanks

@brenet

We have logged this problem in our issue tracking system as PDFNET-51598. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.