Print Page | Close Window

Document properties

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3255
Printed Date: 19 Jan 26 at 4:34PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Document properties
Posted By: gianivo
Subject: Document properties
Date Posted: 30 Jan 16 at 6:08PM
Hello everybody,
I need to read and modify some PDF's properties (Author, Title, ecc.) in an Access Program.
I read the attributes, but I can't modify them. I haven't any error in the program, but in the file I find the previous value. What is my mistake?
Thank you very much

Ivo

Here's the simple VBA code:

Sub GoAttr()
    Dim DPL As New DebenuPDFLibraryAX1211.PDFLibrary, Cart As New Cartelle
    Dim x, informazioni, lKey As Long, vTab, i As Integer, wMsg As String
    lKey = DPL.UnlockKey(kUnlock)
    x = DPL.LoadFromFile(kf2, "")
    vTab = Cart.TabellaAttributiPDF  'attrbutestab:'0=PDFVersion;1=Author;2=Title;3=Subject;
                                                       '4=Keywords;5=Creator;6=Producer;7=Creationdate;
                                                       '8=Modificationdate
    For i = 0 To UBound(vTab): wMsg = wMsg & vTab(i) & ": " & DPL.GetInformation(i) & vbCrLf: Next
    MsgBox wMsg
    i = DPL.SetInformation(3, "Special Text") ' "i=1", but the attribute is not changed in the file!
End Sub




Replies:
Posted By: Ingo
Date Posted: 30 Jan 16 at 8:59PM
Hi Ivo,

if kf2 contains a pdf-filename with path and drive then it should work.
If the file is encrypted then not ;-)
After load you should check if the file is encrypted and then you should decrypt it first before working on it.
The other thing:
I don't see a "save"? 
If you don't write the changed file back to disk your modification is only temporarely ;-)

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: gianivo
Date Posted: 30 Jan 16 at 9:08PM
Thank you very much, Ingo.
I addedd "SaveToFile", but I need the same filename, and not a different filename! Furhermore, if I save the new document I can't delete it!
Cheers

Ivo


Posted By: Ingo
Date Posted: 31 Jan 16 at 10:42AM
you can take the same name ... that's not a problem.

-------------
Cheers,
Ingo



Posted By: gianivo
Date Posted: 01 Feb 16 at 9:01PM
Ok, it's running!




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