Yes, not really an iText question. Why don't you pass the request object
into the PdfPageSignature constructor?
Brian
On 9/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Hi Bruno and Paul,
>
> I have this code that produces an onEndPage event (i.e. putting the page
> number) on each page. But now I need a signature block and everything,
> anyway the question is: With this void method, how can I get a reference to
> my request? I need to instantial words in the correct language, etc...
> maybe this a bit more of a JAva question than iText, but I just don't
> understand how the onEndPage works with only two parameters
>
> With this void method, how can I get a reference to my request?
>
> *public* *class* PdfPageSignature *extends* PdfPageEventHelper {
>
> /**
> * [EMAIL PROTECTED]
> com.lowagie.text.pdf.PdfPageEventHelper#onEndPage(
> com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document)
> */
> *public* *void* onEndPage(PdfWriter writer, Document document) {
>
> MessageResources messageResources = (MessageResources)
> request.getAttribute(Globals.MESSAGES_KEY);
> HROnlineLocale hrOnlineLocale = *new*HROnlineLocale(request);
> *try* {
> Rectangle page = document.getPageSize();
> String text = "page "+ writer.getPageNumber();
> String employeeInitials =
> messageResources.getMessage(hrOnlineLocale.getLocaleLocale(), "
> label.employee.initials");
> PdfPTable footer = *new* PdfPTable(2);
>
> PdfPCell footerCellRight = *new*
> PdfPCell(*new*Phrase(text,
> PdfUtils.getBlack(9)));
> footerCellRight.setBorder(0);
> footerCellRight.setHorizontalAlignment(2);
>
> PdfPCell footerCellLeft = *new*
> PdfPCell(*new*Phrase(employeeInitials,
> PdfUtils.getBlack(9)));
> footerCellLeft.setBorder(0);
> footerCellLeft.setHorizontalAlignment(0);
>
>
> footer.addCell(footerCellLeft);
> footer.addCell(footerCellRight);
> footer.setTotalWidth(page.width() -
> document.leftMargin() - document.rightMargin());
> footer.writeSelectedRows(0, -1,
> document.leftMargin(), document.bottomMargin(),writer.getDirectContent());
>
> }
> *catch* (Exception e) {
> *throw* *new* ExceptionConverter(e);
> }
> }
> }
> ------------------------------
> *Rémi R. Paquette*
> Developer
> Tel: (613) 748-4041
> Email: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> 700 Montreal Road, Ottawa, Ontario, K1A 0P7
> Canada Mortgage and Housing Corporation (CMHC)*
> **http://www.cmhc.ca* <http://www.cmhc.ca/> *Rémi R. Paquette*
> Développeur
> Téléphone : (613) 748-4041
> Courriel : [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> 700 chemin Montréal, Ottawa (Ontario) K1A 0P7
> Société canadienne d'hypothèques et de logement (SCHL)*
> **http://www.schl.ca* <http://www.schl.ca/>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/