Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Jan 02, 2018 4:06 pm

Hi,
I'm trying to print the pdf file with some configured options like Collate, Duplex, PaperSource, PageSize and PrintInColor etc.
I have managed to set some of the values however struggling with the followings.
Collate
PaperSource
PrintInColor

Can someone please guide me how can I set the values in the print job settings.
Thanks in advance.

arshad
 
Posts: 3
Joined: Fri Sep 16, 2016 9:45 am

Wed Jan 03, 2018 2:49 am

Hello,

Thanks for your inquiry. Please refer to the below code snippet to set PaperSource.
Code: Select all
            doc.PrintSettings.PaperSettings += delegate(object sender, PdfPaperSettingsEventArgs e)
            {
                e.CurrentPaperSource = e.PaperSources[0];
            };

Regarding Collate and PrintInColor, we had added them as new features in our schedule. Once they are available, we will let you know.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Wed Jan 03, 2018 9:09 am

Hi Simon
Thanks for the response. This code sets to the 1st tray. I already got the PaperSource object from my Print Dialog so I need to set that value there. Do I need to loop thru and compare the name with selected tray name and assign that?
My other question is does it executes on every page printed?

arshad
 
Posts: 3
Joined: Fri Sep 16, 2016 9:45 am

Wed Jan 03, 2018 10:19 am

Hello,

Thanks for your feedback. Yes, it will execute on every page printed. Is the PaperSource object you mentioned a tray? If so and you want to use this tray for printing, you could choose it as below. If not, please share us with your code regarding how did you get the PaperSource object.
Code: Select all
            //Set PaperSource
            doc.PrintSettings.PaperSettings += delegate(object sender, PdfPaperSettingsEventArgs e)
            {
                foreach (PaperSource paperS in e.PaperSources)
                {               
                    if (paperS.SourceName==yourTrayName)
                    {
                        e.CurrentPaperSource = paperS;
                    }               
                }
            };


Best regards,
Simon
E-iceblue support team
Last edited by Simon.yang on Thu Jan 04, 2018 1:28 am, edited 1 time in total.
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Wed Jan 03, 2018 11:24 am

Hi Simon,
Yes I have the object of PaperSource and thanks for the code sample.

arshad
 
Posts: 3
Joined: Fri Sep 16, 2016 9:45 am

Mon Jan 08, 2018 7:48 am

Hello,

Glad to inform your that setting Collate is available now. Welcome to download Spire.PDF Pack(Hot Fix) Version:3.9.584.
Regarding setting PrintInColor, it can't not been accomplished in a short time. If there is any update, we will let you know.
Code: Select all
PdfDocument.PrintSettings.Collate = true;


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Wed Jan 10, 2018 3:05 am

Hello,

Greeting from E-iceblue.
Did you try the hotfix? Is new function working?
Your feedback will be greatly appreciated.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Return to Spire.PDF