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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PDF Distiller and ASP

Status
Not open for further replies.

jkb17

Programmer
Nov 27, 2000
156
US
I've been told by Adobe that you can instantiate the PDFDistiller object from within an ASP page. I use the Server.CreateOBject("Pdfdistiller.pdfdistiller.1") call as described by Adobe.

My server doesn't recognize the object and Adobe told me that it may be a permissions issue. It is not because I set my IUSR_computername account to be a member of the Administrators group (just for testing their permissions theory), but I still receive the error message.

Has anyone encountered this? I am supposed to call a different class, regsvr32 a different DLL or what?

Thanks in advance.

jim
 
I have been able to get this to work in a Script. Sorry that I have not tried it out in the ASP environent as that is not where it will reside in production, however considering that I have got it to work in the Windows Script environment I would imagine it would work in ASP.

Both of these bits of code work for me when I put them into a .vbs ---->


1) version without Script Host
' - - - - - - - - - - - - - - - - - - - - - - -
' OPEN WORD DOCUMENT AND CREATE POSTSCRIPT FILE
'
set objWord = Createobject("Word.Application")
set objWordDocs = objWord.Documents
objWord.ActivePrinter = "Generic PostScript Printer"
set objWordDoc = objWordDocs.Open("f:\my.doc")
objWordDoc.Printout 0,0,0,"f:\my.ps"
objWord.ActiveDocument.Close
objWord.Quit
set objWord = Nothing
'
' TAKE POSTCRIPT AND CONVERT TO PDF
'
set objDist = CreateObject("PdfDistiller.PdfDistiller.1")
objDist.FileToPdf "f:\my.ps", "", ""
'- - - - - - - - - - - - - - - - - - - - - - - -


2) version with Script Host
' - - - - - - - - - - - - - - - - - - - - - - -
' OPEN WORD DOCUMENT AND CREATE POSTSCRIPT FILE
'
set objWord = Wscript.Createobject("Word.Application")
set objWordDocs = objWord.Documents
objWord.ActivePrinter = "Generic PostScript Printer"
set objWordDoc = objWordDocs.Open("f:\my.doc")
objWordDoc.Printout 0,0,0,"f:\my.ps"
objWord.ActiveDocument.Close
objWord.Quit
set objWord = Nothing
'
' TAKE POSTCRIPT AND CONVERT TO PDF
'
set objDist = Wscript.CreateObject("PdfDistiller.PdfDistiller.1")
objDist.FileToPdf "f:\my.ps", "", ""

- - - - - - - - - - - - - - - - - - - - - - - -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top