Batch Convert and ASP.Net application - not working

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
asha
Posts: 3
Joined: Mon Jan 02 2006

Batch Convert and ASP.Net application - not working

Post by asha »

Hi,

This is in continuation to my thread Document converter 2.50d-3 - no PDF files being created!!! earlier in the forum.

I am using Amyuni document converter 2.50d-3, developer license.

I am able to get the batch convert to work from a .Net Windows application, but not from an ASP.Net WEB APPLICATION.

Below is the code from what I am trying to do.

- ASPNET user is an administrator on the web server.
- As advised earlier, I am using enable printer right before the batch convert call...

//
private void PrintToServer()
{
const string PDFPrinter = "Amyuni Document Converter";
const int NoPrompt = 1;
const int UseFileName = 2;
const string strLicencee = "XXXXXX";
const string strCode = "XXXXXXXXXX";

CDIntfEx.CDIntfExClass cdi = new CDIntfEx.CDIntfExClass();
string filepath = Server.MapPath("in.doc") ;
int j = cdi.DriverInit(PDFPrinter);
cdi.DefaultDirectory = Server.MapPath(".");
cdi.DefaultFileName = Server.MapPath("out.pdf");
cdi.FileNameOptionsEx = NoPrompt + UseFileName;
bool bSet = cdi.SetDefaultPrinter();
int k = cdi.EnablePrinter(strLicencee, strCode);
cdi.BatchConvert(filepath);
cdi.RestoreDefaultPrinter();
cdi.FileNameOptions = 0;
cdi.DriverEnd();

}

//

The batch convert call does not convert the word document to PDF.
There are no error messages. The web page doesnt do anything other than show a slow progress bar when BatchConvert is called.

Is there anything special we need to do to get the web application? any help is greatly appreciated.

thanks
asha
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

The BatchConvert() function will launch the application that is associated with a specific file extension and issue a print (verb) command to convert the document. I do not believe that because of security constrains this type of functionality is possible with a web application.


In order to resolve your issue you will need to print to the PDF Converter through an instance of the application associated to the file extension of the document you want to print.

Hope this helps?
Post Reply