Getting PDF annotations in ColdFusion

Currently, I am using coldfusion 9 and I am trying to get information about annotations from within a PDF file.  The problem is that there are two types of annotations: text and popup.  I am using iText and I can get an annotation array that has 7 objects.
<cfset reader = CreateObject("java","com.lowagie.text.pdf.PdfReader").init(expandPath("test.pdf"))>
<cfset pageDict = reader.getPageN(1)>
<cfset pdfname = createObject("java","com.lowagie.text.pdf.PdfName")>
<cfset annots = pageDict.getAsArray(pdfname.ANNOTS)>
So now I see that I have 7 annotations ( I know one is text, and the other 6 are popup). At this point I want to loop through the annotation array and get the informartion
<cfset iterator = annots.listIterator()>
<cfloop condition="iterator.hasNext()">
       <cfset annot = reader.getPdfObject(iterator.next())>
       <cfset content = reader.getPdfObject(annot.get(pdfname.CONTENTS))>
       <cfif not isNull(content)>
               <cfoutput>
               <p>
               Text Comment =#content#    <!--- This works for the text comments --->
               </p>
               </cfoutput>
       <cfelse>
               <!--- This happends to be the Popup contents, and where I get lost ---->
       </cfif>
</cfloop>
So in the part where I am trying to get the popup contents, I have tried <cfset x  = reader.getPdfObject(annot.getAsDict(pdfname.popup))>  This works, but I can't seem to extract the data.  All I need is to get either the Subject or Name from the popup innotation as they are set to a set number of possibilities in our system.  How do I extract the name or subject info drom the popup object? 

Thank you!  I had been trying to get the subject off of the annot obj.  I didn't realize that the I had to init Subj.  Once I tried that I was able to do annot.get(subjKey).toString() and get the values I needed!
Thank you again!

