We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Silent printing generated word documents

Thread ID:

Created:

Updated:

Platform:

Replies:

119066 May 8,2015 02:28 AM May 21,2015 01:00 AM Windows Forms 5
loading
Tags: DocIO
Igor
Asked On May 8, 2015 02:28 AM

Hi,

I am working on a class library which generates invoices using DocIO and I want to print such generated word documents on a default printer, without any user intervention.
The complete solution is running on the windows server as an win app scheduled to run in predefined intervals.

But, I am a little confused about the DocIO ability to print word documents silently.
I have found info on this forum, that:
1) DocIO can't print a word document
2) It can print with the Syncfusion.DLS.Rendering.DLSViewer (but the info is from 2006 and I've got errors trying to run it)
3) It can print PDF files with PDFViewer (couldn't find a working sample)

So, my question is: Is it possible to print a generated document (or pdf, doesn't matter) directly to the default printer, without any print dialogs, any user intervention?
Any working samples?


Sathish K [Syncfusion]
Replied On May 11, 2015 02:13 AM

Hi Igor,

Thank you for your interest in Syncfusion products.

Essential DocIO lets you to convert the Word document as Image and print the generated images using silent printing by default printer settings, page settings and print the document by invoking the PrintDocument.Print method. Please find the sample for this from below link and let us know if this helps you.

Sample link:
Sample

Please let us know if you have any other questions.

Regards,
Sathish


Igor
Replied On May 18, 2015 04:37 AM

Hi Sathish,

Thanks for your reply and a sample.
Will try it and let you know the outcome.

Kind regards,
Igor

Ayswarya Krishna Kumar [Syncfusion]
Replied On May 20, 2015 12:25 AM

Hi Igor,

Thank you for your update.

Yes, we will wait until we hear from you.

Let us know if you have any other questions.

Regards,

Ayswarya



Igor
Replied On May 20, 2015 01:00 AM

Hi Sathish,

Based on the sample, I have successfully managed to silently print my documents.
I have found another way to silently print, not using the PrintDialog which isn't available if you are building a class library dll (as I am).

Here is a code snippet:
public void PrintDocument( string fileName, string printerName )
{
    DocToImage(  fileName );
   
    PrintDocument printDoc = new PrintDocument();
    if (printerName != "")
        printDoc.PrinterSettings.PrinterName = printerName;
    printDoc.PrintPage += new PrintPageEventHandler( OnPrintPage );
    printDoc.Print();
}

Igor
 

Sathish K [Syncfusion]
Replied On May 21, 2015 01:00 AM

Hi Igor,

Thank you for your update and for your suggestion. Please let us know if you have any other questions. We will be happy to assist you as always.

Regards,
Sathish


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;