Hi, I am trying to convert word documents to pdf. Following is the code snippet that is used for the purpose. it shows printing message and then get hanged. I don't want it to show the printing message and want it to convert document without any message. This is because I would be using it inside a windows service and it would not have any user interface.
CDIntf.CDIntf PDoc = new CDIntf.CDIntfClass();
PDoc.DriverInit("Amyuni PDF Converter");
PDoc.SetDefaultPrinter();
PDoc.FileNameOptions = 7;
PDoc.BatchConvert("C:\\doc\\*.doc");
PDoc.DriverEnd();
Hope you get back as soon as possible because we have to decide wether we should go ahead to buy this product.
thanks
Automating convertion with C#.NET
automating with C#
I am using this code:
CDIntf.CDIntf PDoc = new CDIntf.CDIntfClass();
results = PDoc.DriverInit("Amyuni PDF Converter");
PDoc.DefaultFileName = "1.pdf";
PDoc.SetDefaultPrinter();
PDoc.PDFDriverInit("Amyuni PDF Converter");
PDoc.BatchConvert("c:\\doc\\1.doc");
PDoc.DriverEnd();
it is opening the doc file in MS word and then send it to the printer but in the directory i can not see the resultant pdf file.
i dnt want it to open the file in ms word and i want to see the pdf file in the directoy c:\doc\1.pdf
please suggest that how we can achieve this.
regards
CDIntf.CDIntf PDoc = new CDIntf.CDIntfClass();
results = PDoc.DriverInit("Amyuni PDF Converter");
PDoc.DefaultFileName = "1.pdf";
PDoc.SetDefaultPrinter();
PDoc.PDFDriverInit("Amyuni PDF Converter");
PDoc.BatchConvert("c:\\doc\\1.doc");
PDoc.DriverEnd();
it is opening the doc file in MS word and then send it to the printer but in the directory i can not see the resultant pdf file.
i dnt want it to open the file in ms word and i want to see the pdf file in the directoy c:\doc\1.pdf
please suggest that how we can achieve this.
regards
Hi,
It looks like you have not added the FileNameOptions() value in your code.
CDIntf.CDIntf PDoc = new CDIntf.CDIntfClass();
results = PDoc.DriverInit("Amyuni PDF Converter");
PDoc.DefaultDirectory = "c:\"
PDoc.SetDefaultPrinter();
PDoc.FileNameOptions = 1;
PDoc.BatchConvert("c:\\doc\\1.doc");
PDoc.DriverEnd();
Hope this helps.
It looks like you have not added the FileNameOptions() value in your code.
CDIntf.CDIntf PDoc = new CDIntf.CDIntfClass();
results = PDoc.DriverInit("Amyuni PDF Converter");
PDoc.DefaultDirectory = "c:\"
PDoc.SetDefaultPrinter();
PDoc.FileNameOptions = 1;
PDoc.BatchConvert("c:\\doc\\1.doc");
PDoc.DriverEnd();
Hope this helps.