Similar Messages

  • Populating a PDF File from ColdFusion

    I wanted to populate a pfd file from coldfusion and I found
    this online:
    http://www.school-for-champions.com/coldfusion/cftopdf.htm
    When I submit the form.. I then show a link [view pdf].. only
    when I click
    on that lick I get a message saying
    Adobe acrobat: the file is damaged and could not be repaired.
    Has anyone used this method successfully? If so, would like
    to hear some
    suggestions.
    The PDF template I created just have 2 fields. firstname
    lastname (which
    matches cfm form).
    Thanks in advance
    1. Create PDF document to populate
    Create the document you want to populate. This document could
    be done in
    Microsoft Word, as an HTML page or using some drawing
    application. Then
    create a PDF file of that document.
    You must have Adobe Acrobat or the equivalent to create a PDF
    file.
    Typically, the easiest way to create a PDF is to click File
    > Print and
    select Acrobat Distiller as your printer.
    2. Enter fields with Acrobat
    Once the document is in the PDF format, open it in Acrobat.
    Use the menu bar
    tools to define your fields.
    a.. Use the Form Tool to define the various text fields,
    give each a name,
    and designate the font type and size. The field name should
    correspond to
    the name of the data you will input.
    b.. Use the Text Tool to modify areas of text. You may have
    to change the
    font or font size. It is not the easiest tool to use.
    This will be your PDF template.
    3. Create a ColdFusion page to populate the PDF
    Create a ColdFusion form to gather data from input over the
    Internet or from
    a database query. This page or an action page will provide
    the means to
    populate the PDF file.
    The code you use will depend on the method or software you
    decide to use.
    Options will be explained in the next section.

    Hi, I need your help again.. And if you can do this for me; i
    will pay for
    your time. just let me know. because i need this project wrap
    up in the next
    28 hours.
    I've used the Ben Forta (cf_PDFFROM) and i'm able to get the
    pdf. (great)
    now i need to suppress blank lines.
    my pdf is a business card template.
    on the left top down
    firstname middle name lastname
    job title
    address1
    address2
    address3
    www.whatever.com
    on the right bottom up:
    phone:
    fax:
    mobile:
    email:
    aim:
    there's where I'm stuck:
    if a user does not enter a fax number... I want the PDF to
    move 'phone:'
    down 1 line and not show the word 'fax'.
    PLEASE can someone point me in the right direction OR tell me
    you can do it
    quickly. contact me and i'll pay you.
    thanks in advance!
    "BLXWebMaster" <[email protected]> wrote in
    message
    news:f2fi63$c1e$[email protected]..
    > What version of PDF are you using? Are you creating your
    PDF Form in
    > designer?
    > If you are trying to Pre-Populate a PDF Form, this
    technique will not work
    > in
    > that this will not preserve your Form. With the recent
    versions of PDF,
    > Adobe
    > hase changed the technology to be XML and you are trying
    to populate your
    > PDF
    > using FDF. I don't think that this can be done.
    >
    > I would stay away from FDF.
    >
    > Although there are several tools that will allow you to
    do this, most of
    > them
    > rely on the old FDF format.
    >
    > I would suggest checking out XPAAJ. This is a free api
    for Coldfusion
    > users
    > and offers a decent basic pre-population of PDF's.
    > Written by our friend Ben Forta, you can check it out
    here.
    >
    http://www.forta.com/blog/index.cfm/2006/7/27/cf_pdfform
    >
    >
    >
    >

  • [SOLVED] Wanted: extract pdf annotations created in Mac OSX preview

    I just had a collegue return a pdf marked up with "annotations".
    I first struggled with finding a viewer that views the annotations, and those that could (evince, okular) all have more dependencies that I'd want/need.
    I decided there must be an lighter weight way to extract the text of annotations from pdfs.  I searched, read, and learned about pdf annotation formats and I figured out how to extract adobe annotations from a pdf.  Only then did I realize that my collegue didn't use adobe.  The annotations were created in Mac OSX's preview.  Preview, it would seem, does not use the adobe xfpdf format for annotations, it uses some other means to embed the annotations.
    I searched the pdf file in text and hex editors, but I couldn't find anything resembling what I knew to be in some of the annotations.  However Preview does it, the text must be encoded and unreadable in the "raw" file.  This is in contrast, it would seem, with adobe's annotations.
    My question, then, is two-fold.  First, are there any text-annotation extractor tools that can get notes created in OSX's preview?  If not, does anyone know of any documentation outlining how Preview embeds this information?  I've been googling the latter question, but I'll I'm getting is "where-to-click" level tutorials on how to DO annotations in Preview.  I can't find any documentation of how that information is embeded into the file.
    Note: evince does get the text of the annotations, but I'd prefer not to keep that installed.  Evince-gtk is only every so slightly lighter on dependencies.  Also, in evince I get flooded with "sticky notes" with all the annotation text.  It would take a while to move those around and close them one at a time to be able to actually read them.  I'm hoping to be able to extract all annotation text and dump it into a text file.
    Last edited by Trilby (2012-05-29 00:38:32)

    Holy crap, it works.  A couple hours of reading ugly docs and 32 lines of code later, I have exactly what I was looking for.
    I'd love it if some volunteers would try this out, beat it up, and see what breaks first so I can improve it.  After a little polishing I might put it up in the AUR.
    Get the code from my dropbox here
    The Ugly Patchwork Makefile and a very brief TODO list are also posted.
    I'll put together a PKGBUILD once this is in better order for distribution and installation.  I just got the darn thing to work, it's time to celebrate, not code more.
    Note to Mods: as in my "report", please move this thread to Community Contributions.
    Last edited by Trilby (2012-05-29 00:34:38)

  • What will it take to have decent native PDF annotation?

    Hey guys,
    I'm an academic that frequently needs to annotate pdfs. So far, the best solutions have been to install Wine and Foxit or PDF-exchange. However, I really want to have something that doesn't require me to install Wine or a bunch of 32-bit libraries.
    So what will it take to have decent PDF annotation running natively in Linux. What needs to get added in evince/okular? Is there any sort of gameplan? I can't find any so far, but if there is, please point me to it so that I can contribute. If there are no efforts, please give me ideas to get started. I'm quite fed up now.
    It's a cause worth getting behind. Students and other academics will highly appreciate such a feature.

    drcouzelis wrote:
    The Wikipedia has an interesting section on annotations and application support: https://en.wikipedia.org/wiki/Pdf#Annotation
    cfr wrote:Annotations for PDF suck on all OS but they such more on Linux. We need a GIMP or InkScape for PDF and not just more and more pdf viewers.
    I think we need a file format that was designed to have annotations built into it in an open and standard way, instead of shoehorning it into a file format that was designed to be read-only.
    In a way, I agree. But in another way, I disagree. In a sane world, you'd be right. In this world, you're wrong. If you have any contact with academia, at least, pdf and word documents are *the* file formats and if you can't work with them, you can't do anything except howl at the moon.
    I don't think the situation with pdf is getting worse (and Trilby gives me hope ) but the situation with word documents is. I'm semi-seriously wondering if I should give up LaTeX and try to get hold of a copy of Office (and Windows) to dual boot. Conversion from LaTeX source used to be reasonably good. Now it is simply horrible and I have people telling me they cannot work with my files at all. That's pretty bad. I checked the file in a current version of Word and they were right. The conversion to .odt left a great deal to be desired (why does it turn every quotation into a separate section for goodness sake?) but the export from LibreOffice was simply horrendous. It just stuck endnotes in the middle of pages, included weird and almost-impossible-to-remove formatting etc. etc.
    I'm not saying this is LO's fault. Office formats are a moving target and the target is deliberately moved in especially difficult to discern ways. But if publishers and editors insist on Word documents (and they do), it doesn't really matter whose fault it is.
    Last edited by cfr (2013-06-06 00:19:59)

  • Instead of getting PDF got XML output Bi publisher report

    Hi ,
    While i run the concurrent request i got the below :
    Executing request completion options...
    Output file size:
    335
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 3715769 on node CORPT228V at 14-SEP-2012 07:50:11.
    Post-processing of request 3715769 failed at 14-SEP-2012 07:50:11 with the error message:
    One or more post-processing actions failed. Consult the OPP service log for details.
    ------------- 2) PRINT   -------------
    Not printing the output of this request because post-processing failed.
    instead of getting pdf output i got xml o/p....
    thanks in advance....
    Regards,
    Doss

    Alex,
    I have checked the log ...i did find the below,
    [9/14/12 8:13:23 AM] [90939:RT3715787] Output file was found but is zero sized - Deleted
    [9/14/12 8:13:23 AM] [UNEXPECTED] [90939:RT3715787] java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeNewXSLStylesheet(XSLT10gR1.java:611)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:239)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:182)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1044)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:997)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:212)
         at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1665)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:975)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5936)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3459)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3548)
         at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:302)
         at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:176)
    Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'ref' used but not declared.
         at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:806)
         at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:571)
         ... 17 more
    [9/14/12 8:13:23 AM] [90939:RT3715787] Completed post-processing actions for request 3715787.
    [9/14/12 8:15:47 AM] [GSMServiceController:90939] New Initialization Parameters: oracle.apps.fnd.cp.opp.OPPServiceThread:2:0:max_threads=5
    [9/14/12 9:03:39 AM] [GSMServiceController:90939] Received shutdown request.
    [9/14/12 9:03:39 AM] [GSMServiceController:90939] Preparing to shutdown service.
    [9/14/12 9:03:39 AM] [GSMServiceController:90939] Stopping all Service Threads.
    [9/14/12 9:03:39 AM] [OPPServiceThread0] Preparing to shut down service thread.
    [9/14/12 9:03:39 AM] [OPPServiceThread1] Preparing to shut down service thread.
    [GC 25492K->7906K(63424K), 0.0562769 secs]

  • I have purchased Adobe XI Pro and created a form for entering bowling scores to submit to newspaper for my high school team.  I can not figure out how to get pdf's into my documents folder on my iPad so that I can access the files in bowling alleys where

    I have purchased Adobe XI Pro and created a form for entering bowling scores to submit to newspaper for my high school team.  I can not figure out how to get pdf's into my documents folder on my iPad so that I can access the files in bowling alleys where I do not have a Wi-Fi connections.  I need to be able access files without going to acrobat.com.  Help!!!@

    Post the PDF files to a web site. The browse to them in Safari on the iPad.  When you Open the files specify the Open to occur in Adobe Reader.  Then you can have/Save them in your Documents folder on the iPad.   An iPad has limited access to files otherwise.

  • How do I get PDF forms to export to excel in the desired order?

    How do I get PDF forms to export to excel in the desired order?
    Here is what I have done:
    As taken from another post:
    Choose Forms > Manage Form Data > Merge Data Files Into Spreadsheet.
    In the Export Data From Multiple Forms dialog box, click Add Files.
    In the Select file Containing Form Data dialog box, select a file format option in File Of Type option (Acrobat Form Data Files or All Files). Then locate the form files that you want to merge into the spreadsheet, select them, and click Select.
    Repeat the previous step to add form data files that are in other locations, as needed.
    Click Export. Then select a folder and filename for the spreadsheet, and click Save.
    In the Export Progress dialog box, click either View File Now to open the spreadsheet file or Close Dialog to return to Acrobat."
         The problem now is that Adobe populates Excel in ABC order of the form, based off of the name of each box in the form. For example, if my form has three text boxes, named A, B, and C, then Adobe will export to Excel as such:
    Row 1 =         A                              B                              C
    Row 2 =         data entered             data entered              data entered
    where 'data entered' is whatever the user typed into the form boxes. But what if I want a different order for exporting, and I don't want to rename my text boxes? What if I want:
    Row 1 =         C                              B                              A
    Row 2 =         data entered             data entered              data entered   ?
    Is there a way to do this in acrobat x or xi?
    Thanks

    I don't have time to test right now, but there was a change with Acrobat 10 where it exports according to the tab order, which you may have to set manually, so give that a shot. Otherwise, you'll have to process the file after it's exported if you need the fields in a particular order. This wouldn't be too difficult to do with something like a VBS or JS script in Windows.

  • How to get pdfs to export or print from Safari?

    I'm having a very serious intermittent problem getting pdf's to print or export from Safari.  Occasionally when I try and open a pdf in the browser I get an error message that Adobe Reader needs to be opened (even if it already is open) and then I need to close out Safari and re-open the link to even see the pdf.  But after that, sometimes when I try to print or export the file, all I get are blank pages.  I've tried having them downloaded or printed as images but that doesn't work either.  It's very frustrating.
    I've tried trashing Adobe Reader and re-installing but to no avail. It's gotten to the point that I often just open Preview and do a screen grab of the pdf's and save them that way.  Not the best workaround.
    Any help would be very much appreciated.
    Macbook Pro
    OSX 10.9
    Safari Version 7.0 (9537.71)
    Adobe Reader  11.0.04

    Yes every time I open the app it makes me accept the EULA or else it won't work as a reader.  That's not the problem. The problem is not being able to print or download the pdf file from the browser after I accept the EULA. Any other suggestions?

  • Search PDF annotations in Preview?

    How can you search your PDF annotations in Preview? There seem to be no options in the Search bar in Preview. I know you can browse highlighting and annotations via the Sidebar, but you can't search the annotations?
    /edit: it seems that Adobe Reader can search these annotations - select Search (CmdShiftF), then check "Include Comments").
    Can anyone enlighten me on the state of annotation search with Preview and confirm that it is missing?
    Message was edited by: gko18

    I will confirm that it seems to be missing - it does seem that the search bar on the right only searches the text of the PDF and not the annotations. Strange...
    Thanks for the tip about Adobe Reader, I will have to check that out! One of the reasons I chose to use annotations was that I have a textbook that has been scanned as picture, not OCR, and I can't search in the text, so I figured the annotations would help me locate topics later. Hopefully I will be able to use Adobe Reader for this.

  • I am looking for a way or a PDF annotator app to use in a tablet that don't allow deletion as I edit.

    Hi All, I am looking for a way or a PDF annotator app to use in a tablet that don't allow deletion as I edit. I need to use in a controlled process that don't allow user to delete or erase edits once a mistake is made or a rewrite is needed. Thank you

    See How to call Adobe Acrobat 9 APIs to OCR the PDFs through .NET reply 4.

  • New document alert: How to get PDF documents into Adobe Reader for iOS

    Opening PDF Files in Reader for iOS (iPhone and iPad) has been very helpful to many users of Adobe Reader for iOS.  However, Apple has drastically changed the user interface in iOS 7, which made the original document obsolete. 
    According to Apple Developer Support's App Store Distribution page, 89% of devices connected to the App Store are using iOS 7 during a 7‑day period ending June 29, 2014.
    Because of the exceptionally high iOS 7 adoption rate, Adobe Reader for iOS version 11.3 now supports iOS 7 only.
    Here are the new How-To documents for iOS 7.
    How to get PDF documents into Adobe Reader for iOS (iPad on iOS 7 version)
    How to get PDF documents into Adobe Reader for iOS (iPhone on iOS 7 version)
    (It had to be split into two separate documents because each contains way too many screenshots.)
    Hope these documents are as helpful as the original one.
    Please let us know if you have any feedback or suggestions on the topics for other help documents/tutorials.

    Dennis (or any Adobe rep),
    Any updates to the OP's question? I'm with a large government agency, and we're moving away from GoodReader for reasons I can't go into here, and the ability to add user-defined bookmarks within the app is a mandatory feature for the document reader we select. I have the latest version of Adobe Reader (11.6.1) installed on my government iPad, and the ability to add user-defined bookmarks still seems to be missing. Does Adobe have any plans to add this feature, or is it already present and I'm simply overlooking it?
    Thanks,
    Cam

  • How to get PDF file that has been transformed into docx into my filing system so I can work on it???

    How can I get the PDF file that was transformed into a docx file into my filing system to be able to work on it and translate it as the customer requested?

    THanks for your reply.
    Well what happens is I bought the program. It gives you a button to click,
    you log in and then a box opens up asking you to select the file, I go into
    my filing system (in Windows explorer) select the file, and the program
    converts it into docx, my choice.  I can read it there and when I try to
    copy and paste it into my file where the PDF version is saved, it behaves
    like an "image", and I can't save it.... or it saves likes something you
    save on the internet, so you have to go into internet every time you want
    to see it.    I have also pressed any amount of buttons to see if it will
    give me the option to save it any other way, and have found nothing.  What
    I would need is a file in docx.format that I can edit.  People send me
    things in PDF and sometimes I can just copy it off the PDF file and save it
    in WOrd, then I can translate it for them. But sometimes the PDF file
    doesnt allow me to copy the text.  If it is in image form, I cannot work on
    it.  It means printing it, so I can copy type it into Word... and for that
    I certainly wouldnt need to buy a program.  Its just double the work and
    ends up that the job takes twice as long.!
    Sorry  if I am a bit dumb with informatics.  But I simply could not find
    any way whatever to  copy the PDF file that was transformed into Word, in a
    format that would enable me to edit it.
    Kindest regards,
    Margery
    2013/12/2 Test Screen Name <[email protected]>
        Re: How to get PDF file that has been transformed into docx into my
    filing system so I can work on it???
    created by Test Screen Name<http://forums.adobe.com/people/TestScreenName>in *Adobe
    ExportPDF* - View the full discussion<http://forums.adobe.com/message/5890871#5890871

  • How do i get pdf through the email app on an iphone?

    A customer of mine was griping that he can't get a pdf file to open on his iphone.
    so i sent him image files to try. All files are small of course.
    I thought he was just a whiner, but i tested it, and I also cannot get pdf files or jpeg files to mail to my own phone.
    the pdf doesn't even show up to download or anything. and the image screenclips emails aren't even received.
    Is this something that the iphone just can't do? seems kind of basic.

    If you scroll to the bottom of the eMail, it should be there in a little icon. Otherwise you may have a problem with your eMail host.

  • PDF Annotation in SharePoint

    I have notice that it is not possible to add comments to PDF documents stored in SharePoint 2013. Do you know any workarounds, tools or best practices for PDF Annotation in SharePoint?
    Best regards,
    Olafur Johannsson

    One way to annotate PDF file in SharePoint is to check it out to local drafts.  
    To accomplish that you need to enable edit by changing  PDF mapping in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\XML\DOCICON.xml from <Mapping Key="pdf" Value="icpdf.png" OpenControl=""/> to <Mapping
    Key="pdf" Value="icpdf.png" EditText="Foxit Reader" OpenControl="SharePoint.OpenDocuments"/> and restart IIS.
    The only browser that allows local checkout is Internet Explorer (IE TAB works as well), remember to check use my local drafts.
    I have not found any other way to do it, Adobe solution in Adobe Reader 11 Pro does not work and an ran into problems using Foxit solution, this solution has similar complexity for user as Foxit solution if their user manuals are correct.

  • Getting pdf files into ibooks?

    I have the latest version of itunes and the latest version of ibooks on my iphone when I connect my iPhone to the macbook pro There is a books tab in itunes but there is no way to add pdf files or documents to it I tried dragging and dropping and nothing happens and there is no buttons for adding documents can someone inform me how to get pdfs on there?

    nevermind figured it out myself there is a books section on the left side of itunes and thats how you add them in there

