Solved

Need a script to read pdf document info.

Posted on 2001-07-31
7
948 Views
Last Modified: 2008-02-01
I currently have a folder on my Intranet server (IIS 4)containing many pdf files. Can anyone provide me with a "property reader" for pdf similar to the DSOLEFILE.DLL provided by Microsoft for use with MS Office documents.

http://msdn.microsoft.com/library/periodic/period00/fso.htm

Used in conjunction with the FileSystemObject you can trawl through folders, read each document's properties and generate html and hyperlinks on the fly.

Basically I want dumb users to drop their pdf's into a folder on the server, and have an asp or similar to read each file's properties and display Author, Subject and Title (with hyperlink). I've looked at adobe.com but can't find anything suitable.
0
Comment
Question by:devlinb
7 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 6338061
You're not going to find anything on Adobe's site, because this has nothing to do with PDF -- and everything to do with the SERVER.

YOu need to set up a form for the user to upload their files. You won't have a whole lot of control over what or how they upload, though you certainly could write something that ran on the server and deleted anything that didn't meet your specs (for filetype/size).

That dll is specifically designed to work with IIS -- it's not going to work with Apache, or on a UNIX box. It works with MS stuff because MS wrote it.
0
 
LVL 5

Expert Comment

by:raizon
ID: 6338075
I believe the point of the question was finding some way to read the properties of the PDF files dynamically to display the Author, Subject and Title of the file.

What I would do is

1.  In my upload form I would have text fields for the
Author, Subject and Title of the PDF.

2.  Create a DB with a table to hold that information and relate that table to anotherone that held the path to the file that was uploaded.

3.  When reading through the directory with the FileSystemObject query the DB to get the Information and build your page based off of that.

Raizon
0
 
LVL 1

Accepted Solution

by:
coreyti earned 100 total points
ID: 6338141
There is a Perl module that can take care of this stuff if you're able to use Perl for your project.

Checkout the PDF::Parse library at:
http://search.cpan.org/doc/ANTRO/PDF-111/PDF/Parse.pm

-corey
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 2

Author Comment

by:devlinb
ID: 6355247
thanks coreyti,
This script works fine - except for PDF's which have any security built-in. When security is added to a PDF the document info is encrypted in some way and displays as garbage. Is there any way to get around this?
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6357211
Unlikely. It's got security because it's not supposed to be accessible.
0
 
LVL 2

Author Comment

by:devlinb
ID: 6358728
I disagree - the document information is still accessible in the reader even after a pdf has been secured. Why would Adobe want to make this inaccessible when all you want to do is prevent a pdf document from being modified?
0
 
LVL 2

Author Comment

by:devlinb
ID: 6368770
When security is added to a PDF, the document info is encrypted in some way and displays as garbage. Is there any way to get around
this?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about why website design really matters in today's demanding market.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to dynamically set the form action using jQuery.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question