We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Set Duplex Collate Printer Settings & Send Word Document for Printing using Aspose.Words Print Document C# Class

Hello expert,

When I using AsposeWordsPrintDocument method to print document is inconsistent with the word print, the follow is sample code,

var doc =new Document(“c:\test.docx”);

PrinterSettings ps = new PrinterSettings();
ps.Copies = 1;
ps.PrinterName = “Send To OneNote 2016”;
ps.Collate = true;
ps.PrintRange = PrintRange.AllPages;
ps.DefaultPageSettings.Color = true;
ps.Duplex = Duplex.Vertical;
ps.DefaultPageSettings.PaperSize = “A3”;
ps.DefaultPageSettings.PrinterResolution.Kind = PrinterResolutionKind.High;

AsposeWordsPrintDocument awPrintDoc = new AsposeWordsPrintDocument(doc);
awPrintDoc.PrinterSettings = ps;
awPrintDoc.Print();

Notes: The document font style is “OpenDyslexic”, the print server has installed the OpenDyslexic font.

The original document test.zip (251.2 KB)

The obvious difference:
original: image.png (119.9 KB)
AsposeWordsPrintDocument render for print: image.png (107.2 KB)

Seeking your help!!!

@TommyZhou,

Please ZIP and attach the following font file here for further testing on our end:

  • OpenDyslexic

P.S. You can also upload the ZIP file to Dropbox and share the Download link here for testing.

The attachment is OpenDyslexic Font OpenDyslexic.zip (853.0 KB)

Research has found that the document contain some hidden text, when show the editing marksimage.png (43.6 KB) or checked the hidden text image.png (73.5 KB), the layout of document will consistent with AsposeWordsPrintDocument API Print .

But, when i use the follow method to set the hidden text, is not work for me
https://docs.aspose.com/display/wordsnet/Remove+Hidden+Text+from+Document
https://apireference.aspose.com/words/net/aspose.words/font/properties/hidden

so, I think there are two direction to resolve it
1 Set the document show hidden text
2 Don’t Print hidden text when use AsposeWordsPrintDocument API

@TommyZhou,

We tested the scenario and have managed to reproduce the same problems on our end. For the sake of corrections, we have logged the following issues in our issue tracking system.

WORDSNET-20359: Diagram of heart pushed to next page in rendered document
WORDSNET-20360: Table (at 6th page) height increased in rendered document

We will further look into the details of these issues and will keep you updated on the status. We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-20360,WORDSNET-20359) have been fixed in this Aspose.Words for .NET 20.7 update and this Aspose.Words for Java 20.7 update.