You need to listen for an event that is fired after a given element is
positioned.  The old stand-by:
 
element.setGenericTag('foo");
 
Then you extend PdfPageEventHelper
<http://api.itextpdf.com/com/itextpdf/text/pdf/PdfPageEventHelper.html>
and override onGenericTag
<http://api.itextpdf.com/com/itextpdf/text/pdf/PdfPageEventHelper.html#o
nGenericTag(com.itextpdf.text.pdf.PdfWriter,%20com.itextpdf.text.Documen
t,%20com.itextpdf.text.Rectangle,%20java.lang.String)> .  The "rect"
param will be the absolute position of the tagged element.  There are a
number of other events in PdfPageEvent you might use instead, but this
is the fairly common.
 
--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 
 


________________________________

        From: Greg Dorrell [mailto:[email protected]] 
        Sent: Monday, September 13, 2010 3:23 AM
        To: [email protected]
        Subject: [iText-questions] Inserting an embedded SWF into a
Document
        
        

        Hi,
        I'm looking for the best way to put an embedded SWF into a
document (the Annotation class only seems to support referenced PDFs). 

        I can use a PdfAnnotation to embed a SWF, but then I have to
insert it directly with the PdfWriter. I'm looking to avoid absolute
positioning though. Another option would be inserting something into the
document which I can then retrieve the position of so that the
PdfAnnotation can be inserted on top.

        I was looking at inserting an image, but the getAbsolute
positions are only available if they have been set. (Can't just insert
the image as normal and retrieve the position.)

        I've seen mentioned on the mailing list that the position of an
Annotation can be retrieved. Can anyone point me at a relevant example?

        I've also seen mention of the onGenericTag, which has an example
in Chapter 5. I'm no sure if this is applicable to what I'm trying to
do, and if it is, whether it is the best way to approach the problem.

        Any help would be much appreciated.

        Thanks,
        Greg

        No virus found in this incoming message.
        Checked by AVG - www.avg.com
        Version: 9.0.851 / Virus Database: 271.1.1/3131 - Release Date:
09/12/10 23:35:00
        

        

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to