thelordoftherings
Programmer
Hello,
When I am running standard ASP on the IIS it is working fine but when I run the following code example which I've downloaded from activepdf.com along with the PDF Server I receive HTTP 500 - Internal server error
Any ideas...?
<%
' Define Variables
' Local Path
varPath = Server.MapPath(".")
' PDF output name
varPDFName = "word.pdf"
' Word File To Convert
varWordFile = "word.doc"
' Timeout for Wait
varTimeout = 60
' Instantiate Object
Set APS = Server.CreateObject("APServer.Object")
' Set Server Properties
APS.OutputDirectory = varPath
APS.NewDocumentName = varPDFName
' Tell Server to begin the print process
varReturn = APS.StartPrinting()
If varReturn <> 0 Then Error("StartPrinting") End If
' Word Automation
Set WordObject = Server.CreateObject("Word.Application")
WordObject.DisplayAlerts = False
Set NewDoc = WordObject.Documents.Open((varPath & "\" & varWordFile), False, True)
Set WordDialog = WordObject.Dialogs(97)
WordDialog.Printer = APS.NewPrinterName
WordDialog.DoNotSetAsSysDefault = 1
WordDialog.Execute
NewDoc.PrintOut False
NewDoc.Close False
WordObject.Quit False
Set WordObject = Nothing
' Tell Server to end the print process
varReturn = APS.StopPrinting()
If varReturn <> 0 Then Error("StopPrinting") End If
' Wait for the conversion results
varReturn = APS.Wait(varTimeout)
If varReturn <> 0 Then Error("Wait") End If
' Clear Server Object
Set APS = Nothing
' Conversion Successful
Response.Write "Done!"
' Error Handling
Sub Error(Method)
Response.Write "'" & Method & "' failed with a '" & varReturn & "'<br>"
Response.Write "<a href=' Response.Write "support/kb/?id=10549&tk=ts'>"
Response.Write "KB Article for Return Codes</a>"
Set APS = Nothing
Response.End
End Sub
%>
When I am running standard ASP on the IIS it is working fine but when I run the following code example which I've downloaded from activepdf.com along with the PDF Server I receive HTTP 500 - Internal server error
Any ideas...?
<%
' Define Variables
' Local Path
varPath = Server.MapPath(".")
' PDF output name
varPDFName = "word.pdf"
' Word File To Convert
varWordFile = "word.doc"
' Timeout for Wait
varTimeout = 60
' Instantiate Object
Set APS = Server.CreateObject("APServer.Object")
' Set Server Properties
APS.OutputDirectory = varPath
APS.NewDocumentName = varPDFName
' Tell Server to begin the print process
varReturn = APS.StartPrinting()
If varReturn <> 0 Then Error("StartPrinting") End If
' Word Automation
Set WordObject = Server.CreateObject("Word.Application")
WordObject.DisplayAlerts = False
Set NewDoc = WordObject.Documents.Open((varPath & "\" & varWordFile), False, True)
Set WordDialog = WordObject.Dialogs(97)
WordDialog.Printer = APS.NewPrinterName
WordDialog.DoNotSetAsSysDefault = 1
WordDialog.Execute
NewDoc.PrintOut False
NewDoc.Close False
WordObject.Quit False
Set WordObject = Nothing
' Tell Server to end the print process
varReturn = APS.StopPrinting()
If varReturn <> 0 Then Error("StopPrinting") End If
' Wait for the conversion results
varReturn = APS.Wait(varTimeout)
If varReturn <> 0 Then Error("Wait") End If
' Clear Server Object
Set APS = Nothing
' Conversion Successful
Response.Write "Done!"
' Error Handling
Sub Error(Method)
Response.Write "'" & Method & "' failed with a '" & varReturn & "'<br>"
Response.Write "<a href=' Response.Write "support/kb/?id=10549&tk=ts'>"
Response.Write "KB Article for Return Codes</a>"
Set APS = Nothing
Response.End
End Sub
%>