Print Page | Close Window

Is RemoveDocument effectively same as Close?

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1987
Printed Date: 22 Nov 24 at 7:17PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Is RemoveDocument effectively same as Close?
Posted By: LittleTyke
Subject: Is RemoveDocument effectively same as Close?
Date Posted: 06 Oct 11 at 2:53PM
I've just downloaded the Quick PDF Lite package in order to get document properties from a number of PDF files. This is how I've coded it and the results look fine:

Private Sub Command1_Click()

    Dim PDFLibrary As QuickPDFLite0725.PDFLibrary
    Dim DocID As Long
   
    Set PDFLibrary = CreateObject("QuickPDFLite0725.PDFLibrary")
    Call PDFLibrary.LoadFromFile("F:\VBCD\MAXPRO.PDF")
    DocID = PDFLibrary.SelectedDocument()
   
    Debug.Print "PDF Version: " & PDFLibrary.GetInformation(0)
    Debug.Print "Author: " & PDFLibrary.GetInformation(1)
    Debug.Print "Title: " & PDFLibrary.GetInformation(2)
    Debug.Print "Subject: " & PDFLibrary.GetInformation(3)
    Debug.Print "Keywords: " & PDFLibrary.GetInformation(4)
    Debug.Print "Creator: " & PDFLibrary.GetInformation(5)
    Debug.Print "Producer: " & PDFLibrary.GetInformation(6)
    Debug.Print "Creation date: " & PDFLibrary.GetInformation(7)
    Debug.Print "Modification date: " & PDFLibrary.GetInformation(8)
   
    Call PDFLibrary.RemoveDocument(DocID)
   
    Set PDFLibrary = Nothing

End Sub

Does that look about right as one is supposed to work with Quick PDF? In Acrobat Reader I can explicitly File/Close a PDF file when finished with, but the Quick PDF object model doesn't include a Close method. Closest I can find is RemoveDocument, for which I need to have retrieved the DocumentID.

The above code will eventually be in a loop to recurse through a number of folders, picking up PDF files found and pumping the properties data to a text file or Access database. So the loop will do:  LoadFromFile, SelectedDocument, GetInformation, and RemoveDocument continuously, only setting PDFLibrary = Nothing when all the folders have been recursed and the loop is terminated.

Thanks!




Replies:
Posted By: Ingo
Date Posted: 06 Oct 11 at 9:06PM
Hi Tyke!

CreateObject does what the name is telling ...
and after this you can work on pdf-files (load, manipulate, save, ...
and .Free will destroy the object at the end and relase the memory.
In a pdf-file you can have/create more than one document and
so it's possible to remove one, too.

Cheers, Ingo



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk