Automating convertion with C#.NET

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
aopum
Posts: 2
Joined: Wed Sep 17 2003

Automating convertion with C#.NET

Post by aopum »

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
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

The printing dialog box is being generated by the OS and cannot be controlled by the PDF Converter.

Hope this helps
aopum
Posts: 2
Joined: Wed Sep 17 2003

automating with C#

Post by aopum »

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
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

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.
Post Reply