Hi,
I want to add header to an existing pdf. I am using the following code,
but the text is always added at bottom of each page not at the top.
int n= reader.getNumberOfPages();
stamp = new PdfStamper
(reader, new FileOutputStream(desFile));
for(int i=1; i<=n; i++){
PdfContentByte under =
stamp.getUnderContent(i);
PdfContentByte over =
stamp.getOverContent(i);
BaseFont bf =
BaseFont.createFont(
BaseFont.TIMES_BOLD,
BaseFont.WINANSI,
BaseFont.NOT_EMBEDDED);
PdfTemplate tp =
over.createTemplate(100, 100);
over.addTemplate(tp, 80, 700);
over.beginText();
over.setFontAndSize(bf, 14);
over.setTextMatrix(100, 100);
over.showText("Page "+i+"/"+n);
over.endText();
PdfImportedPage page = stamp.getImportedPage
(reader, i);
}
----------------------------------------------------------
Le présent message, ainsi que les pièces ou annexes qui s'y trouvent
éventuellement jointes, s'adressent exclusivement à celles des personnes
qu'ils désignent comme destinataires. Constituant de ce fait une
correspondance privée à caractère confidentiel, leur contenu est protégé
par le secret des correspondances émises, transmises ou reçues par la voie
des télécommunications. Si ce message électronique vous est parvenu
fortuitement, veuillez avoir l'obligeance de le détruire, puis d'en aviser
l'expéditeur dans les meilleurs délais.
The Information in this e-mail belongs to Sanofi-Synthelabo, is intended
for the use of the individual or entity to which it is addressed, and may
contain information that is privileged, confidential, or exempt from
disclosure under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or use of,
or reliance on, the contents of this e-mail is prohibited. If you have
received this e-mail in error, please notify us immediately by replying
back to the sending e-mail address, and delete this e-mail message from
your computer.
----------------------------------------------------------
-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions