Hi Bruno,

> PushbuttonField push = new PushbuttonField(stamp.getWriter(),new
> Rectangle(10 + xadd, pageHeight - 80, fieldwidth + xadd, 
> pageHeight - 40), buttonName + "text");
> 
> Let me know if this works,

It works fine! Thanks a lot :) 
.oO(I told you it's a simple problem *smile*...)

With this soultion I can tell you what the real fault was: I tried to
arrange the formfields from top to down - but it shoul be the other way
round ;) 


Now I bounced in another little problem:
I studied the example for creating a checkbox: 
http://itextdocs.lowagie.com/examples/com/lowagie/examples/forms/FormCheckbo
x.java
Is there a more simple way to create a default checkbox? I really don't like
to draw the images for "checked" and "not checked". ;)

I tried to create a checkbox with an AcroForm in this way: 
PdfWriter writer = stamp.getWriter();      
PdfAcroForm acroForm = writer.getAcroForm();
log.debug("acroForm: "+acroForm);
PdfFormField ff = acroForm.addCheckBox(Pdf.STATE, "false", false, 10+xadd,
pageHeight, 25, 25);      
stamp.addAnnotation(ff,1);

But I get the Exception:

java.lang.RuntimeException: Unsupported in this context. Use
PdfStamper.addAnnotation()
        at com.lowagie.text.pdf.PdfStamperImp.addAnnotation(Unknown Source)
        at com.lowagie.text.pdf.PdfAcroForm.addFormField(Unknown Source)
        at com.lowagie.text.pdf.PdfAcroForm.addCheckBox(Unknown Source)

Unfortunately I don't have other ideas how to create the checkbox. 
Could you give me hint?
Thanks in advance :)

Beate



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to