How to extract images from PDF file through VB.Net

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default How to extract images from PDF file through VB.Net

    I am developing a desktop application in VB.Net. I need to extract images from the PDF file. I am using Adobe Acrobat 7.0.5 SDK. I have written following code, however, it is throwing an error when I execute PDFJS.dataObjects.

    Dim PDFApp As Acrobat.CAcroApp
    Dim PDFAVDoc As Acrobat.CAcroAVDoc

    Dim PDFFilePath As String
    Dim PDFDoc As Acrobat.CAcroPDDoc
    Dim PDFJS As Object

    Dim Obj As Object
    Dim objs() As Object

    Dim NoOfPages As Integer
    Dim i As Integer

    PDFFilePath = Application.StartupPath & "\Sample.pdf"

    Try
    PDFApp = CreateObject("AcroExch.App")
    PDFApp.Show()

    PDFAVDoc = CreateObject("AcroExch.AVDoc")
    PDFAVDoc.Open(PDFFilePath, "Test Application")

    PDFDoc = PDFAVDoc.GetPDDoc

    PDFJS = PDFDoc.GetJSObject
    NoOfPages = PDFJS.numPages

    objs = PDFJS.dataObjects
    'This statement throwing an error – Public
    'member 'dataObjects' on type '_ComObject' not found.

    If Not objs Is Nothing Then
    For i = 0 To objs.Length - 1
    Obj = PDFJS.getDataObject(objs(i).name)
    If Obj Is Nothing Then
    If TypeOf (Obj) Is Bitmap Then
    'If type if obj is bitMap then Save this
    'object as .jpeg, .tiff, etc.
    End If
    End If
    Next
    End If
    PDFAVDoc.Close(0)

    Catch ex As Exception
    MessageBox.Show(ex.Message)
    Finally
    If Not PDFApp Is Nothing Then
    PDFApp.CloseAllDocs()
    PDFApp.Exit()
    End If
    End Try

    I am developing this application on Windows XP Professional edition.

    Is there any other way to extract images from PDF file?

    Thanks,
    Nitesh
    Nitesh.Patel@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Extract all images from pdf files?
      I need to extract all images(vector and raster) from pdf files through programmatically. Kindly advice me.
    2. How to extract Metadata of PDF File using DLE APIs
      May i get some information for how to extract metadata of PDF File using DLE API if possible, may i get some sample code....
    3. Extract separate pages of a pdf file
      Is there any way that I can "automatically" separate a 60 page pdf file into 60 separate pdf files? This is a function that I will use a lot. If...
    4. extract zip file in php
      Hi, I have to extract a zip file into a web server in php. I found ZZIPlib LIbrary by Guido Draheim which allow to do this but I can't install...
    5. actions - extract file name
      You could run contact sheet at the end of your action, you would ahve to select the folder the images are in and then set the image size and it will...
  3. #2

    Default Re: How to extract images from PDF file through VB.Net

    Are you assuming that "dataobjects" corresponds to the objects on the
    page? It doesn't. There is no JavaScript or IAC method that gives you
    access to page contents in this way.

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

  4. #3

    Default Re: How to extract images from PDF file through VB.Net

    Is there any other way to get objects on the page?
    Nitesh.Patel@adobeforums.com Guest

  5. #4

    Default Re: How to extract images from PDF file through VB.Net

    Only through the plug-in API. Plug-ins are written in Visual C++, with
    C or C++, and are not separate applications.

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

  6. #5

    Default Re: How to extract images from PDF file through VB.Net

    By the way, I'd very strongly recommend reading the PDF Reference
    before considering any kind of extraction. So you know what is in
    there.

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139