Hello,
We’re currently evaluating aspose.words for use in an ASP.NET
application, but there’s a feature that appears to be supported that I just can’t get to work right. I’d like to be able to make a word document with multiple sections and then set the appropriate paper tray for each section, the idea being that when the document is opened in Word and printed, that each section will be pulled from the correct tray. The code that I’m using in a test document to do this is:
Dim word_doc As New Aspose.Words.Document()
Dim word_builder As New Aspose.Words.DocumentBuilder(word\_doc)
word_builder.Writeln("This is the first line, in section 0")
word_builder.InsertBreak(Aspose.Words.BreakType.SectionBreakNewPage)
word_builder.Writeln("this is the first line, in section 1")
word_doc.Sections(0).PageSetup.FirstPageTray = Aspose.Words.PaperTray.MiddleBin
word_doc.Sections(1).PageSetup.FirstPageTray = Aspose.Words.PaperTray.LowerBin
word_doc.Save("results.doc", Aspose.Words.SaveFormat.Doc, Aspose.Words.SaveType.OpenInBrowser, Response)
When this new document is downloaded to my browser and opened in Word (not inside of a browser, Word itself), I can identify each section, and I can tell that the paper tray setting in “Page Setup” has been changed from the default, but it’s always “Automatically Select”, no matter which aspose.words.papertray value I set it to. The document created in my example above, when printed, is all printed from the same tray, even though I’m setting one section to MiddleBin and one to LowerBin (my printer does have multiple trays, and I’ve tried UpperBin as well, with the same result)
The aspose.words values appear to match the Word defaults for bin placement:
Value: | Name: |
---|---|
0 | wdPrinterDefaultBin |
1 | wdPrinterOnlyBin |
1 | wdPrinterUpperBin |
2 | wdPrinterLowerBin |
3 | wdPrinterMiddleBin |
4 | wdPrinterManualFeed |
5 | wdPrinterEnvelopeFeed |
6 | wdPrinterManualEnvelopeFeed |
7 | wdPrinterAutomaticSheetFeed |
8 | wdPrinterTractorFeed |
9 | wdPrinterSmallFormatBin |
10 | wdPrinterLargeFormatBin |
11 | wdPrinterLargeCapacityBin |
14 | wdPrinterPaperCassette |
15 | wdPrinterFormSource |
These values don’t appear to be valid for any printer driver that I have available, yet I can’t find out how (or if) I can make an aspose.words.papertray setting that I can use with my printer. Any ideas? I have made a word macro that can set the paper tray for each section (the values for my printer’s trays are 259 and 260, apparently), but I’d really rather not have to depend on macros for this sort of thing. Any ideas?
Bob