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.

Wed Dec 07, 2016 2:36 am

Hi,

I would like to print a PdfDocument object to the middle tray (2), but when the below code runs the very first page always prints from the top tray (1) and then the following pages are printed from the middle tray (2). I've played around with the start/end page parameters but no luck. Not sure where i'm going wrong

Code: Select all
var loPaperSources = new List<PdfPaperSourceTray>();
var collections = doc.PrintDocument.PrinterSettings.PaperSources;
loPaperSources.Add(new PdfPaperSourceTray
{
      StartPage = 0,
      EndPage = doc.Pages.Count-1,
      PrintPaperSource = collections[2]//middle tray
});
doc.PageSettings.ListPaperSourceTray = loPaperSources;
doc.PrintDocument.Print();


Also is Spire capable of printing multiple PdfDocument objects in one batch while printing to multiple trays. i.e. Merge two documents together then print pages 1-2 from tray 1, print pages 3-4 from tray 2 then print page 5 from tray 1 again?

Thanks :D

Dylan_Spire
 
Posts: 18
Joined: Wed Jun 15, 2016 1:28 am

Wed Dec 07, 2016 6:04 am

Dear Dylan_Spire,

Thanks for your inquiry.
We will investigate the printer tray issue you mentioned, once there is any progress, we will inform you.
Also, here is a guide for merging files, you can merge the files and then print it.
http://www.e-iceblue.com/Tutorials/Spir ... -in-C.html

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Dec 14, 2016 1:49 pm

Hi Betsy,

I think I just face the same problem, seems the e-iceblue PdfOne.Net can't control the output tray for the very first page. (Startpage=0). Any idea?

ads.k

adsk
 
Posts: 1
Joined: Wed Dec 14, 2016 1:40 pm

Thu Dec 15, 2016 2:11 am

Dear ads.k,

Thanks for your inquiry.
We are investigating this issue, once there is any progress, we will notify you soon.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Dec 18, 2017 10:45 pm

Hi, I'm having the same issue, is there a fix?

I've tried everything I can think of, but Spire always prints page 1 from tray 1. This is a showstopper for our project.

Thanks in advance :)

doobiaus
 
Posts: 1
Joined: Mon Dec 18, 2017 10:36 pm

Tue Dec 19, 2017 2:55 am

Hello doobiaus,

Thanks for your inquiry.
We have made some progress on the feature. Please download the latest version(Spire.PDF Pack(Hot Fix) Version:3.9.538) and use the code below to have a try.
Code: Select all
            using(PdfDocument doc= new PdfDocument("inputfile.pdf"))
            {
                doc.PrintSettings.PaperSettings += delegate(object sender1, PdfPaperSettingsEventArgs ev)
                {
                    //eg.print page 1 and 2 to the second paper tray
                    if (1 <= ev.CurrentPaper && ev.CurrentPaper <= 2)
                    {
                        //CurrentPaperSource-> the current paper source on the printer.
                        //PaperSources-> the paper source trays that are available on the printer.
                        ev.CurrentPaperSource = ev.PaperSources[1];
                    }
                    else
                    {
                        //other papers on the first paper try
                        ev.CurrentPaperSource = ev.PaperSources[0];
                    }

                };
            }


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Dec 21, 2017 10:07 am

Hello,

Greetings from e-iceblue!
How is your issue now?
Your feedback will be greatly appreciated.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.PDF