Free Support Forum - aspose.com

PDF copies multiply when printing duplex

I'm using the PDFViewer to print PDF files in a .Net application. My printing preferences (in Conrol Panel) are set to duplex for the printer. If I print a 3 copies of a 1 page PDF file it prints perfectly. If I print 3 copies of a 2 page PDF file, then it print 9 copies (each one is duplexed). When I look in Print Manager, I can see it spooling 9 copies of the PDF. Why is it doing that?

I set my printing preferences to not duplex. Printed the same pdf, and it printed 3 copies (no duplexed, of course).

Following is the code I'm using to print the files:

public void PrintPdf(string filepath, string printer, int copies)

{

PdfViewer viewer = new PdfViewer();

viewer.Resolution = 600;

viewer.OpenPdfFile(filepath);

viewer.PrintPageDialog = false;

PrinterSettings printerSettings = new PrinterSettings();

printerSettings.Copies = Convert.ToInt16(copies);

viewer.PrintDocumentWithSettings(printerSettings);

viewer.ClosePdfFile();

}

Any help would be appreciated.

Marty

Hi Marty,

I am working over this query and will get back to you soon. We are sorry for this inconvenience.

Just wanted to check on the status. Have you found a workaround of solution to my problem?

Hi Marty,

Thanks for your patience. I have tried reproducing the issue using Aspose.Pdf for .NET 6.2.0 and I have been unable to reproduce the issue. In fact I could not find the option to set the printer preferences to Duplix. I have used Microsoft XPS Document Writer to replicate the issue but I am still unable to do so. Can you please share some details so that we can again try replicating it in our environment. We apologize for the delay and inconvenience.

You probably have to be connected to a printer that is capable of printing duplex. Then you would would need to go into the printer setup for that printer and select Duplex.

I'm not sure if the Microsoft XPS Document Writer even supports duplex printing.

I'm using the PDFViewer class in the Aspose.PDF.Kit version 5.9.0, its the demo version that I downloaded. All that I'm trying to do is to print existing PDF files that are stored on the file server, but I need to print them duplex.

We also have a license to Aspose.PDF, version 3.9.0. Can I use that component to print existing PDF files?

Thanks,

Marty

Hi Marty,

Thanks for sharing the details. I am afraid you might not be able to print PDF documents using versions of Aspose.Pdf for .NET released earlier to v6.0.0 (Merged API). However you may try using the latest release version of Aspose.Pdf for .NET 6.2.0 and see if it can resolve your problem. Please visit the following links for information on