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

Reply via email to