General discussion

  • Creator
    Topic
  • #2259501

    How to print document through C# coding?

    Locked

    by rajkar001 ·

    Hi everybody,

    Can anybody tell me how to print a document throgh C# coding.
    I did using streamreader, but then document is not getting printed as it originally is.Bullets,styles,spaces are different in the print out from that in screen.

    then i tried using printdialog, but a blank page is getting printed or the path of document is getting printed instead of data in document.
    then i tried copying the document into a rich text box and printed it from there.

    I was able to get the printout as normal, but if the document is only of RTF , the coding is working.
    the coding fails 4 word documents,pdf documents,etc.

    => Is there any general coding to print any kind of document through C# .

    Actually i am developing an application where user when clicks ‘print’ button,it should be printed.user should not be given a chance to modify printer or page settings,etc.

    Thanks & Regards,
    Karthik

All Comments

Viewing 1 reply thread