Here's the edited dump from an internal tool of one of those
annotations:
1 (CosDict& 35)
2 AP (CosDict)
291 C (CosArray)
295 CreationDate = D:20110504082511-05'00' (CosString)
296 F = 4 (CosInteger)
297 M = D:20110504082511-05'00' (CosString)
298 NM = 05ff164d-f023-4832-9f58-497e4a7f2e50 (CosString)
299 Name = nissanIQi-01K (CosName)
300 P (CosDict& 10)
(this caused my tool to go up to the page, then spider down to
Everything Else on the whole page... lots of irrelevant crap)
1215 Popup (CosDict& 38 line 476)
1216 Rect (CosArray)
1221 Subj = nissanIQi-01K (CosString)
1222 Subtype = Stamp (CosName)
1223 T = ganningb (CosString)
1224 Type = Annot (CosName)
 
It looks like you need to get the Name or Subject and parse out the bit
you want.
 
PS: It also looks like this file was originally created with iText 1.4.

 
--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 
 


________________________________

        From: Brendan Ganning [mailto:[email protected]] 
        Sent: Thursday, May 05, 2011 11:11 AM
        To: Post all your questions about iText here
        Subject: Re: [iText-questions] itext, coldFusion,annotations and
Pop-Up Notes
        
        
        Hi Mark, 

        Sure.  Here is the PDF

        As I stated I can get the comments, but ideally I would like to
get the values 2N1, 01H, 01K
        Thanks for the help.
        
        
        On Thu, May 5, 2011 at 1:07 PM, Mark Storer
<[email protected]> wrote:
        

                May we see the PDF?
                 
                --Mark Storer
                  Senior Software Engineer
                  Cardiff.com
                 
                import legalese.Disclaimer;
                Disclaimer<Cardiff> DisCard = null;
                 
                 


________________________________

                        From: Brendan Ganning
[mailto:[email protected]] 
                        Sent: Thursday, May 05, 2011 10:04 AM
                        To: [email protected]
                        Subject: [iText-questions] itext, coldFusion,
annotations and Pop-Up Notes
                        
                        
                        I am trying to grab either the text or stamp
information from a pdf through coldfusion.  Right now I have a PDF with
3 Stamps and 1 Comment box.  Each stamp is composed of two elements. A
text piece and a circle stamp with text such as 2d0f. I am trying to get
the stamp info. I am close, but I must be missing something. 

                        <cfscript>
                        //Load my PDF ( it has 1 comment, and 3 stamps.
Each stamp has a text box and a cirle with text)
                        reader =
CreateObject("java","com.lowagie.text.pdf.PdfReader").init(expandPath("t
est.pdf"));
                        // PDF is just one page
                        pageDict = reader.getPageN(1);

                        pdfname =
createObject("java","com.lowagie.text.pdf.PdfName");

                        // Get Annotations
                        annots = pageDict.getAsArray(pdfname.ANNOTS);

                        iterator = annots.listIterator()>
                        </cfscript>

                        <!--- Now loop through the iterations --->
                        <cfloop condition="iterator.hasNext()">
                               <cfset annot =
reader.getPdfObject(iterator.next())>
                               <cfset a =
reader.getPdfObject(annot).toString()>
                               <cfset content =
reader.getPdfObject(annot.get(pdfname.CONTENTS))>
                               <cfif not isNull(content)>
                                       <cfoutput>
                                       <!--- properly displays the
comments from the pdf ---->
        
content=#reader.getPdfObject(annot.get(pdfname.CONTENTS))#
                                       <p>
                                       </cfoutput>
                               <cfelse>
                               <cfdump var="#annot#">
                                     <!--- I get 6 null objects.  Which
I am sure coincide with the 3 stamps made up with two parts each.  It is
my understanding that these are POP-UP Notes but I cannot get their
value --->
                                      <cfoutput>
                                       it was null 
                                       </cfoutput>
                                       <p>
                               </cfif>
                        </cfloop>


        
------------------------------------------------------------------------
------
                WhatsUp Gold - Download Free Network Management Software
                The most intuitive, comprehensive, and cost-effective
network
                management toolset available today.  Delivers lowest
initial
                acquisition cost and overall TCO of any competing
solution.
                http://p.sf.net/sfu/whatsupgold-sd
                _______________________________________________
                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
                


------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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