Printing Documents using C# scripts

I am building a document from a pre-defined template and need to be able to save the document and then print it to a specified printer. I am using C# script to create the code (I am not a C# programmer!!), as shown below, and I am unable to get the printing part of the code to compile. Can I get some assistance or is there a manual I can view? Kind regards, Steve H.

using System;
using AWDotNetController;
using System.Collections.Generic;
using System.Text;
using Aspose.Words;
using Aspose.Words.Viewer;
namespace GenerateDocumentUsingAspose
    public class GenerateDoc
        public void LBAMainDoc(ScriptParameters sp)
            string Defendant_No = (string)sp.InputVariables["cDEFENDANT_NO"];
            string Title = (string)sp.InputVariables["cTITLE"];
            string Forename = (string)sp.InputVariables["cFORENAME"];
            string Middle_Name = (string)sp.InputVariables["cMIDDLE_NAME"];
            string Surname = (string)sp.InputVariables["cSURNAME"];
            string Address_Line1 = (string)sp.InputVariables["cADDRESS_LINE1"];
            string Address_Line2 = (string)sp.InputVariables["cADDRESS_LINE2"];
            string Address_Line3 = (string)sp.InputVariables["cADDRESS_LINE3"];
            string Address_Line4 = (string)sp.InputVariables["cADDRESS_LINE4"];
            string Postcode = (string)sp.InputVariables["cPOSTCODE"];
            string Client_ID = (string)sp.InputVariables["cCLIENT_ID"];
            string Client_Name = (string)sp.InputVariables["cCLIENT_NAME"];
            string Cosignor_Forename = (string)sp.InputVariables["cCOSIGNOR_FORENAME"];
            string Cosignor_Middle_Name = (string)sp.InputVariables["cCOSIGNOR_MIDDLE_NAME"];
            string Cosignor_Surname = (string)sp.InputVariables["cCOSIGNOR_SURNAME"];
            decimal Current_Balance = (decimal)sp.InputVariables["cCURRENT_BALANCE"];
            string DocName = (string)"Q:\\" + Client_ID + "\\" + Defendant_No + "\\LBAMain.doc";
            Document doc = new Document("D:\\Litigation\\Templates\\Letters\\LBA.doc");
            new string[] { "Field 1", "Field 2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field 10", "Field11", "Field3", "Field4", "Field5", "Field12", "Field13", "Field14", "Field17" },
            new object[] { Defendant_No, Title, Forename, Middle_Name, Surname, Address_Line1, Address_Line2, Address_Line3, Address_Line4, Postcode, Client_Name, Forename, Middle_Name, Surname, Cosignor_Forename, Cosignor_Middle_Name, Cosignor_Surname, Current_Balance });

The lines


are incorrect.
Try to use the following lines instead:

DocumentRenderer renderer = new DocumentRenderer(doc);
renderer.PrinterSettings.PrinterName = “HP9mclarke”;

Please note, however, that printing capability in Aspose.Words is in beta and very raw. We don’t guarantee printing quality to be good or even fail-safe. You can use it on your own risk. We are working on a better printing functionality now and will hopefully release it later this year.
Best regards,

Thanks for the reply. I am a little concerned however, as to when this functionality is likely to be available. I have been routing through various other threads on this forum and noticed that this was scheduled for April 2006 and you are now stating later this year. We were recomended this product and I feel more than a little disappointed!
Kind regards
Steve H

Sorry, the printing capability is not available yet. It was never included in our official feature list and I cannot promise that it will be ready by any specific deadline. We are just working on it and working hard. And will hopefully release it later this year.
Thanks for understanding,

We are happy to tell you that the new Rendering Engine has replaced the “old Viewer Beta”. The Rendering Engine can print, save as images or draw onto .NET Graphics object any document page.

Please see Aspose.Words documentation to learn more about new features.

Saving to image

In additional, new Rendering engine allows you to convert Word document to PDF directly (without using Aspose.Pdf).

Saving to Pdf

The latest version of Aspose.Words is available for download from downloads section or from NuGet