PDF conversions producing empty or corrupt files by PDFcamp

Question: Hello! In 2005 we bought PDFcamp v2.1 and doc2pdf_com_full_v2.1 (Doc Converter COM Server License 2.1).
In 2010 we noticed that our HTML selected radio buttons were hardly visible as being selected after conversion to PDF files, so we bought PDFcamp Printer v2.3, and then it was ok.However now we started having a problem when running a bat-file with many command-line conversions - a large number of the resulting PDF files are either empty (file-size = 0) or corrupt (smaller than the valid PDF files, and will not open with Adobe reader).
The command-lines in the bat-file look like this:
"html2pdf.exe" "C:\usr\SU_Arkiv\KlagoSynp\2006-04\SU06-2464.html" "C:\usr\SU_Arkiv\KlagoSynp\2006-04\SU06-2464.pdf" "papertype=7"
"html2pdf.exe" "C:\usr\SU_Arkiv\KlagoSynp\2006-04\SU06-2465.html" "C:\usr\SU_Arkiv\KlagoSynp\2006-04\SU06-2465.pdf" "papertype=7"
"html2pdf.exe" "C:\usr\SU_Arkiv\KlagoSynp\2006-04\SU06-2476.html" "C:\usr\SU_Arkiv\KlagoSynp\2006-04\SU06-2476.pdf" "papertype=7"
"html2pdf.exe" "C:\usr\SU_Arkiv\KlagoSynp\2006-06\SU06-4253.html" "C:\usr\SU_Arkiv\KlagoSynp\2006-06\SU06-4253.pdf" "papertype=7"
I started out running a bat-file with 2 896 lines like the 4 lines above. 1 649 of the resulting PDF files were empty or corrupt!
I built a utility to delete the bad PDF files and build a new bat-file with only these conversions. This time 1 649 conversions resulted in 1 510 files being empty or corrupt. I used my utility again, and this time time 1 510 conversions resulted in 1 381 files being empty or corrupt. I will never be finished to deliver all the files in this way. Can you help me to find out what is going wrong? I run the conversions on a Windows XP machine with service pack 3.

Solution: Please by following solution to batch convert lots of HTML or DOC or other documents to PDF files at one time,
1. Please run doc2pdf_service.exe as a normal Windows application by following command line,
doc2pdf_service.exe -exe
2. Please run following command line to convert all of HTML files to PDF files in D:\test folder and sub folders,
for /r D:\test %F in (*.htm) do html2pdf.exe "%F" "%~dpnF.pdf" "Overwrite=yes,KillProcess=no,doc2pdf_service=yes"
you can replace "D:\test" folder to correct folder in your system.
All of your HTML files will be converted to PDF files at one time by above command line.
if you needn't convert HTML files in sub folders, you can run following command line to convert all HTML files in D:\test folder only,for %F in (D:\test\*.htm) do html2pdf.exe "%F" "%~dpnF.pdf" "Overwrite=yes,KillProcess=no,doc2pdf_service=yes"
you can also call following command line from Windows Service or your web applications to convert DOC file to PDF file properly,
html2pdf.exe "C:\file.Doc" "C:\file.pdf" "Overwrite=yes,KillProcess=no,doc2pdf_service=yes"


Question: Hello!  I followed your advice, running all the conversions by a single command line: doc2pdf_service.exe -exe
for /r C:\usr\SU_Arkiv\KlagoSynp %F in (*.htm) do html2pdf.exe "%F" "%~dpnF.pdf" "papertype=7,Overwrite=yes,KillProcess=no,doc2pdf_service=yes" It started running the 2 896 conversions html 2 pdf, but soon there started popping up very very many windows error messages, like:
-The application failed to initialize properly (=xc0000142) Click on OK to terminate
-Unexpected error; quitting
-System Error &H80004005 (-2147467259) unspecified error
-Create Print2PDF 0cX error
The command window was still displaying new lines all the time, but when it all was over, there had only been created 84 pdf-files, and 13 of these were smaller and corrupt.
The next round I will have almost 60 000 html-files to convert to PDF, I cannot possibly do multiple reruns on that job.
Do you have any more suggestions?

Solution: This is because too many IE instances exist in your task manager, you may kill all IE instances to try again.
You can also run following command line to kill all IE instances when you convert about every 100 HTML files,
tskill.exe iexplore


Question:In my new bat-file, now with 880 lines of conversion commands, I followed your advice and put in:
tskill.exe iexplore...after every 50 lines of conversions. When running this bat-file, I saw the command-feedback of this:
Could not find process: iexplore..each time it was executed. Also I see that there are still created as many empty and many corrupt pdf-files as before. The machine is running Windows XP Service Pack 3, Internet Explorer 8. The HTML-files include CSS and JavaScript.What else can I do?

Solution: Can you see iexplore.exe in the task manager? if yes, you may kill it by manual to try again, this will solve this problem to you, please to try.

end the programme in task manager
                     Fig. 1. end the program in task manager


Question:My method for conversion was building a bat-file containing many lines, each line to execute the conversion of one html-file to a pdf-file. When running this bat-file I never saw any error messages, but my problem is that only a few of the conversions produced good pdf-files, most of the resulting pdf-files were empty, and some of them were smaller and corrupt.
On your suggestion I switched method once and ran all the conversions by a single command line, and before that command line also running "doc2pdf_service.exe -exe". This caused all the error messages to pop up. Other than that the result was the same, only a few of the conversions produced good pdf-files.
I now also tried your latest suggestion to run "tskill html2pdf" in my bat-file after a number of conversions. This made no difference, other than feedback each time this command was executed: "Could not find process: html2pdf"
As an example of the result of running a bat-file with conversions, only lines 5, 24, 25, 26, 34, 44, 49 etc etc produced valid pdf-files, out of about 700 conversions tin this bat-file only 68 were successful.

And Does it matter what version of Internet Explorer that is on the machine, and how it is configured?

Solution: We apologize for any inconvenience this may have caused to you, if this problem is urgent to you, we suggest you may renew the gold support from following page,
after you renewed the gold support, please send to us your Order ID of Gold Support, you may also create a remote desktop account on your test machine, please send to us the user name and password, we will arrange our engineer to login your test machine and work on this problem for you asap, gold support will greatly expedite your support request.
We suggest you may share your PC or Server by TeamViewer, TeamViewer can be downloaded from following website,
after you installed TeamViewer, please email to us your TeamViewer's ID and Password, please also arrange your test machine running at 24 hours, after we logged into your test machine and solved the problem, we will send an email to you, then you can close the TeamViewer application.

This matter is caused by IE, the IE may failed to open a web page if network too busy. I have another solution for you, you can retry to convert a web page if it fails, for example,html2pdf.exe "test.htm" "out.pdf" check if out.pdf file exists, if out.pdf file not created, please rerun following command line again and again, html2pdf.exe "test.htm" "out.pdf" for example, you can run this command line up to 5 times, if out.pdf file is still not be created, you can give up at this time.I think this solution will able to solve problem for you easily.


Final solution: I finally found a solution, by adding some arguments to each command-line in my bat-files:
"EnableSupportApplet=yes,DelayTimeForPrintApplet=10000" This of course slows down my conversions, but at least it seems I get only healthy pdf-files now, and no empty or corrupt ones.I just started a bat-file with close to 60 000 conversions, with a pace of about 5 conversions each minute, it will probably run for more than a week, but right now I can live with that. Thank you for helping me looking into this problem!

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Random 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!