Maybe you are looking for

  • Is there any alternative to GUI_DOWNLOAD  other than  WS_DOWNLOAD?

    Hi All, Is there any alternative FM other than GUI_DOWNLOAD and WS_DOWNLOAD?I need to download a PDF file to a network drive. Thanks in Advance, Anjaly

  • Not Getting Benifit Plan in a rule -- Please help urgent

    Hi Gurus, I need to query the benifit plan and need to override the system calculated values in certain conditions. But I am not able to query the benifit plan in a rule Made a rule like this   D TABLEP0169VARGBBPLAN &&&&        CONTINUE   0381 AMT=&

  • Audio-visual synching

    im just getting to grips with my new macbook pro and final cut express. have a fairly basic problem with the latter as when i capture video, the video and audio are not in synch when played back. the video runs about four five seconds after the audio

  • Why does it zoom a site in or out, and how to I change it back?

    ''locking as a duplicate - https://support.mozilla.com/en-US/questions/816730'' ok, here is the thing. I have a Dell laptop, and i use firefox all the time. but recently had a problem, it will zoom out on a site, and wont go back! how do i get it bac

  • Screen flickers in ICWC

    Hi, We are on SAP 5.0, and we have EIC implemen ted with category modeler Now, we have a issue, when we change category from a dropdown list the whole screen flickers, then disappears and takes a while to come back up. Does any one know why this occu