As always it's a good idea to see what Acrobat does. Here's what you want:
PdfAnnotation annot = PdfAnnotation.createText(writer, new Rectangle(200,
200-22, 220, 200), "title", "message", false, "Comment");
String appText = "1 1 0.5 rg 0 G 0 i 4 M 1 j 1.0479 9.7871 m 1.0479 16.8164
l 3.9346 19.7031 l 16.1104 19.7031 l "
+ "18.9971 16.8164 l 18.9971 9.6611 l 16.1104 6.7744 l 14.1021 6.7744 l
14.1021 1 l 8.3281 6.6484 l 3.9351 6.6484 l "
+ "1.0479 9.7871 l h B 2 w 1 J 6.1089 13.2686 m 13.9331 13.2686 l S";
annot.setColor(new Color(1f, 1f, 0.5f));
PdfAppearance app = writer.getDirectContent().createAppearance(20, 22);
app.setLiteral(appText);
annot.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, app);
PdfAnnotation popup = PdfAnnotation.createPopup(writer, new Rectangle(200,
150, 250, 200), null, true);
annot.setPopup(popup);
writer.addAnnotation(annot);
writer.addAnnotation(popup);
Best Regards,
Paulo Soares
----- Original Message -----
From: "Mike Christoff" <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, June 09, 2004 19:02
Subject: RE: [iText-questions] Annotations vs Notes
> Ah, ok, it turned out it was a case problem. I thought I tried
> "Comment" captialized, but I guess I didn't.
>
> It's still not exactly at the effect I want though. I would really
> like to for the comment icon to be yellow. This seems trivial, but
> for the application I am writing it is very important to draw the
> attention to the comment, and I think the yellow really accomplishes
> this.
>
> Is there anyway to do this?
>
> Thanks for all the help.
>
> --- Paulo Soares <[EMAIL PROTECTED]> wrote:
> > Are you calling writer.addAnnotation(annot)?
> >
> > Best Regards,
> > Paulo Soares
> >
> > > -----Original Message-----
> > > From: Mike Christoff [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, June 07, 2004 10:31 PM
> > > To: Paulo Soares; [EMAIL PROTECTED]
> > > Subject: Re: [iText-questions] Annotations vs Notes
> > >
> > > I can't seem to get the annotation to appear on the page. This is
> > > what I'm doing:
> > >
> > > PdfAnnotation.createText(writer, new Rectangle(200, 200, 250,
> > 250),
> > > "title", "message", true, "Note");
> > >
> > > Do I need to do anything else here? (Obviously I've created the
> > > writer before hand.)
> > >
> > > Basicaly I'm trying to replace the following line:
> > >
> > > document.add(new Annotation("title", "message", 200, 200, 250,
> > 250
> > > ));
> > >
> > > Thanks.
> > >
> > > --- Paulo Soares <[EMAIL PROTECTED]> wrote:
> > > > It can be done with iText but only if creating the annotation
> > with
> > > > PdfAnnotation.createText(). In this case you can change the
> > icon to
> > > > one of:
> > > > Comment, Key, Note, Help, NewParagraph, Paragraph or Insert.
> > > >
> > > > Best Regards,
> > > > Paulo Soares
> > > >
> > > > ----- Original Message -----
> > > > From: "Mike Christoff" <[EMAIL PROTECTED]>
> > > > To: "Leonard Rosenthol" <[EMAIL PROTECTED]>;
> > > > <[EMAIL PROTECTED]>
> > > > Sent: Friday, June 04, 2004 21:33
> > > > Subject: Re: [iText-questions] Annotations vs Notes
> > > >
> > > >
> > > > > > The icon displayed in the PDF is actually
> > > > user-selectable.
> > > > > > If you
> > > > > > right/control-click on ANY comment/note/annotation and then
> > > > choose
> > > > > > "Properties" you can then pick from a selection of icons to
> > > > use.
> > > > > >
> > > > > > I believe that iText uses one that simulate the
> > > > "default"
> > > > > > Acrobat
> > > > > > value - but you can actually use ANY graphic...
> > > > >
> > > > > I would like to have the default icon be the yellow bubble.
> > Can I
> > > > do
> > > > > this through itext, or would I have to go through the pdf by
> > hand
> > > > and
> > > > > and change each of the icons?
> > > > >
> > > > > > Sure you can! There is a nice big button called
> > > > > > "Commenting" in
> > > > > > your Acrobat toolbar - at least in Standard and
> > Professional.
> > > > (not
> > > > > > in
> > > > > > Reader...)
> > > > >
> > > > > I realized this button was there, but what I was referring to
> > was
> > > > > what I thought was an annotation (now know this is just the
> > > > default
> > > > > icon for a comment).
> > > > >
> > > > > Thanks Again.
> > > > >
> > > > > --- Leonard Rosenthol <[EMAIL PROTECTED]> wrote:
> > > > > > At 02:49 PM 6/4/2004, Mike Christoff wrote:
> > > > > > >I noticed that in Acrobat 6.0 (possibly earlier versions,
> > but
> > > > I
> > > > > > only
> > > > > > >have 6.0) that you can add something called a "note"
> > (looks
> > > > like a
> > > > > > >yellow thought bubble).
> > > > > >
> > > > > > Commenting and Annotating (same thing) have been
> > in
> > > > > > Acrobat since
> > > > > > version 4, though only with 5 & 6 have Adobe really pushed
> > it
> > > > as a
> > > > > > feature. The Note is just one of about 10 different types
> > of
> > > > > > annotations/comments that you can apply to a PDF.
> > > > > >
> > > > > >
> > > > > > >I looked through the itext api, but all I
> > > > > > >could find was something called an "annotation". These
> > seem to
> > > > do
> > > > > > >very similar things. In fact they seem almost identical,
> > > > except
> > > > > > that
> > > > > > >the icon for an annotation is a little white tab, whereas
> > the
> > > > icon
> > > > > > >for a note is the yellow bubble.
> > > > > >
> > > > > > The icon displayed in the PDF is actually
> > > > user-selectable.
> > > > > > If you
> > > > > > right/control-click on ANY comment/note/annotation and then
> > > > choose
> > > > > > "Properties" you can then pick from a selection of icons to
> > > > use.
> > > > > >
> > > > > > I believe that iText uses one that simulate the
> > > > "default"
> > > > > > Acrobat
> > > > > > value - but you can actually use ANY graphic...
> > > > > >
> > > > > >
> > > > > > >Also, I noticed that you can't actually create a
> > annotation
> > > > with
> > > > > > >Acrobat 6.0.
> > > > > >
> > > > > > Sure you can! There is a nice big button called
> > > > > > "Commenting" in
> > > > > > your Acrobat toolbar - at least in Standard and
> > Professional.
> > > > (not
> > > > > > in
> > > > > > Reader...)
> > > > > >
> > > > > >
> > > > > > Leonard
> > > > > >
> > > > > >
> > > > >
> > > >
> > > --------------------------------------------------------------
> > > ------------
> > > > -
> > > > > > Leonard Rosenthol
> > > > > > <mailto:[EMAIL PROTECTED]>
> > > > > > Chief Technical Officer
> > > > > > <http://www.pdfsages.com>
> > > > > > PDF Sages, Inc. 215-938-7080
> > > > (voice)
> > > > > > 215-938-0880
> > > > (fax)
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > __________________________________
> > > > > Do you Yahoo!?
> > > > > Friends. Fun. Try the all-new Yahoo! Messenger.
> > > > > http://messenger.yahoo.com/
> > > > >
> > > > >
> > > > > -------------------------------------------------------
> > > > > This SF.Net email is sponsored by the new InstallShield X.
> > > > > From Windows to Linux, servers to mobile, InstallShield X is
> > the
> > > > one
> > > > > installation-authoring solution that does it all. Learn more
> > and
> > > > > evaluate today! http://www.installshield.com/Dev2Dev/0504
> > > > > _______________________________________________
> > > > > iText-questions mailing list
> > > > > [EMAIL PROTECTED]
> > > > > https://lists.sourceforge.net/lists/listinfo/itext-questions
> > > >
> > >
> > >
> > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Friends. Fun. Try the all-new Yahoo! Messenger.
> > > http://messenger.yahoo.com/
> > >
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Friends. Fun. Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions