Hi,
I'm using a trial of Adobe Acrobat Pro DC, Acrobat reader X, and Acrobat XI SDK with VisualStudio 2012.
I use Acrobat SDK in order to extract pages from a main PDF file, and create a new result PDF from that pages. I got this working in a windows application or in a windows service, but the same code doesn't work in a website. I got this error "Cannot create ActiveX Component" when I do this:
srcDoc = CreateObject("AcroExch.PDDoc")
---
Now, I read in some forums that Acrobat SDK cannot be use in a website, is that right? and why? And what about using it in a windows service?
This is my code:
Dim srcDoc As Acrobat.CAcroPDDoc
' Open the source PDF document
srcDoc = CreateObject("AcroExch.PDDoc")
retVal = srcDoc.Open(SOURCE_DOCUMENT)
If retVal <> -1 Then
Throw New Exception("Failed to open source document. Make sure that SOURCE_DOCUMENT has been configured.")
End If
' Acquire the JSObject interface
jsObj = srcDoc.GetJSObject
Dim newDoc As New Object
newDoc = jsObj.extractPages(CInt(txtFrom.Text.Trim) - 1, CInt(txtTo.Text.Trim) - 1)
'Save the new PDF to the output folder
outputString = OUTPUT_FOLDER & Guid.NewGuid.ToString & "_AdobeSDK.pdf"
newDoc.saveAs(outputString)
newDoc.closeDoc()
newDoc = Nothing
---
I'll wait for your answer,
Thank you,