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 - Extract Metadata
  FAQ FAQ  Forum Search   Register Register  Login Login

Extract Metadata

 Post Reply Post Reply
Author
Message
Guna View Drop Down
Beginner
Beginner


Joined: 06 Mar 14
Location: India
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guna Quote  Post ReplyReply Direct Link To This Post Topic: Extract Metadata
    Posted: 06 Mar 14 at 5:12PM
Hi,

I want to know how to create a specific action to extract metadata from the PDF. This action must be automated so that I can extract 100 document titles. Please help!! 

Regards,
Guna
Back to Top
AndyD View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Apr 13
Location: UK
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndyD Quote  Post ReplyReply Direct Link To This Post Posted: 07 Mar 14 at 9:28AM
This solution is For VB6.
 
One example of this would be if you wanted to read the Title data from a list of PDF's and display them in a Listbox.
 
I use this personally in a program because many PDF filenames are quite random whereas you can store meaningful info in the title and use that instead.
 
First I have a form with a basic listbox on it.
 
Then at runtime just set the column headers.
 
Private Sub Form_Load()
 
    Set colX = ListView1.ColumnHeaders.add()
        colX.Text = "Filename"
        colX.Width = 1
' I set this to 1 to hide this column as the Filename isn't useful to me visually but is used elsewhere.
   
    Set colX = ListView1.ColumnHeaders.add()
        colX.Text = "Document Description"
        colX.Width = 9100
 
End Sub
 
Then either within the form load or from a button call, the following routine will loop through all the PDF's in a specific folder, using the Call ReadPDF function it extracts the Title information from each PDF and displays it in the listbox.
 
 
Dim sFile As String
Dim FullPath as String
 
sFile = Dir$("PDFLocation\*.*")
    

Do Until sFile = ""

If Left$(sFile, 1) <> "." Then
     FullPath = "PDFLocation\" & sFile
     Call ReadPDF(FullPath)
     Set ItmX = ListView1.ListItems.add(, , sFile)
     ItmX.SubItems(1) = msTitle
End If
sFile = Dir$
Loop
ListView1.Sorted = True
ListView1.SortOrder = lvwAscending ' This just sorts the titles alphabetically
ListView1.SortKey = 1
 
 
Function ReadPDF(ByVal sFile As String) As Boolean
    ClassName = "DebenuPDFLibraryAX0914.PDFLibrary"
    LicenseKey = "Your Licence info here"
    Set QP = CreateObject(ClassName)
    Result = QP.UnlockKey(LicenseKey)
If result = 1 then    
    Call QP.LoadFromFile(sFile, "")
    msTitle = QP.GetInformation(2)
    Set QP = Nothing
End If
End Function
 
 
Using the .GetInformation() function you can retrieve the following info:
 
(0) = PDF Version
(1) = Author
(2) = Title
(3) = Subject
(4) = Keywords
(5) = Creator
(6) = Producer
(7) = Creation Date
(8) = Modification Date
 
 
Hopefully this will help someway to achieving what you need.


Edited by AndyD - 08 Mar 14 at 9:19AM
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