Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1571
  • Last Modified:

PDF to TIFF using Acrobat and VB.Net.Error: UnsupportedValueError: Value is unsupported. ===> Parameter cConvID

I'm trying to use the following VB function to transform a pdf
document to a tiff file, do some GDI+ image modification and transer back to PFD format: I have problem dusing first step conversion of PDF to TIFF
I am using Visual Studio 2008, VB.Net , Acrobat 9
Using the following code, But when I type
'JSObj.saveAs("D:/Applications/sample.tiff", "com.adobe.acrobat.tiff")'
Visual studio intelisence doesn't show the SaveAs method at all. I went ahead and typed it, but got the following error in that line
Error: UnsupportedValueError: Value is unsupported. ===> Parameter cConvID
I tried googling forvthat error, but could not find a solution. Please help.
I am trying to do a proof of concept to my client saying that Adobe acrobat could help them convert PDF to TIFF and Tiff to PDF and they are ready to buy the product if I prove that in the .Net environment.

Wierd thing is I am not getting the 'saveAs()' method as an option for the JSObj at all I am just forcibily typing it. May be, do you guys think I am missing any reference. I have a project reference for the Acrobat 9 com component (Component Name: Acrobat Typelib version 1.0, C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.tlb
Please help.

Dim JSObj As Object, strPDFText As String 
        ' Create Acrobat Application object 
        PDFApp = CreateObject("AcroExch.App") 
        ' Create Acrobat Document object 
        PDDoc = CreateObject("AcroExch.PDDoc") 
        ' Open PDF file 
        PDDoc.Open("D:\Applications\Test_winapp\PDFUtility\WindowsApplication1\WindowsApplication1\sample.pdf") ' Path of some PDF you want to open 
        ' Hide Acrobat application so everything is done in silent mode 
        PDFApp.Hide() 
        ' Create Javascript bridge object 
        JSObj = PDDoc.GetJSObject() 
        ' Create Tiff file 
        JSObj.saveAs("D:/Applications/sample.tiff", "com.adobe.Acrobat.tiff") 
        PDDoc.Close() 
        PDFApp.CloseAllDocs() 
        ' Clean up 
        System.Runtime.InteropServices.Marshal.ReleaseComObject(JSObj) 
        JSObj = Nothing 
        System.Runtime.InteropServices.Marshal.ReleaseComObject(PDFApp) 
        PDFApp = Nothing 
        System.Runtime.InteropServices.Marshal.ReleaseComObject(PDDoc) 
        PDDoc = Nothing

Open in new window

0
hasan_tek
Asked:
hasan_tek
1 Solution
 
hasan_tekAuthor Commented:
I figured out the solution to the issue from another forum. Acrobat 9 you must use "com.adobe.acrobat.tiff" for parameter cConvID.
That work.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now