Since posting my question, my code has changed some, but I found a solution
in another thread. The key was using PdfStamper.getOverContent(1) instead
of PdfStamper.getWriter().getDirectContent().
- John
|---------+--------------------------------------------->
| | itext-questions-request@(protected)|
| | ceforge.net |
| | Sent by: |
| | itext-questions-admin@(protected)|
| | forge.net |
| | |
| | |
| | 06/02/2005 11:07 PM |
| | Please respond to itext-questions |
| | |
|---------+--------------------------------------------->
>--------------------------------------------------------------------------------------------------------------------------------------------------|
| |
| To: itext-questions@(protected) |
| cc: |
| Subject: iText-questions digest, Vol 1 #2945 - 11 msgs |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
Send iText-questions mailing list submissions to
itext-questions@(protected)
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/itext-questions
or, via email, send a message with subject or body 'help' to
itext-questions-request@(protected)
You can reach the person managing the list at
itext-questions-admin@(protected)
When replying, please edit your Subject line so it is more specific
than "Re: Contents of iText-questions digest..."
Today's Topics:
1. adding an image to a push button field (John.Sanda@(protected))
2. Is it possible to deep lists in word (Chirdeep Sharma)
3. font file .lst (Franck JACOB)
4. Custom Properties (Roger Misteli)
5. RE: Custom Properties (Paulo Soares)
6. RE: font file .lst (Paulo Soares)
7. RE: font file .lst (Paulo Soares)
8. font file .lst (Franck JACOB)
9. Re: font file .lst (Franck JACOB)
10. Re: Is it possible to deep lists in word (Mark Hall)
11. Re: printing a pdf document (Carsten Hammer)
--__--__--
Message: 1
To: itext-questions@(protected)
From: John.Sanda@(protected)
Date: Thu, 2 Jun 2005 09:28:30 -0400
Subject: [iText-questions] adding an image to a push button field
I have looked at several similar posts, but I have been unable to add an
image to a push button field. I have a PDF template with a push button
field called labelField. I have been unsuccessful in several attempts at
adding an image to the button. Here is latest code that I have tried:
// start code to add image to push button field
PdfDictionary buttonDict =
(PdfDictionary)PdfReader.getPdfObject(reader.getAcroForm().getRefByName("labelField"));
PdfArray rect =
(PdfArray)PdfReader.getPdfObject(buttonDict.get(PdfName.RECT));
ArrayList list = rect.getArrayList();
PdfRectangle pdfRect = new PdfRectangle(getFloatValue(list, 0),
getFloatValue(list, 1), getFloatValue(list, 2), getFloatValue(list, 3));
PdfWriter writer = stamper.getWriter();
PdfContentByte contentByte = writer.getDirectContent();
contentByte.moveTo(0, 0);
Image image = Image.getInstance(new
LabelGenerator().generateLabel(labelDataProvider));
PdfFormField field = PdfFormField.createPushButton(writer);
PdfAppearance appearance = contentByte.createAppearance(image.width(),
image.height());
appearance.addImage(image, image.width(), 0, 0, image.height(), 0, 0);
field.setWidget(new Rectangle(pdfRect.left(), pdfRect.bottom(),
pdfRect.top(), pdfRect.right()), PdfAnnotation.HIGHLIGHT_NONE);
field.setFieldName("labelField");
field.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, "flatState",
appearance);
stamper.addAnnotation(field, 1);
// end code to add image to push button field
// helper method to extract float value
private float getFloatValue(List list, int index) {
PdfNumber pdfNumber = (PdfNumber)list.get(index);
return pdfNumber.floatValue();
}
// end helper method
I would greatly appreciate any insight into what I am doing wrong or if
someone can point me to some examples. Thanks in advance!
- John
********************************************************************************
Unauthorized interception of this communication could be a
violation of Federal and State Law. This communication and
any files transmitted with it are confidential and may contain
protected health information. This communication is solely
for the use of the person or entity to whom it was addressed.
If you are not the intended recipient, any use, distribution,
printing or acting in reliance on the contents of this message
is strictly prohibited. If you have received this message
in error, please notify the sender and destroy any and all copies.
Thank you.
*******************************************************************************
--__--__--
Message: 2
To: itext-questions@(protected)
From: Chirdeep Sharma <csharma@(protected)>
Date: Thu, 2 Jun 2005 12:58:44 +0000 (UTC)
Subject: [iText-questions] Is it possible to deep lists in word
This kind of list creation works in PDF but the same code does not work in
word.
1.1 (Section number)
A.
1.
a.
2.
B.
1.
a.
b.
i.
ii.
2.
1.2 (Section number).
Is there a way to create this kind of list in word using itext?
Thanks,
Chirdeep.
--__--__--
Message: 3
From: Franck JACOB <franck.jacob@(protected)>
Organization: Speedinfo
To: itext-questions@(protected)
Date: Thu, 2 Jun 2005 16:10:23 +0200
Subject: [iText-questions] font file .lst
Hello,
I have to embed font in my pdf, I have a font file named 'AdobeFnt.lst' ;
is this file format supported by iText ?
--__--__--
Message: 4
Date: Thu, 02 Jun 2005 16:25:27 +0200
From: Roger Misteli <roger.misteli@(protected)>
To: "itext" <itext-questions@(protected)>
Subject: [iText-questions] Custom Properties
Hi=20
My applicatioon would like to have access (reading and writing) to Adobe
Acrobat's "Custom Properties" (that is, "Document Properties -> Custom
tab -> Custom properties"). It looks like a hash map with key value
pairs.
Is it possible to read/write to and from these values? And to iterate
them?
Best regards and thanks
Rog
--__--__--
Message: 5
Subject: RE: [iText-questions] Custom Properties
Date: Thu, 2 Jun 2005 15:43:30 +0100
From: "Paulo Soares" <psoares@(protected)>
To: "Roger Misteli" <roger.misteli@(protected)>,
"itext" <itext-questions@(protected)>
That can be found in the info HashMap in the case of PdfReader and
PdfStamper and in the Meta class in the case of PdfWriter. Those names
live in same place as Producer or CreationDate.
Best Regards,
Paulo Soares
> -----Original Message-----
> From: itext-questions-admin@(protected)
> [mailto:itext-questions-admin@(protected)
> Behalf Of Roger Misteli
> Sent: Thursday, June 02, 2005 3:25 PM
> To: itext
> Subject: [iText-questions] Custom Properties
>=20
> Hi=20
>=20
> My applicatioon would like to have access (reading and=20
> writing) to Adobe
> Acrobat's "Custom Properties" (that is, "Document Properties -> Custom
> tab -> Custom properties"). It looks like a hash map with key value
> pairs.
>=20
> Is it possible to read/write to and from these values? And to iterate
> them?
>=20
> Best regards and thanks
> Rog
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit=20
> http://developer.yahoo.net/?fr=3Dfad-ysdn-ostg-q22005
> _______________________________________________
> iText-questions mailing list
> iText-questions@(protected)
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>=20
--__--__--
Message: 6
Subject: RE: [iText-questions] font file .lst
Date: Thu, 2 Jun 2005 15:44:16 +0100
From: "Paulo Soares" <psoares@(protected)>
To: "Franck JACOB" <franck.jacob@(protected)>,
<itext-questions@(protected)>
That's a list of Acrobat fonts, not a font.=20
> -----Original Message-----
> From: itext-questions-admin@(protected)
> [mailto:itext-questions-admin@(protected)
> Behalf Of Franck JACOB
> Sent: Thursday, June 02, 2005 3:10 PM
> To: itext-questions@(protected)
> Subject: [iText-questions] font file .lst
>=20
>=20
> Hello,
>=20
> I have to embed font in my pdf, I have a font file named=20
> 'AdobeFnt.lst' ;
>=20
> is this file format supported by iText ?
>=20
>=20
>=20
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit=20
> http://developer.yahoo.net/?fr=3Doffad-ysdn-ostg-q22005
> _______________________________________________
> iText-questions mailing list
> iText-questions@(protected)
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>=20
--__--__--
Message: 7
Subject: RE: [iText-questions] font file .lst
Date: Thu, 2 Jun 2005 17:03:53 +0100
From: "Paulo Soares" <psoares@(protected)>
To: "Franck JACOB" <franck.jacob@(protected)>,
<itext-questions@(protected)>
You need files that end in .pfb, .ttf or .otf.=20
> -----Original Message-----
> From: Franck JACOB [mailto:franck.jacob@(protected)
> Sent: Thursday, June 02, 2005 4:01 PM
> To: Paulo Soares; itext-questions@(protected)
> Subject: Re: [iText-questions] font file .lst
>=20
>=20
> yes, but font files associated with this list doesn't work...
>=20
>=20
> FontFactory.register("/fonts/GOTHIC.TTF");
> Font font =3D FontFactory.getFont("Century Gothic", BaseFont.CP1252,=20
> BaseFont.EMBEDDED, 12);
> --> ok
>=20
>=20
> FontFactory.register("/fonts/Eurostile/._Eurostile");
> Font font =3D FontFactory.getFont("Eurostile", BaseFont.CP1252,=20
> BaseFont.EMBEDDED, 12);
> --> not ok
>=20
> Eurostile is in the Acrobat list 'AdobeFnt.lst'
>=20
>=20
>=20
> Le Jeudi 02 Juin 2005 16:44, Paulo Soares a =E9crit :
> > That's a list of Acrobat fonts, not a font.
> >
> > > -----Original Message-----
> > > From: itext-questions-admin@(protected)
> > > [mailto:itext-questions-admin@(protected)
> > > Behalf Of Franck JACOB
> > > Sent: Thursday, June 02, 2005 3:10 PM
> > > To: itext-questions@(protected)
> > > Subject: [iText-questions] font file .lst
> > >
> > >
> > > Hello,
> > >
> > > I have to embed font in my pdf, I have a font file named
> > > 'AdobeFnt.lst' ;
> > >
> > > is this file format supported by iText ?
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by Yahoo.
> > > Introducing Yahoo! Search Developer Network - Create apps=20
> using Yahoo!
> > > Search APIs Find out how you can build Yahoo! directly=20
> into your own
> > > Applications - visit
> > > http://developer.yahoo.net/?fr=3Doffad-ysdn-ostg-q22005
> > > _______________________________________________
> > > iText-questions mailing list
> > > iText-questions@(protected)
> > > https://lists.sourceforge.net/lists/listinfo/itext-questions
>=20
> --=20
> Franck JACOB
> D=E9veloppeur Projet OpenSI
> -
> Soci=E9t=E9 SpeedInfo
> 12, rue de la Tuilerie
> 38170 Seyssinet-Pariset
> Tel: 04 76 21 15 85
> -
> http://www.speedinfo.fr
> http://www.opensi.org
>=20
>=20
>=20
>=20
>=20
>=20
--__--__--
Message: 8
From: Franck JACOB <franck.jacob@(protected)>
Organization: Speedinfo
To: itext-questions@(protected)
Date: Thu, 2 Jun 2005 16:35:20 +0200
Subject: [iText-questions] font file .lst
Hello,
I have to embed font in my pdf, I have a font file named 'AdobeFnt.lst' ;
is this file format supported by iText ?
--__--__--
Message: 9
From: Franck JACOB <franck.jacob@(protected)>
Organization: Speedinfo
To: "Paulo Soares" <psoares@(protected)>,
<itext-questions@(protected)>
Subject: Re: [iText-questions] font file .lst
Date: Thu, 2 Jun 2005 17:01:08 +0200
yes, but font files associated with this list doesn't work...
=46ontFactory.register("/fonts/GOTHIC.TTF");
=46ont font =3D FontFactory.getFont("Century Gothic", BaseFont.CP1252,=20
BaseFont.EMBEDDED, 12);
=2D-> ok
=46ontFactory.register("/fonts/Eurostile/._Eurostile");
=46ont font =3D FontFactory.getFont("Eurostile", BaseFont.CP1252,=20
BaseFont.EMBEDDED, 12);
=2D-> not ok
Eurostile is in the Acrobat list 'AdobeFnt.lst'
Le Jeudi 02 Juin 2005 16:44, Paulo Soares a =E9crit :
> That's a list of Acrobat fonts, not a font.
>
> > -----Original Message-----
> > From: itext-questions-admin@(protected)
> > [mailto:itext-questions-admin@(protected)
> > Behalf Of Franck JACOB
> > Sent: Thursday, June 02, 2005 3:10 PM
> > To: itext-questions@(protected)
> > Subject: [iText-questions] font file .lst
> >
> >
> > Hello,
> >
> > I have to embed font in my pdf, I have a font file named
> > 'AdobeFnt.lst' ;
> >
> > is this file format supported by iText ?
> >
> >
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by Yahoo.
> > Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> > Search APIs Find out how you can build Yahoo! directly into your own
> > Applications - visit
> > http://developer.yahoo.net/?fr=3Doffad-ysdn-ostg-q22005
> > _______________________________________________
> > iText-questions mailing list
> > iText-questions@(protected)
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
=2D-=20
=46ranck JACOB
D=E9veloppeur Projet OpenSI
=2D
Soci=E9t=E9 SpeedInfo
12, rue de la Tuilerie
38170 Seyssinet-Pariset
Tel: 04 76 21 15 85
=2D
http://www.speedinfo.fr
http://www.opensi.org
--__--__--
Message: 10
From: Mark Hall <mhall@(protected)>
To: itext-questions@(protected)
Subject: Re: [iText-questions] Is it possible to deep lists in word
Date: Thu, 2 Jun 2005 22:15:00 +0200
Cc: Chirdeep Sharma <csharma@(protected)>
--nextPart1747007.2ch89LuLTC
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
On Thursday 02 June 2005 14:58, Chirdeep Sharma wrote:
> This kind of list creation works in PDF but the same code does not work
in
> word.
> Is there a way to create this kind of list in word using itext?
No. The RtfWriter2 only supports bulleted lists and lists with arabic
numbe=
rs.
Greetings,
Mark
=2D-=20
Happiness is a hard disk.
My GPG public key is available at:
http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc
--nextPart1747007.2ch89LuLTC
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iQEVAwUAQp9ox0ks8txBCICQAQKc2gf9F26aGeAcUfhQkuC4Yf/FsL/x2rENM1Oq
3k4Pu9gcsimkOG4LEXv6moHh3Z6nxliIBHMEm3lmzrRwVe35w1gMlexDEsURY3it
HW22CFq5Mk+6U2ObwPte+gqYDEhNE1/YmiDL3poeqN2ZBkDgybkwx6NUbieZ0h2x
wMgpvcSYpYuelYDeMTvAyVLPjqr5S5nWP8/tXiudsuU4y2Tdpd7ZaSSN/Pp6Y1wS
911EHV9v96Ft93E0P8rtuwn7aDMEuJEwM/E6mGK+4kXh4ENgN7ypOVbGkLgHuzc6
3CfycJRuv5C1x19PmSnpoTzAIfARa51j1c5ao9wL3qrdN8/dCVXawg==
=mU1G
-----END PGP SIGNATURE-----
--nextPart1747007.2ch89LuLTC--
--__--__--
Message: 11
To: itext-questions@(protected)
From: Carsten Hammer <Carsten.Hammer@(protected)>
Date: Thu, 02 Jun 2005 22:07:07 +0200
Subject: [iText-questions] Re: printing a pdf document
David Graf wrote:
> Is it possible to print a pdf document directly from java using itext?
>
I most of the time use a lpr client that is implemented in java. That
way you can even adjust printer settings if your printer allows it. Of
course not all printers allow to be feed with pdf but many modern do.
Best regards,
Carsten
--__--__--
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
End of iText-questions Digest
********************************************************************************
Unauthorized interception of this communication could be a
violation of Federal and State Law. This communication and
any files transmitted with it are confidential and may contain
protected health information. This communication is solely
for the use of the person or entity to whom it was addressed.
If you are not the intended recipient, any use, distribution,
printing or acting in reliance on the contents of this message
is strictly prohibited. If you have received this message
in error, please notify the sender and destroy any and all copies.
Thank you.
*******************************************************************************
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions