Cool.  That's what I had been trying to do, but I'm unable to find the
itext api to do that on an image.  Probably something simple, I just can't
see it.  Can you give/point me at example code to set custom key
on com.itextpdf.text.Image?

Have tried:

image.setAdditional(new PdfDictionary());
image.getAdditional().put(new PdfName("foo"), new PdfString("bar"));

and have tried all of the other setters on image.  Then looking in rups ui
or in my extraction code looping over PdfObjects returned by
reader.getPdfObject(i), and I don't see any of them.



On Wed, Feb 13, 2013 at 12:23 PM, Leonard Rosenthol <lrose...@adobe.com>wrote:

> The way to do it is what I am telling you to do.   Custom key on the
> Xobject dictionary.   That is how it has been done for 20 years now.
>
> The Alt element is for use in helping users who require assistive
> technology (such as blind users).  Putting your value in there will screw
> them up :(
>
> Leonard
>
> From: Jason Kissinger <ja...@jasonkissinger.com>
> Reply-To: Post here <itext-questions@lists.sourceforge.net>
> Date: Wednesday, February 13, 2013 12:54 PM
> To: Post here <itext-questions@lists.sourceforge.net>
> Subject: Re: [iText-questions] Tagging content
>
> Righto, I'll get right on that.   ;-)
>
> Is there not a way to tag an object in any way so that I can pull it later?
> On Feb 13, 2013 11:46 AM, "Leonard Rosenthol" <lrose...@adobe.com> wrote:
>
>> Jason, using the Alt for an image is NOT the right way to accomplish what
>> you want.
>>
>> You should just put a custom key of your own choosing on each Xobject
>> that you wish to "mark".  This would be a second class key (as described in
>> ISO 32000-1:2008) and you'll need to register your second class extension
>> with ISO.  But that's just formality…
>>
>> Leonard
>>
>> From: Jason Kissinger <ja...@jasonkissinger.com>
>> Reply-To: Post here <itext-questions@lists.sourceforge.net>
>> Date: Wednesday, February 13, 2013 12:18 PM
>> To: Post here <itext-questions@lists.sourceforge.net>
>> Subject: [iText-questions] Tagging content
>>
>> Would the new accessibility api be appropriate for tagging an /XObject
>> (ie image) so that it can later be retrieved by test automation?  Or is
>> there something else?
>>
>> I built 5.4.0 from svn, and added accessibleAttribute to image:
>>
>> image.setAccessibleAttribute(PdfName.ALT, new PdfString("image1"));
>>
>> but then don't see anything new when I open it up (using rups and hunting
>> around with my own code).
>>
>> We embed multiple jpg and svg, which we generate, into our documents.
>>  And then have junit tests that try to find the object and assert content
>> is as expected.  I'm able to parse out the svg/jpg from pdf no problem, but
>> am not able to identify which instance I have.  Would like to tag them
>> during pdf generation so that I can extract by that tag during pdf testing.
>>
>>
>> ------------------------------------------------------------------------------
>> Free Next-Gen Firewall Hardware Offer
>> Buy your Sophos next-gen firewall before the end March 2013
>> and get the hardware for free! Learn more.
>> http://p.sf.net/sfu/sophos-d2d-feb
>> _______________________________________________
>> iText-questions mailing list
>> iText-questions@lists.sourceforge.net
>> 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
>>
>
>
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> 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
>
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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