You must Sign In to post a response.
  • Category: Visual Studio

    Print Works in Local and not in IIS

    Hello All,

    I am having an issue for printing pdf after hosting in local IIS. below is my code

    ProcessStartInfo info = new ProcessStartInfo();
    info.Verb = "print";
    info.UseShellExecute = true;
    info.LoadUserProfile = true;
    info.WorkingDirectory = currentPath;
    info.FileName = currentPath + "/" + "VisitorTabletPrint.pdf";
    info.CreateNoWindow = true;
    info.WindowStyle = ProcessWindowStyle.Hidden;

    Process p = new Process();
    p.StartInfo = info;

    if (p.CloseMainWindow() == false)

    Above code works fine in visual studio and it print the req document. but when host the same application in my local IIS, it is not printing the pdf and also not giving any error.

    I have tried many things like full access to IIS and also allow internet printing section for IIS, but not found anything. also gone through many links but no luck.

    Any help will be appreciated.
  • #769433

    When you host the application in IIS, the document print will be need the drive access to the store the information.
    I mean you have to give the permission to the folder or drive, so that it will save the document on the particular place.


  • #769434
    Hi Mani,

    It is not for saving purpose. the document is getting saved as PDF, now just need to send that document to printer to print.

    that is working fine with local VS IDE but issue occurs only with IIS hosting

    Chirag - 48
    Enjoy With Errors

  • #769435

    Have you checked the path you are receiving in to current path.
    Are you storing that pdf in local folder while using through visual studio?
    When hosted in IIS the path should be something like http://localhost/yourprojname/folder

    Sridhar Thota.
    Editor: DNS Forum.

  • Sign In to post your comments