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;
    p.Start();

    p.WaitForInputIdle();
    System.Threading.Thread.Sleep(3000);
    if (p.CloseMainWindow() == false)
    {
    p.Kill();
    }

    -------------------------------------------------------
    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
    Hi,

    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.

    Thanks,
    Mani

  • #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
    chirag.madhani@yahoo.com

  • #769435
    Hi,

    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