Printing to Network printer using UNC printer name

The PDF Creator .NET Library enables you to create secure PDF documents on the fly and to view, print and process existing PDF documents. If you have any questions about PDF Creator .Net, please post them here.

Printing to Network printer using UNC printer name

Postby Goldcircle on Wed Nov 11 2009

We are using PDF creator .NET 4.0 to print to a network printer.
Unfortunately, the documentation is not clear on how to define the printer name.
It stated only to use the printername as a string such as this: document.Print("HP LaserJet 6L",false);.

I tried to use the printer share name and UNC name, but neither work.

I am using this code (where HPOfficePrinter is the share name of the printer:
doc.StartPrint("HPOfficePrinter", false);
During debugging, I get this error:
HPOfficePrinter The name 'HPOfficePrinter' does not exist in the current context


Can you clarify what are valid printer names and whether it is possible to print to a networked printer and how?
Thank you.
Goldcircle
 
Posts: 4
Joined: Mon Nov 09 2009

Re: Printing to Network printer using UNC printer name

Postby Goldcircle on Thu Nov 12 2009

After some research its seems the problem is caused by compiling as "Any CPU".
Specifically, if the applciation is compiled as "ANy CPU" the printer method no longer works.

I was able to get this working using the following steps:

1. Compile the application as target platform: "x86".
2. call printer method as follows: pdfCreator1.Document.Print("\\\\server1\\HPOfficePrinter", false);

In some cases, it also seems to work under "Any CPU". I have not tested further to try and troubleshoot the problem.

Does Amyuni have any plans to introduce a 100% managed code version of the PDF creator for .NET?

I see that Amyuni advertises a x64 version of the PDF Creator for .NET, but we have not seen it and the user in the other post said it did not work for them.
Is there a difference in the way Print method works in x86 and x64 versions?

Please advise how we can resolve this problem.
Goldcircle
 
Posts: 4
Joined: Mon Nov 09 2009


Return to Amyuni PDF Creator .NET (PDF Viewer / Editor)

Who is online

Users browsing this forum: No registered users and 3 guests