Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.
Mon Jul 30, 2012 2:24 am
Is there any way to set the paper tray? I want to set the first page to tray 2 (letterhead) and the other pages to the default but there doesn't seem to be any such functionality.
If I import and modify a document with the correct tray settings, it gets lost as soon as I modify the doc.
Thanks
-
sean.cross
-
- Posts: 10
- Joined: Tue Apr 10, 2012 1:07 am
Mon Jul 30, 2012 6:08 am
Hi,
I am so sorry that our product doesn't support this feature at this stage. Thanks for your feedback.
Have a nice day!
Amy
e-iceblue support
-
amy.zhao
-
- Posts: 2766
- Joined: Wed Jun 27, 2012 8:50 am
Fri May 22, 2020 6:27 pm
Has this feature been added - to set a specific Paper Tray in Spire.Doc?
-
kkamper@gmail.com
-
- Posts: 2
- Joined: Tue May 10, 2016 7:30 pm
Mon May 25, 2020 2:26 am
Hi Kim,
Thanks for your inquiry.
Yes, this feature is now supported. Please refer to the following code. If you have further questions, just feel free to let us know.
- Code: Select all
private static void Print(string filename)
{
Document doc = new Document();
doc.LoadFromFile(filename);
PrinterSettings ps = new PrinterSettings();
//Set paper source
ps.DefaultPageSettings.PaperSource = GetPaperSource("Tray 1");
//Get the PrintDocument object
PrintDocument printDoc = doc.PrintDocument;
//Add the property PrintController to hide the print processing dialog
printDoc.PrintController = new StandardPrintController();
//Print the word document
printDoc.Print();
}
private static PaperSource GetPaperSource(string sorceName)
{
PaperSource pageSorce = new PaperSource();
PrinterSettings ps = new PrinterSettings();
for (int i = 0; i < ps.PaperSources.Count; i++)
{
if (ps.PaperSources[i].SourceName == sorceName)
{
return ps.PaperSources[i];
}
}
return null;
}
Sincerely,
Rachel
E-iceblue support team
-
rachel.lei
-
- Posts: 1571
- Joined: Tue Jul 09, 2019 2:22 am
Tue May 26, 2020 5:45 pm
Which version of Spire.Doc has this print feature - Standard? Pro?
-
kkamper@gmail.com
-
- Posts: 2
- Joined: Tue May 10, 2016 7:30 pm
Wed May 27, 2020 1:49 am
Hi Kim,
Thanks for your response.
Kindly note that our Spire.Doc Standard Edition doesn't support print. Please download our Pro Edition (the latest version is
Spire.Doc Pack(hot fix) Version:8.5.8) for testing.
If you have further questions, please feel free to let us know.
Sincerely,
Rachel
E-iceblue support team
-
rachel.lei
-
- Posts: 1571
- Joined: Tue Jul 09, 2019 2:22 am