The little yellow speech balloon thing is something Acrobat/Reader draws for
specific kinds of annotations, I certainly don't have a list. It's not part of
the annotations' appearance streams. The paperclip icon is a direct result of
setting the PdfAnnotation's "Name" key to "Paperclip".
I don't think you can avoid the yellow balloon thingy, but the paperclip is
optional.
The ".put( PdfName.NAME, ... )" call is a call from PdfAnnotation's direct
superclass, "PdfDictionary".
A dictionary is just a bunch of key/value pairs.
Keys are always PdfNames, and PdfName has a huge list of predefined constants
for the vast majority of the dictionary keys you might need. This constant
happens to be named "NAME", which might be a tad confusing.
The values can be anything descended from PdfObject. In this case it's a
PdfString, with the value "Paperclip".
According to the PDF Reference, there are four "named" appearances that
Conformant Viewers must support, "Graph", "PushPin", "Paperclip", and "Tag".
PushPin is the default if no name is specified. And you can make up your own
so long as you provide an appearance stream (or are willing to put up with the
question mark Acrobat/Reader comes up with when it doesn't know how to draw an
annotation).
Any time iText doesn't support some feature in a more direct fashion, folks
like myself pull out our copies of the PDF reference and start making
lower-level PdfDictionary (and PdfArray, PdfString, and so forth) calls. iText
can do just about anything the PDF reference defines, but the higher level
support is often missing from the nooks and crannies, such as this one.
OTOH, now that you know, it's easy to call "myAnnot.put(PdfName.NAME, new
PdfString("Graph");" or whatever it is that you want. Acrobat/Reader will whip
up the annotation appearance for you. They're not a part of
"movie_annotations_3.pdf", they were generated when the file was opened.
--Mark Storer
Senior Software Engineer
Cardiff.com
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
> -----Original Message-----
> From: Sebastian Müller [mailto:[email protected]]
> Sent: Thursday, December 30, 2010 11:59 AM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Add reference in text to attached file
>
> Thanks a lot for your help! Now I was able to solve my
> problem by looking again at the code. I've made a terrible
> mistake. But I have one question left. In the document of the example
>
> http://examples.itextpdf.com/results/part2/chapter07/movie_ann
> otations_3.pdf
>
> one can see a paperclip and a small textbox above the
> paperclip. Why are there these two symbols? I think it's
> because of this tow methods?
>
> PdfAnnotation annotation =
> PdfAnnotation.CreateFileAttachment(writer, null,
> name, null,
> name,
> name);
> annotation.Put(PdfName.NAME, new
> PdfString("Paperclip"));
>
> Are they described anywhere?
>
> ----- Ursprüngliche Mail -----
> Von: "1T3XT" <[email protected]>
> An: "Post all your questions about iText here"
> <[email protected]>
> Gesendet: Donnerstag, 30. Dezember 2010 10:17:48
> Betreff: Re: [iText-questions] Add reference in text to attached file
>
> Op 30/12/2010 8:20, Sebastian Müller schreef:
> > It is embedded in the document, but clicking doesnt anything
>
> Yesterday, I referred to an online sample.
> Were you able to compile and execute that sample, and did it work?
>
> What if you adapt that sample using your file?
> Do you see the annotation? (For instance a paperclip?)
>
> It would also help if you posted a very simple PDF and the
> code to reproduce the problem so that we can see what you mean.
>
> (Because the online example works, doesn't it?)
>
> --------------------------------------------------------------
> ----------------
> Learn how Oracle Real Application Clusters (RAC) One Node
> allows customers to consolidate database storage, standardize
> their database environment, and, should the need arise,
> upgrade to a full multi-node Oracle RAC database without
> downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> 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
>
> --
> Sebastian
>
> --------------------------------------------------------------
> ----------------
> Learn how Oracle Real Application Clusters (RAC) One Node
> allows customers to consolidate database storage, standardize
> their database environment, and, should the need arise,
> upgrade to a full multi-node Oracle RAC database without
> downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> 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
>
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
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