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.
Printing to Network printer using UNC printer name
-
- Posts: 4
- Joined: Mon Nov 09 2009
Re: Printing to Network printer using UNC printer name
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.
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.