Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert MS doc files to pdf within an ASP script on IIS Win2000

Status
Not open for further replies.

vrabotni

Programmer
Feb 20, 2003
3
CA
I need to be able to convert doc to pdf in an asp script (VBScript or JavaScript) ... Here is what I'm trying to do:

function ConvertDOC2PDF(strFile, strFile2)
{
var AcroApp = Server.CreateObject("AcroExch.App");
var AVDoc = Server.CreateObject("AcroExch.AVDoc");


AVDoc.Open(Server.MapPath(strFile), "");
AVDoc = AcroApp.GetActiveDoc();
var PDDoc = AVDoc.GetPDDoc();

PDDoc.SetInfo("Title", "My Title");
PDDoc.SetInfo("Author", "The Author");
PDDoc.SetInfo("Subject", "The Subject");
PDDoc.SetInfo("Keywords", "Keywords");

PDDoc.Save(1, Server.MapPath(strFile2));
PDDoc.Close();
AVDoc.Close(false);
AcroApp.Exit();

PDDoc = null;
AVDoc = null;
AcroApp = null;
}
ConvertDOC2PDF("Test.doc", "Test.pdf");


But the script times out :-( and I get the following error:

Error Type:
Active Server Pages, ASP 0113 (0x80004005)
The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.

Please help ...
 
Hi,

Did you find a solution for this problem? I realise the problem is in the open statement. It works to open pdf files but not any other type of file. In as exe project, it is not problem. Only in asp there is that proble.

Thnak you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top