Accessing file metadata on windows XP

W

wileyregister22

When rightclicking a, for example, pdf file on windows, one normally
gets a screen with three or four tags. Clicking on one of the summary
tag one can get some info like "title", "Author", "category", "keyword"
etc..

My question is how can I programmatically read and change these data
with python. I know I should use Hammond's win32 extension, somehow
involving the pythoncom, storagecon of win32com etc.. Unfortunately,
so far I cannot get anything useful. Instead of trying blindly, would
somebody please points me to the correct direction. A little snippet
would help. I am particular interested in pdf files.
 
D

Dennis Lee Bieber

When rightclicking a, for example, pdf file on windows, one normally
gets a screen with three or four tags. Clicking on one of the summary
tag one can get some info like "title", "Author", "category", "keyword"
etc..
Doesn't for me... Right-clicking on a PDF gives me a pop-up menu to
open, print, compress to ZIP, send to application in a predefined list,
copy/delete/rename, and access properties.
My question is how can I programmatically read and change these data
with python. I know I should use Hammond's win32 extension, somehow
involving the pythoncom, storagecon of win32com etc.. Unfortunately,
so far I cannot get anything useful. Instead of trying blindly, would
somebody please points me to the correct direction. A little snippet
would help. I am particular interested in pdf files.

Unfortunately, you now encounter the difference between Windows
(right-click/properties/summary) data, and what PDF format itself
maintains internally (open in Reader, file/properties -- shows a lot
more than Windows does). For the latter, you'd have to know the details
of the PDF file format itself.

--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
R

Rob Williscroft

wrote in in
comp.lang.python:
When rightclicking a, for example, pdf file on windows, one normally
gets a screen with three or four tags. Clicking on one of the summary
tag one can get some info like "title", "Author", "category", "keyword"
etc..

My question is how can I programmatically read and change these data
with python. I know I should use Hammond's win32 extension, somehow
involving the pythoncom, storagecon of win32com etc.. Unfortunately,
so far I cannot get anything useful. Instead of trying blindly, would
somebody please points me to the correct direction. A little snippet
would help. I am particular interested in pdf files.

This looks like it might be useful:

<url:http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/shellcc/platform/shell/reference/objects/shellfolderitem/shellfolderit
em.asp>

Thats:

MSDN Home > MSDN Library > Win32 and COM Development > User Interface
Windows Shell > Windows Shell > Shell Objects for Scripting and
Microsoft Visual Basic > ShellFolderItem >

Rob.
 
R

Roger Upole

When rightclicking a, for example, pdf file on windows, one normally
gets a screen with three or four tags. Clicking on one of the summary
tag one can get some info like "title", "Author", "category", "keyword"
etc..

My question is how can I programmatically read and change these data
with python. I know I should use Hammond's win32 extension, somehow
involving the pythoncom, storagecon of win32com etc.. Unfortunately,
so far I cannot get anything useful. Instead of trying blindly, would
somebody please points me to the correct direction. A little snippet
would help. I am particular interested in pdf files.

See \win32com\test\testStorage.py for an example of using
the storage interfaces to read and write document summary
info.

Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top