I thought this would be fairly direct given the dll, but obviously not.  I'm
trying to extract the author and title from several pdf files.  I know that
some may have trash, but I'm willing to put up with whatever I can get.
However, I'm not even getting there and would appreciate some ideas.  The
following is a part of a shareware program I'm working on, written in VB
2005 and it aborts on the first call to dimension the pdfreader.  At this
point strfile contains "G:\abBooks\Derren Brown - Absolute Magic.pdf"

itextsharp.dll ver 5.2.0.0 has been added as a reference and points to the
itextsharp.dll which is resident in my project directory.

The error being returned is:

            An unhandled exception of type 'System.NullReferenceException'
occurred in itextsharp.dll.

            Additional information: Object reference not set to an instance
of an object.

 

            If FileExt = ".pdf" Then

                Dim reader As New PdfReader(strFile)

                Dim infodict As New Dictionary(Of String, String)

                infodict = reader.Info

                Try

                    If strAuthors = Nothing Then strAuthors =
FindAuthors(infodict("Author"))

                Catch

                    PrintLine(intBOLog, "Missing/invalid PDF author: " &
tempFile)

                End Try

                Try

                    If strAuthors = Nothing Then strTitle =
infodict("Title")

                Catch

                    PrintLine(intBOLog, "Missing/invalid PDF Title: " &
tempFile)

                End Try

                reader.Close()

                reader = Nothing

                infodict = Nothing

            End If

 

I really hate errors that don't tell me anything and this one tells *me*
nothing.  Can anyone provide some guidance, please?  

//al

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to