This is not really a bug. Instead of "new Rectangle(474,35,582,20)" use
"new Rectangle(474,20,582,35)". The next release will normalize the
rectangle, just in case.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Wednesday, October 18, 2006 7:04 AM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Problem with gray Button
>
> Hi list,
>
> here ist my example. If I execute this code I get a gray button on my
> pdf, like that one I attached with this email.
> The button is only gray, an no text is visible.
> Any suggestions to solve my problem?
>
> CODE:
>
> PdfReader reader;
> try {
> reader = new PdfReader("c:\\010054.pdf");
> FileOutputStream fos = new
> FileOutputStream("c:\\123125_" +
> String.valueOf(System.currentTimeMillis()) + ".pdf");
> PdfStamper stamp = new PdfStamper(reader, fos);
> PdfWriter writer = stamp.getWriter();
>
> PushbuttonField delete = new PushbuttonField(writer, new
> Rectangle(474,35,582,20), "delete");
>
> delete.setFontSize(12);
> delete.setText("DeleteButton");
> delete.setBackgroundColor(Color.GRAY);
> delete.setBorderColor(Color.BLACK);
> delete.setTextColor(Color.BLACK);
>
> PdfFormField ff = delete.getField();
> PdfAction action =
> PdfAction.createSubmitForm("http://localhost/", null, 0);
> ff.setAction(action);
> stamp.addAnnotation(ff, 1);
> stamp.close();
> } catch (IOException e) {
> e.printStackTrace();
> } catch (DocumentException e) {
> e.printStackTrace();
> }
>
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
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
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions