I was very enthusiastic about your
The code seems straightforward enough. Do I need an actual license key to work with the demo? Other than pathing to the dll and the printer name I have changed nothing in your code example. However neither this code nor your compiled applications will print. The documentation with the demo is pretty skimpy and insufficient for me to be able to figure out what is going on, I am hoping the documentaiton in your licensed version is more comprehensive.
The code I've used is below, I get the same result with this that I do when I run your compiled apps. Always a return code of -4. Nothing more and nothing prints. I really want to use your solution if it can be made to actually work. Please help so I can present this to my superiors as a viable solution to our ing requirements.
public partial class Form1 : Form
private static string LicenseKey = null;
private static string PrintCommandTemplate = "pdfprint -$ \"[LicenseKey]\" -printer \"<PrinterName>\" \"<DocFullPath>\"";
public static extern int VeryPDF_PDFPrint(string CommandLine);
public static long PrintDoc(string FullDocumentName, string PrinterName)
string PrintCommand = PrintCommandTemplate;
if (LicenseKey != null)
PrintCommand = PrintCommand.Replace("[LicenseKey]", LicenseKey);
PrintCommand = PrintCommand.Replace("[LicenseKey]", "XXXXXXXXXXXXXXXX");
PrintCommand = PrintCommand.Replace("<PrinterName>", PrinterName).Replace("<DocFullPath>", FullDocumentName);
private void Form1_Load(object sender, EventArgs e)
private void button1_Click(object sender, EventArgs e)
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
string strPDFFile = (appPath + "\\readme.pdf");
//long nRet = PrintDoc(strPDFFile, "docPrint");
long nRet = PrintDoc(strPDFFile, "E1BO-XWC5687");
Please refer to following return codes,
int WINAPI VeryPDF_PDFPrint(LPCTSTR lpCommand)
0: Print PDF file successfully.
-10: PDFPrint Library is damaged.
-11: Something is wrong in the command line options.
-101: Can't start "spooler" service, please start "spooler" service from Service Manager by manual.
-4: Can't locate specify printer in this computer.
-12: Can't open specify printer.
-13: Something is wrong when set options to printer.
-5: No input PDF file for printing.
9: Password Required to open this PDF file.
Other values: Something is wrong during render PDF file.
"-4" is "Can't locate specify printer in this computer.", just for checking, do you have full control permission to "E1BO-XWC5687" printer in your system?
Also, we suggest you may download PDFPrint Command Line product from our website to try,
you can add -debug parameter to print the detailed log message, for example,
pdfprint.exe -debug -printer "E1BO-XWC5687" C:\test.pdf