HTML2PDF / DocConverterCOM.pdfout

We are running into issue with DocConverterCOM.pdfout because if someone restart web server this service does not start automatically.

We have two questions,
1. Is there a way to make sure DocConverterCOM.pdfout is always running?
2. Is there a way to put some error trapping code in VB.Net project so that if DocConverterCOM.pdfout is not running than it start this service and then calls method to convert HTML2PDF?


Thanks,
==============================
>>? Is there a way to make sure DocConverterCOM.pdfout is always running?

If you install DocConverter COM as a service, please set "VeryPDF DocConverter COM Service" service to "Auto Start" mode, this service will be started automatically after you reboot the server.

If you install DocConverter COM as a normal Windows application, please select "Auto Run After Reboot" menu item from right-bottom tray area, doc2pdf_service.exe application will run automatically after you reboot the server.


>>? Is there a way to put some error trapping code in VB.Net project so that
>>if DocConverterCOM.pdfout is not running than it start this service and then
>>calls method to convert HTML2PDF?

You can use following VB.NET code to check if doc2pdf_service.exe process running, if doc2pdf_service.exe process is running, it is indicate DocConverterCOM Service is running, you can call DocConverterCOM.pdfout to convert documents to PDF files correctly,

public bool IsProcessRunning(string name)
{
//here we're going to get a list of all running processes on
//the computer
foreach (Process clsProcess in Process.GetProcesses())
{
if (clsProcess.ProcessName.StartsWith(name))
{
//process found so it's running so return true
return true;
}
}
//process not found, return false
return false;
}

OR

//Namespaces we need to use
using System.Diagnostics;

public bool IsProcessOpen(string name)
{
//here we're going to get a list of all running processes on
//the computer
foreach (Process clsProcess in Process.GetProcesses())
{
//now we're going to see if any of the running processes
//match the currently running processes. Be sure to not
//add the .exe to the name you provide, i.e: NOTEPAD,
//not NOTEPAD.EXE or false is always returned even if
//notepad is running.
//Remember, if you have the process running more than once,
//say IE open 4 times the loop thr way it is now will close all 4,
//if you want it to just close the first one it finds
//then add a return; after the Kill

if (clsProcess.ProcessName.Contains(name))
{
//if the process is found to be running then we
//return a true
return true;
}
}
//otherwise we return a false
return false;
}

if doc2pdf_service.exe process is not running, you can call following command line to launch the "VeryPDF DocConverter COM Service" Service, then you can call DocConverterCOM.pdfout to convert documents to PDF files properly.

VeryPDF
=====================================================
I think you forgot to give command line code to launch “VeryPDF DocConvertor COM Service”,

We tried using below code to start service from .Net but it’s not working. Can you please help us?

Dim StartInfo As New ProcessStartInfo
StartInfo.FileName = "doc2pdf_service.exe"
StartInfo.Arguments = " -exe"
StartInfo.WorkingDirectory = "D:\Downloads\VeryPDF\doc2pdf_com_full_v2.5\doc2pdf_com_full_v2.5\"
StartInfo.UseShellExecute = True
Process.Start(StartInfo)
=====================================

If you run DocConverterCOM as a normal Windows application, you can use your sample code to launch DocConverterCOM application,
Dim StartInfo As New ProcessStartInfo
StartInfo.FileName = "doc2pdf_service.exe"
StartInfo.Arguments = " -exe"
StartInfo.WorkingDirectory = "D:\Downloads\VeryPDF\doc2pdf_com_full_v2.5\doc2pdf_com_full_v2.5\"
StartInfo.UseShellExecute = True
Process.Start(StartInfo)

However, if you use DocConverterCOM as a Windows Service, you need launch it by following command line,

net start "VeryPDF DocConverter COM Service"

e.g.,

Dim StartInfo As New ProcessStartInfo
StartInfo.FileName = "cmd.exe"
StartInfo.Arguments = " net start \"VeryPDF DocConverter COM Service\""
StartInfo.WorkingDirectory = "C:\"
StartInfo.UseShellExecute = True
Process.Start(StartInfo)

VeryPDF
================================
Thanks for your reply. This is exactly what we were looking for.

I have one more questions, Is there a way/method to check number of pages in PDF so that we can add extra check in our code. Idea is to check number of pages in PDF before appending signature page to it and after appending signature page.
============================
You can count the pages in PDF files easily, please refer to following web page for more information,

http://www.verypdf.com/wordpress/201106/counting-the-exact-number-of-pages-in-any-pdf-document-732.html

VeryPDF
============================
We been ask to prove that this tool will append HTML 2 PDF every time. We have seen that there’s not good error trapping/handling available with this one. Is there a way to make 100% sure of job running and appending page? We have already added check for number of pages before and after appending html and also added check to make sure that doc2pdf_service.exe process is running.

Also can you please tell us what is ISO standards or security settings we are using for this tool?
============================
1). We apologize for any inconvenience this may have caused to you, this is a strange problem of append HTML file to existing PDF file, when we run the command line in CMD window, it does append HTML file to PDF file without any problem, this problem is appear in ASP code only, we sure it is caused by permission settings, but we can’t find out the reason at the moment.

However, in order to solve this problem quickly, we can present a copy of PDF Split-Merge Command Line application to you free, you can convert HTML file to PDF file first, and then call PDF Split-Merge Command Line application to combine two PDF files into one PDF file, we sure this solution will okay to you.

You can download the full version of PDF Split-Merge Command Line application from following URL,

XXXXXXXXXXXXXXXX

After you unzip it to a folder, you can run following command line to merge two PDF files into one PDF file,

Pdfpg.exe C:\test1.pdf C:\test2.pdf C:\out.pdf

You can call pdfpg.exe from your ASP code to combine two PDF files into one PDF file easily, we sure this solution will solve “appending HTML to PDF file” problem quickly.

2). Sorry, we don’t understand your meaning, do you wish create the PDF file with security settings?

VeryPDF
============================

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

Related Posts

This entry was posted in DocConverter COM and tagged . Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


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