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

Free Support Forum - aspose.com

Send orignal docx document to virtual printer (print driver)

I am trying to use Aspose.Words.NET (v9.1.0.0) in a print spooler service that sends Word docx documents to a virtual printer (Neopost printer driver). The docx files (sample attached) contain embedded field codes for the Neopost driver which tell it for example which header to use, e.g.

##Instructions

##HEADER: MIN02
##METHOD: Post
##PRINTER: PRINTER01
##RECIPIENT: Sirs

The Neopost print driver updates the document based on these codes before sending it to a physical printer. Neopost therefore needs the document in the original docx format in order to interpret the field codes and not a binary print format.

Is it possible to use the Aspose print method Aspose.Words.Document.Print to send the original docx document to the virtual NeoPost printer, e.g.

Aspose.Words.Document document = new Aspose.Words.Document("C:\\Test\\Ltr.docx");
document.Print("NeoPostBulkPrinter");

We have found that the document has been converted to a binary print format when it gets to the Neopost print driver so they are unable to read the field codes.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your interest in Aspose.Words. When you call Print method, Aspose.Words renders the document and sends it to the specified printer in binary print format.

Maybe as a workaround, you can replace these placeholders using Aspose.Words before printing. In this case, you will be able to get rid using a virtual printer and directly send document to the physical printer.

Best regards.

Unfortunately this is not an option as Neopost does a lot more than field substutions, eg it routes to physical printers or email; includes standard enclosures; and uses appropriate stationary.

Is there no other way of doing this with Aspose.Words, eg specifying no rendering?

We are aslo awaiting the latest patch to fix XPS printing (raised in separate post). Is this mechanism likely to support unrendered docs? When is this patch likely?

Thanks.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Unfortunately, you cannot specify “no rendering” upon printing.

By the way, regarding XPS printing, I suppose you mean the problem described in this thread:

This problem is already resolved in the latest version of Aspose.Words. you can download the latest version from here:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

In case of using XPS printing, Aspose.Words converts the document to XPS and then sends it to XPS printer. I suppose you can try using the same technique in your case, i.e. convert your document to DOCX using Aspose.Words and then use your own code to send this document to your virtual printer. You can learn more about printing via XPS here:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-print-a-document-on-a-server-via-the-xpsprint-api.html

Best regards.

Thanks for this.

I will download v9.2.0.0 of Aspose.Words and try a similar approach to the XPS printing example for sending the docx document to the virtual server.