Thanks Paulo. I changed my code to calculate the footer location by
considering the cropbox.
float footerLocation = reader.getCropBox(i).bottom() + 10;
Now, it works with all the documents.


Paulo Soares wrote:
> 
>  
> 
>> -----Original Message-----
>> From: [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED] On 
>> Behalf Of jrocker
>> Sent: Friday, March 16, 2007 1:57 PM
>> To: [email protected]
>> Subject: Re: [iText-questions] Footer issue
>> 
>> 
>> I understand, but how exactly can I find these offsets?
>>
> 
> The media box and crop box dimensions.
> 
> Paulo
>  
>> 
>> Paulo Soares wrote:
>> > 
>> > 
>> > ----- Original Message ----- 
>> > From: "jrocker" <[EMAIL PROTECTED]>
>> > To: <[email protected]>
>> > Sent: Thursday, March 15, 2007 6:59 PM
>> > Subject: [iText-questions] Footer issue
>> > 
>> > 
>> >>
>> >> Hi,
>> >> The following code prints text on the bottom of the pdf. 
>> It works for 90% 
>> >> of
>> >> the documents.
>> > 
>> > Thae other 10% have different page dimensions, offsets or 
>> cropboxes. You 
>> > have to take that into account.
>> > 
>> > Paulo
>> > 
>> >> But some docs fai(docs with pagesize.top=1224)l. Any help 
>> would be great
>> >>
>> >> PdfReader reader = new PdfReader(data);
>> >> PdfStamper stamp = new PdfStamper(reader, new
>> >> FileOutputStream(outputFileName));
>> >> PdfContentByte cByte;
>> >>
>> >> cByte = stamp.getOverContent(i);
>> >> cByte.beginText();
>> >> cByte.setTextMatrix(30, 30);
>> >> cByte.setFontAndSize(bf, 10);
>> >> float ht = reader.getPageSize(i).height();
>> >> ht = (float) (.056*ht) ;
>> >> cByte.showTextAligned(PdfContentByte.ALIGN_CENTER, 
>> showText, width / 2, 
>> >> ht,
>> >> 0);
>> >>
>> >> cByte.endText();
>> >> stamp.close();
>> >>
>> >> Thanks!
> 
> 
> 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.
> 
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Footer-issue-tf3410266.html#a9517117
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to