logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
MMJIM  
#1 Posted : Friday, June 25, 2021 9:36:10 AM(UTC)
MMJIM

Rank: Newbie

Groups: Registered
Joined: 6/25/2021(UTC)
Posts: 1
Saint Kitts And Nevis

Good afternoon.

I have a program in which i join several pdfs and send them to print in duplex mode.

Depending on the first page, i set it as duplex portrait or duplex landscape.

In two printers it works perfectly, but in another i cannot turn the first page correctly on the short edge. It always turn in the long edge.

It totally ignores me. All the combinations I have tried with the duplex and landscape attributes result in the same printing :(

This is my printing function:

Code:

	public static bool PrintPDF(string printer, string filename, Duplex duplexConfiguration)
	{
		try
		{                
			using (var document = Patagames.Pdf.Net.PdfDocument.Load(filename))
			{
				using (var printDocument = new Patagames.Pdf.Net.Controls.WinForms.PdfPrintDocument(document))
				{
					printDocument.AutoRotate = true;

					printDocument.PrinterSettings.PrinterName = printer;
					
					printDocument.PrinterSettings.Duplex = duplexConfiguration;
					printDocument.PrinterSettings.Collate = true;

					// Create our page settings for the paper size selected
					var pageSettings = new PageSettings(printDocument.PrinterSettings)
					{
						Margins = new Margins(0, 0, 0, 0),
					};

					pageSettings.Color = false;
					pageSettings.Landscape = true;

					printDocument.DefaultPageSettings = pageSettings;
					printDocument.PrintController = new StandardPrintController();
					printDocument.DocumentName = filename;

					printDocument.Print();
				}
			}
			return true;
		}
		catch (Exception ex)
		{
			return false;
		}
	}


I've tried to change landscape attribute in pageSettings, printDocument.DefaultPageSettings, printDocument.PrinterSettings.DefaultPageSettings....

Please, i'm going crazy.

Thank you very much!

Edited by user Friday, June 25, 2021 9:36:55 AM(UTC)  | Reason: Not specified

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.