Printing with different PaperSource

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
Freund
User
Posts: 43
Joined: Fri Mar 16, 2018 9:51 am

Printing with different PaperSource

Post by Freund »

Hi,

I have to Print with different PaperSources.

The first Page have to be printed from source A (with paper with a company header)
The second and following have to be printed from source B (only with a small logo)
And when copies are used, they have to come vrom a papersource with white paper.


So I want to get something like

private void QueryPageSettings(object sender, QueryPageSettingsEventArgs e)
{
if (reportProperties.kopie)
if ((reportProperties.schachtSeite1BeiKopie) && (m_currentPageIndex == 0))
e.PageSettings.PaperSource = reportProperties.schachtSeite1;
else
e.PageSettings.PaperSource = reportProperties.schacht2;
else if (m_currentPageIndex == 0)
e.PageSettings.PaperSource = reportProperties.schachtSeite1;
else
e.PageSettings.PaperSource = reportProperties.schacht1;
m_currentPage++;
}

Is this possible?

Regards,
Christian Freund
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Printing with different PaperSource

Post by Sasha - Tracker Dev Team »

Hello Freund,

Do you mean you want to switch between the two physical printers that you have?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Freund
User
Posts: 43
Joined: Fri Mar 16, 2018 9:51 am

Re: Printing with different PaperSource

Post by Freund »

No, its ony the paperource (tray) in the printer.

This more code from my other project.

Code: Select all

public void Print()
{ 
	PrintDocument printDoc = new PrintDocument();

	printDoc.PrintController = new StandardPrintController();
	printDoc.Dispose();
	string printer;
	printer = printDoc.PrinterSettings.PrinterName;
	printDoc.PrinterSettings.PrinterName = reportProperties.printerName;
		
	printDoc.DefaultPageSettings.Landscape = reportProperties.GetLandscape();
	if (reportProperties.schacht1 != null)
		 printDoc.DefaultPageSettings.PaperSource = reportProperties.schacht1;
	if (printDoc.PrinterSettings.CanDuplex & reportProperties.duplexdruck)
	{
		 printDoc.PrinterSettings.Duplex = reportProperties.duplex;
	}

	if (reportProperties.farbe > 0)
		 if (printDoc.PrinterSettings.SupportsColor)
			  printDoc.PrinterSettings.DefaultPageSettings.Color = reportProperties.farbe == 1;


	printDoc.PrintPage += new PrintPageEventHandler(printPage);
	printDoc.QueryPageSettings += new QueryPageSettingsEventHandler(QueryPageSettings);
	printDoc.DocumentName = reportProperties.printDocName;
	
	
	.......
	
	printDoc.Print();
}
		
private void printPage(object sender, PrintPageEventArgs ev)
{
	Metafile pageImage = new
	Metafile(m_streams[m_currentPageIndex]);
	// Adjust rectangular area with printer margins.
	Rectangle adjustedRect = new Rectangle(
		 ev.PageBounds.Left - (int)ev.PageSettings.HardMarginX,
		 ev.PageBounds.Top - (int)ev.PageSettings.HardMarginY,
		 ev.PageBounds.Width,
		 ev.PageBounds.Height);

	// Draw a white background for the report
	ev.Graphics.FillRectangle(Brushes.White, adjustedRect);

	// Draw the report content
	ev.Graphics.DrawImage(pageImage, adjustedRect);
	m_currentPageIndex++;
	ev.HasMorePages = (m_currentPageIndex < m_streams.Count);
}
private void QueryPageSettings(object sender, QueryPageSettingsEventArgs e)
{
	if (reportProperties.kopie)
		 if ((reportProperties.schachtSeite1BeiKopie) && (m_currentPageIndex == 0))
			  e.PageSettings.PaperSource = reportProperties.schachtSeite1;
		 else
			  e.PageSettings.PaperSource = reportProperties.schacht2;
	else if (m_currentPageIndex == 0)
		 e.PageSettings.PaperSource = reportProperties.schachtSeite1;
	else
		 e.PageSettings.PaperSource = reportProperties.schacht1;
	m_currentPage++;
}
        
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Printing with different PaperSource

Post by Sasha - Tracker Dev Team »

Hello Freund,

Can you do that in the End-User Editor? If so, please make a screenshot of the desired option.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Freund
User
Posts: 43
Joined: Fri Mar 16, 2018 9:51 am

Re: Printing with different PaperSource

Post by Freund »

No,

I cannot, but I vave to use different trays in one printjob.


Christian
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Printing with different PaperSource

Post by Sasha - Tracker Dev Team »

Hello Freund,

If you can't change this option from the End-User Editor, I'm afraid that it's not available through the SDK.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply