Windows Server 2012 R2 is preventing .NET Application print the file?

Home Forums Server Operating Systems Windows Server 2012 / 2012 R2 Windows Server 2012 R2 is preventing .NET Application print the file?

This topic contains 4 replies, has 4 voices, and was last updated by  arushi 7 months, 2 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts

  • TarcisioTh
    Member
    #167354

    I’m going through both scenarios:

    I have a C# .NET Framework [URL=”http://asp.net%29rest/”]ASP.NET[/URL] Rest API which saves a PDF file to the disk and sends it to Printer.

    • Locally, logged directly in Windows 10 64-Bit, getting succesful using Ghostscript 9.22 for Windows 32-Bit Driver and GhostScript.net library, sending a file to Network Printer and out of Network using AcrobatReader as a PDF file sender to the default printer.

    Sending TXT file to the shared Printer at Network, the file is printed. At this point using C# code that call printer without Third Party libraries:
    System.IO.File.Copy(filePath, “\” + printerIP + “” + printerName);[/CODE]
    [LIST]
    [*]Remotely, connecting to remote Windows Server 2012 R2 Machine using TeamViewer, failed in each: using Ghostscript, the API loops indefinitely and don’t responses my API Call. Using Acrobat Reader, the application behavior is correct (the process starts and wait for 10 seconds which is reasonable to print a file), without loops or application exceptions, but doesn’t print the file.
    [/LIST]
    Testing in Windows Server 2012 R2, targeting the real scenario of API Application which is called from a Tablet, remotely scenario is observed too.

    I noted the Acrobat Reader not open the file as happened in success scenario locally, using Windows 10.

    For the purpose, I disabled the Firewall and Antivirus to facilitate the analysis.

    At this moment I am searching for considerations to solve this problem, trying to make the printing PDF File work in Windows Server 2012 R2.

    Can anyone help me?[CODE]System.IO.File.Copy(filePath, “\” + printerIP + “” + printerName);[/CODE]

    • Remotely, connecting to remote Windows Server 2012 R2 Machine using TeamViewer, failed in each: using Ghostscript, the API loops indefinitely and don’t responses my API Call. Using Acrobat Reader, the application behavior is correct (the process starts and wait for 10 seconds which is reasonable to print a file), without loops or application exceptions, but doesn’t print the file.

    Testing in Windows Server 2012 R2, targeting the real scenario of API Application which is called from a Tablet, remotely scenario is observed too.

    I noted the Acrobat Reader not open the file as happened in success scenario locally, using Windows 10.

    For the purpose, I disabled the Firewall and Antivirus to facilitate the analysis.

    At this moment I am searching for considerations to solve this problem, trying to make the printing PDF File work in Windows Server 2012 R2.

    Can anyone help me?


    wullieb1
    Moderator
    #245725

    Have you installed .Net 3.5??


    DChamoun
    Member
    #391936

    Yes, i have installed .Net 3.5.


    DChamoun
    Member
    #391937

    The Microsoft Windows Security Architecture seems not allows Asp Net API to access COM devices as a Printer directly, without the use of Impersonation. Through using Third Party libraries and a local printer connected to Computer with a higher level of intranet user as IIS User, the system printed the file. The best answer ( source code implementation, in my opinion, clearly and reusable without great “refactory effort” at the point of my need ) was obtained developing a Windows Service Program (installed as Admin user which have access to COM devices) that watches a directory and sends your content to the printer using another program as Adobe Reader. The target Printer for my real scenario was an IP Printer, not a local Printer.


    arushi
    Member
    #392017

    ZetPDF.com works perfectly for me.

    Best regards

    Addison Ervis

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.