Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Problems in extracting Images from PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

Problems in extracting Images from PDF

 Post Reply Post Reply
Author
Message
Ruturaaj View Drop Down
Team Player
Team Player
Avatar

Joined: 12 Aug 09
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ruturaaj Quote  Post ReplyReply Direct Link To This Post Topic: Problems in extracting Images from PDF
    Posted: 14 Aug 09 at 5:59AM
Hi All!!

How are you all doing?! I need your help regarding one highlighted feature of QuickPDF library ... "Extracting Images from PDF". I attempted to extract images from PDF file using QuickPDF, but I noticed that it slices some of the images into parts while extracting. I don't know why it happens so. For your testing purpose, I've created a small project; please download it from following URL:

http://www.mediafire.com/file/tjyi3owmnzn/Ruturaaj_ExtractImages.zip

Here is the function that I've written for extracting images:

Private Function ExtractImagesFromPDF(ByVal sPDFFile As String, ByVal sFolderToSave As String) As Long
    Dim iCnt As Integer, lTotal As Long
    Dim lRet As Long
    Dim lImgID As Long, sImgExt As String
   
    Set oPDF = New PDFLibrary
   
    With oPDF
   
        lRet = .LoadFromFile(sPDFFile)
       
        If lRet = 0 Then
            ExtractImagesFromPDF = -1
            Exit Function
        End If
       
        If lRet = 0 Then
            ExtractImagesFromPDF = 0
            Exit Function
        End If
       
        lTotal = 0
       
        lRet = .FindImages
       
        For iCnt = 1 To lRet

            lImgID = .GetImageID(iCnt)

            If .SelectImage(lImgID) = 1 Then
               
                Select Case .ImageType
               
                    Case 1: sImgExt = ".jpg"
                    Case 2: sImgExt = ".bmp"
                    Case 3: sImgExt = ".tiff"
                    Case Else: sImgExt = ".unknown"
                   
                End Select
               
                .SaveImageToFile AddBackSlash(sFolderToSave) & FileNameFromPath(sPDFFile, False) & "_img_" & iCnt & sImgExt
                DoEvents
               
                lTotal = lTotal + 1
               
            End If
           
            DoEvents
           
        Next iCnt
           
        ExtractImagesFromPDF = lTotal
       
    End With
   
End Function


Can you please tell me what additional stuff is needed to add to this function in order to make it to extract images correctly?

Eagerly waiting for your reply ...

Best Regards,

Ruturaaj.

Back to Top
Ruturaaj View Drop Down
Team Player
Team Player
Avatar

Joined: 12 Aug 09
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ruturaaj Quote  Post ReplyReply Direct Link To This Post Posted: 17 Aug 09 at 8:36PM
I'm really surprised to see no response to this thread! :(
Guys, I need your help to make this thing to work.
Please come forward and share your thoughts on this issue.
Waiting ...
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 17 Aug 09 at 9:31PM
Hi!
 
I think you don't get an answer 'cause there are probs starting your exe (probs with activex-creation...). But anyway...
Where are these sliced images on the pages?
More at the bottom and at the top of the pages... and not in the middle of the pages?
How are they implemented?
I've loaded your test.pdf with adobe reader and clicked on the small image in the middle to select it -> I see ONE frame.
When i click on the bigger iimage at the top of the page it depends on where i'm clicking... i see THREE frames.
So i assume that the big image will be extracted as three parts?
So i assume the creation/insertion of the big image is the problem?
 
Am i write right ;-)
 
Cheers, Ingo
 
 (Edit from Michel: corrected small typo for legibility reasons)


Edited by Michel_K17 - 18 Aug 09 at 12:47AM
Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store