Quantcast
Channel: Adobe Community: Message List - Acrobat SDK
Viewing all articles
Browse latest Browse all 10848

Acrobat SDK in windows service and .net website

$
0
0

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,


Viewing all articles
Browse latest Browse all 10848

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>