Using aspose words I save a docx as postscript.
The settings within the docx are auto for paper source.
So i expected the printer to use its default settings
in other words to print the first page from one paper tray
and subsequent pages from another tray
But all the pages are sourced from the same paper tray,
Any ideas?
Thanks
@peterbos
Please check the following code example. Hope this helps you.
Document doc = new Document("input.docx");
// Find the printer that will be used for printing this document. In this case it is the default printer.
// You can define a specific printer using PrinterName.
PrinterSettings settings = new PrinterSettings();
// The paper tray value stored in documents is completely printer specific. This means
// The code below resets all page tray values to use the current printers default tray.
// You can enumerate PrinterSettings.PaperSources to find the other valid paper tray values of the selected printer.
foreach (Section section in doc.Sections.OfType<Section>())
{
section.PageSetup.FirstPageTray = settings.DefaultPageSettings.PaperSource.RawKind;
section.PageSetup.OtherPagesTray = settings.DefaultPageSettings.PaperSource.RawKind;
}
Thank you for your quck reply.
I am sorry I was not clear in my original question.
I am not printing using Aspose printing.
I only use Aspose for converting the docx to postscript.
But it seems the paper tray settings are lost during the conversion
@peterbos
Unfortunately, Aspose.Words does not support the requested feature at the moment. However, we have logged this feature request as WORDSNET-19305 in our issue tracking system. You will be notified via this forum thread once this feature is available. We apologize for your inconvenience.
It would be great if you please ZIP and attach your input Word document and expected output PS file. Thanks for your cooperation.
Thank you again for you interest in my problem.
It is good to know that I am not doing something wrong.
I now understand that when the source tray settings in the document are auto and the document is printed through a printer driver, it is the driver that would use its defaults to create code to set the source tray.
How I solved my problem was to inject the postscript source tray setting code into the file created by Aspose; in effect providing what the printer driver would normally supply. Works great
@peterbos
It is nice to hear form you that your problem has been solved. Please let us know if you have any more queries related to Aspose.Words.