Error/Exit Codes when call PDF Print from C# source code

Hello,

Right now I'm getting some random errors (exit error codes) different from zero (when I get the Exit Code Zero (0) all the sheets are printed correctly.

I'm calling the pdfprint.exe from a C# application. With the detailed parameters as I show you in the Case 1 or Case 2.

So I don't know if there's any list for those Exit Codes , and then try to find out if... for example, I get an Exit Code 11 the problem is "the network" , or "the pdf file" , "or the print spool", etc, The effect for instance for the ExitCode 11 is that the PDF file has 19 pages, only 6 where printed and the 7th page was partially printed.

We have the licensed version of this Application and this is the code for the register:

pdfprint.exe "-$" "XXXXXXXXXXXXXXXXXXXXXXX"

Case 1:

-printer \\MyPrinter \\FileServer\1308071540575498239000-EDIWIN4-EDIWIN-REPORT-FILE-SVD000317AH4-FC02923.pdf -copies 1 -nochgprinter
Exit Code [11]
Output: Thank you for choosing our product.

Exit Code [11] Output:
Thank you for choosing our product.
Printing '\\FileServer\1308071540575498239000-EDIWIN4-EDIWIN-REPORT-FILE-SVD000317AH4-FC02923.pdf' file...
Printing 1 page...
Printing 2 page...
Time of printing is: 7000ms(7.00s)

Case 2:

-printer \\MyPrinter
\\FileServer\1308071445374196515000-EDIWIN4-EDIWIN-REPORT-FILE-SVD000317AH4-FA63942.pdf
-copies 1 -nochgprinter
Exit Code [11]
Output: [Thank you for choosing our product.
Printing
'\\FileServer\1308071445374196515000-EDIWIN4-EDIWIN-REPORT-FILE-SVD000317AH4-FA63942.pdf'
file...
Printing 1 page...
Printing 2 page...
Printing 3 page...
Printing 4 page...
Printing 5 page...
Printing 6 page...
Printing 7 page...
Time of printing is: 8671ms(8.67s)

This is the version of the app:

VeryPDF PDFPrint v2.0
Web: https://www.verypdf.com
Email: support@verypdf.com
Build: Mar 5 2009

Customer
----------------------------------------------------
Thanks for your message, please refer to the return code of PDFPrint Command Line application at below,

Return values:
   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.

VeryPDF
----------------------------------------------------
Thank you for the information. Another question... I'm using the same service (with the same configuration). All the times.

This service switches between printers based on the content of the PDF. (There are a lot of print requests at the same time, some times 5, some times 30).

But in some cases (on the same printer with the same configuration) I got the errors:

-13, 11 , 1.

Why the following errors occurs:
"-13: Something is wrong when set options to printer."
" 11: Something is wrong in the command line options."
"1: ???" 

Customer
----------------------------------------------------
The source code for this (C#):
proc.StartInfo.FileName = @"C:\pdfprint_cmd\pdfprint.exe";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.CreateNoWindow = true;
string strArguments = "";
strArguments += "-printer ";
strArguments += " " + SPrinter + " " + document;
strArguments += " " + "-copies" + " " + quantity.ToString();
strArguments += " " + "-nochgprinter" + " ";
proc.StartInfo.Arguments = @strArguments;
if (proc.Start())
{
    stdOut = proc.StandardOutput;
}

Customer
----------------------------------------------------
Error code 11 is indicate PDFPrint failed to render your PDF file.

Just for checking, you may run pdfprint.exe to print your PDF file by manual in cmd window, can you print your PDF file correctly by manual?

You can also try to use C# application to call pdfprint.exe to print your PDF files one by one, please don't print more PDF files at one time, can you work fine when you print PDF files one by one?

VeryPDF
----------------------------------------------------
Hello, I already tried that and didn't work . With the pdf file attached in this ticket , I get the output.txt. That das the response from the pdfprint. Do you need the screenshot?

Customer
----------------------------------------------------
Please add -raster2 parameter to try again, for example,

pdfprint.exe -raster2 D:\downloads\FA63942.pdf

Can you work better with -raster2 parameter?

VeryPDF
----------------------------------------------------
Thanks a lot.

With this parameter, the file are delivered complete (19 pages) to the printer. But I can't check the results right now in the office (the physical print) until Monday. Let me give a try this Monday, and if that works. I'll try with several files at the same time and I'll let you know.

This will be my complete set of parameters:

E:\ManualPrintCommand>c:\pdfprint_cmd\pdfprint.exe -raster2 -printer \\10.218.109.244\facturas e:\ManualPrintCommand\1308071445374196515000-EDIWIN4-EDIWIN-REPORT-FILE-SVD000317AH4-FA63942.pdf -copies 1 -nochgprinter -debug 

Customer
----------------------------------------------------
I just review the log for the last day and I just have one error. (Exit Code 13) For this file, the Error Code 13 what does it mean?

Document [\\FileServer\1308132105336496615000-EDIWIN4-EDIWIN-REPORT-FILE-SVD000317AH4-SSA00153.pdf]
Printer: [\\MyPrinter]
Begin Time [8/13/2013 4:10:31 PM]
Exit Time: [8/13/2013 4:10:32 PM]
Exit Code [-13]
Output: [Thank you for choosing our product.

Customer
----------------------------------------------------
-13: Something is wrong when set options to printer.

Please give "Full Control" permission to "Everyone" to target printer to try again.

VeryPDF
----------------------------------------------------
that's the only error so far.
I think that we could close this ticket. If I found something else I'll let you know.
Just one last question, what's the problem with that file (or those files) that are printed partially. And need this parameter. (raster2) and/or the difference with raster ? or without it.

Customer
----------------------------------------------------
In general, you can use -raster2 parameter to print all of your PDF files, -raster2 parameter is support the features which not supported by Windows Printer, e.g., transparency, opacity, etc. processes, so you can always use -raster2 parameter to print all of your PDF files.

VeryPDF

VN:F [1.9.20_1166]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
Error/Exit Codes when call PDF Print from C# source code, 10.0 out of 10 based on 1 rating

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!