Printing from .Net web service

  • We are evaluating and our immediate need is for printing PDF from a .Net Web service. Here is sample code we have working in a console application.

    WPViewPDF.PDFViewer vwr = new WPViewPDF.PDFViewer();
    vwr.LoadFromFile(filename);
    // Use BeginPrint to set the printer
    vwr.BeginPrint(_printerName);
    vwr.EndPint();

    vwr.Print();

    In the Web Service if fails on LoadFromFile with a Win32Exception "Error creating window handle.". I'm guessing it is trying to create the Window for the viewer. Since this is web service, it can't.

    Is this a known issue? Is there a work around?

    • Offizieller Beitrag

    Hi,

    I actually didn't try to put in a service - it is designed to be a GUI tool.

    For printing only it will be better to use the the underlying engine directly using a call to the DLL. (A large insurance company is doing this already - with great success.)

    Unfortunately this API is not included in the current version of WPViewPDF - only in the SDK - please contact me by private mail for more info.

    Julian Ziersch