iText PDFTable overwrites Footertable

View: New views
6 Messages — Rating Filter:   Alert me  

iText PDFTable overwrites Footertable

by Jan Stanetzki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am new to itext. I usedPageEvent-Exampel
(http://itextdocs.lowagie.com/examples/com/lowagie/examples/directcontent/pageevents/EndPage.java)
for creating a table-footer. I tried to create an invoice-document with
itext, but the itemstable is very long and overwrites the footer .... Is
there any way to declare a "footer area" or sth. like that so that the
table knows "when to break"?!

Thanks,
Jan

--
Dipl.-Wirt.-Inf. Jan Stanetzki
Softwareentwickler, Datenschutzbeauftragter

Gorilla Concept GmbH · Am Graswege 6 · 30169 Hannover
Fon +49 (0) 511 / 300 345-55
Fax +49 (0) 511 / 300 345-45
E-Mail stanetzki@...
Web www.gorilla-concept.de

Handelsregister HRB 200898 · Amtsgericht Hannover
Geschäftsführung Oliver Hübsch · Dirk Arnemann



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

ex1.jpg (24K) Download Attachment

Re: iText PDFTable overwrites Footertable

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Increase the bottom marging.

Paulo

> -----Original Message-----
> From: Jan Stanetzki [mailto:stanetzki@...]
> Sent: Wednesday, November 04, 2009 1:33 PM
> To: itext-questions@...
> Subject: [iText-questions] iText PDFTable overwrites Footertable
>
> Hi,
>
> I am new to itext. I usedPageEvent-Exampel
> (http://itextdocs.lowagie.com/examples/com/lowagie/examples/di
> rectcontent/pageevents/EndPage.java)
> for creating a table-footer. I tried to create an
> invoice-document with
> itext, but the itemstable is very long and overwrites the
> footer .... Is
> there any way to declare a "footer area" or sth. like that so
> that the
> table knows "when to break"?!
>
> Thanks,
> Jan
>
> --
> Dipl.-Wirt.-Inf. Jan Stanetzki
> Softwareentwickler, Datenschutzbeauftragter
>
> Gorilla Concept GmbH · Am Graswege 6 · 30169 Hannover
> Fon +49 (0) 511 / 300 345-55
> Fax +49 (0) 511 / 300 345-45
> E-Mail stanetzki@...
> Web www.gorilla-concept.de
>
> Handelsregister HRB 200898 · Amtsgericht Hannover
> Geschäftsführung Oliver Hübsch · Dirk Arnemann
>
>

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.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: iText PDFTable overwrites Footertable

by Jan Stanetzki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Paulo,

thanks! This ist the last value in:

new Document( PageSize.A4, 16, 16, 16, 16 );

right? I tried it already - the effect was, that the footer has more
space at the bottomline, but the item-table overwrites the footer again
.... Here's my "onEndPage"-Function:

    public void onEndPage(PdfWriter writer, Document document) {
        try {
            Rectangle page = document.getPageSize();
            PdfPCell cell;
            PdfPTable fussTabelle = new PdfPTable(1);
            cell = fussTabelle.getDefaultCell();
            cell.setBorderWidth(1);
            cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
            fussTabelle.addCell(new Phrase("Line1 " +
                    "\nLine2: " +
                    "Line3\n", smallFont));
           //Centers the footertable at the bottom.
            fussTabelle.setTotalWidth( (page.getWidth()*0.85F -
document.leftMargin() - document.rightMargin()));
            fussTabelle.writeSelectedRows(0, -1,
document.leftMargin()+(0.075F*page.getWidth()),
document.bottomMargin()+20,writer.getDirectContent());
        }
        catch (Exception e) {
            throw new ExceptionConverter(e);
        }
    }

Thank you,
Jan


Paulo Soares schrieb:

> Increase the bottom marging.
>
> Paulo
>
>  
>> -----Original Message-----
>> From: Jan Stanetzki [mailto:stanetzki@...]
>> Sent: Wednesday, November 04, 2009 1:33 PM
>> To: itext-questions@...
>> Subject: [iText-questions] iText PDFTable overwrites Footertable
>>
>> Hi,
>>
>> I am new to itext. I usedPageEvent-Exampel
>> (http://itextdocs.lowagie.com/examples/com/lowagie/examples/di
>> rectcontent/pageevents/EndPage.java)
>> for creating a table-footer. I tried to create an
>> invoice-document with
>> itext, but the itemstable is very long and overwrites the
>> footer .... Is
>> there any way to declare a "footer area" or sth. like that so
>> that the
>> table knows "when to break"?!
>>
>> Thanks,
>> Jan
>>
>> --
>> Dipl.-Wirt.-Inf. Jan Stanetzki
>> Softwareentwickler, Datenschutzbeauftragter
>>
>> Gorilla Concept GmbH · Am Graswege 6 · 30169 Hannover
>> Fon +49 (0) 511 / 300 345-55
>> Fax +49 (0) 511 / 300 345-45
>> E-Mail stanetzki@...
>> Web www.gorilla-concept.de
>>
>> Handelsregister HRB 200898 · Amtsgericht Hannover
>> Geschäftsführung Oliver Hübsch · Dirk Arnemann
>>
>>
>>    
>
> 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.
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> iText-questions mailing list
> iText-questions@...
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
> You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


--
Dipl.-Wirt.-Inf. Jan Stanetzki
Softwareentwickler, Datenschutzbeauftragter

Gorilla Concept GmbH · Am Graswege 6 · 30169 Hannover
Fon +49 (0) 511 / 300 345-55
Fax +49 (0) 511 / 300 345-45
E-Mail stanetzki@...
Web www.gorilla-concept.de

Handelsregister HRB 200898 · Amtsgericht Hannover
Geschäftsführung Oliver Hübsch · Dirk Arnemann



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: iText PDFTable overwrites Footertable

by 1T3XT info :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jan Stanetzki wrote:
> Hi Paulo,
>
> thanks! This ist the last value in:
>
> new Document( PageSize.A4, 16, 16, 16, 16 );

Yes, you have a bottom margin of 16pt.

> document.bottomMargin()+20

You tell iText to draw the table 20pt above the bottom margin. As the
bottom margin is 16, the table will start at 36pt (half an inch) from
the bottom.

No surprises there: you're telling the table it should overlap with the
content.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: iText PDFTable overwrites Footertable

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

document.bottomMargin()+20 will place the footer table 20 points above the bottom margin and overwrite the main table.

Paulo  

> -----Original Message-----
> From: Jan Stanetzki [mailto:stanetzki@...]
> Sent: Thursday, November 05, 2009 10:37 AM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] iText PDFTable overwrites Footertable
>
> Hi Paulo,
>
> thanks! This ist the last value in:
>
> new Document( PageSize.A4, 16, 16, 16, 16 );
>
> right? I tried it already - the effect was, that the footer has more
> space at the bottomline, but the item-table overwrites the
> footer again
> .... Here's my "onEndPage"-Function:
>
>     public void onEndPage(PdfWriter writer, Document document) {
>         try {
>             Rectangle page = document.getPageSize();
>             PdfPCell cell;
>             PdfPTable fussTabelle = new PdfPTable(1);
>             cell = fussTabelle.getDefaultCell();
>             cell.setBorderWidth(1);
>             cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
>             fussTabelle.addCell(new Phrase("Line1 " +
>                     "\nLine2: " +
>                     "Line3\n", smallFont));
>            //Centers the footertable at the bottom.
>             fussTabelle.setTotalWidth( (page.getWidth()*0.85F -
> document.leftMargin() - document.rightMargin()));
>             fussTabelle.writeSelectedRows(0, -1,
> document.leftMargin()+(0.075F*page.getWidth()),
> document.bottomMargin()+20,writer.getDirectContent());
>         }
>         catch (Exception e) {
>             throw new ExceptionConverter(e);
>         }
>     }
>
> Thank you,
> Jan
>
>
> Paulo Soares schrieb:
> > Increase the bottom marging.
> >
> > Paulo
> >
> >  
> >> -----Original Message-----
> >> From: Jan Stanetzki [mailto:stanetzki@...]
> >> Sent: Wednesday, November 04, 2009 1:33 PM
> >> To: itext-questions@...
> >> Subject: [iText-questions] iText PDFTable overwrites Footertable
> >>
> >> Hi,
> >>
> >> I am new to itext. I usedPageEvent-Exampel
> >> (http://itextdocs.lowagie.com/examples/com/lowagie/examples/di
> >> rectcontent/pageevents/EndPage.java)
> >> for creating a table-footer. I tried to create an
> >> invoice-document with
> >> itext, but the itemstable is very long and overwrites the
> >> footer .... Is
> >> there any way to declare a "footer area" or sth. like that so
> >> that the
> >> table knows "when to break"?!
> >>
> >> Thanks,
> >> Jan
> >>
> >> --
> >> Dipl.-Wirt.-Inf. Jan Stanetzki
> >> Softwareentwickler, Datenschutzbeauftragter
> >>
> >> Gorilla Concept GmbH · Am Graswege 6 · 30169 Hannover
> >> Fon +49 (0) 511 / 300 345-55
> >> Fax +49 (0) 511 / 300 345-45
> >> E-Mail stanetzki@...
> >> Web www.gorilla-concept.de
> >>
> >> Handelsregister HRB 200898 · Amtsgericht Hannover
> >> Geschäftsführung Oliver Hübsch · Dirk Arnemann


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.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Re: iText PDFTable overwrites Footertable

by Jan Stanetzki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That's it - damn me *g*! Thank you for your help!


Paulo Soares schrieb:

> document.bottomMargin()+20 will place the footer table 20 points above the bottom margin and overwrite the main table.
>
> Paulo  
>
>  
>> -----Original Message-----
>> From: Jan Stanetzki [mailto:stanetzki@...]
>> Sent: Thursday, November 05, 2009 10:37 AM
>> To: Post all your questions about iText here
>> Subject: Re: [iText-questions] iText PDFTable overwrites Footertable
>>
>> Hi Paulo,
>>
>> thanks! This ist the last value in:
>>
>> new Document( PageSize.A4, 16, 16, 16, 16 );
>>
>> right? I tried it already - the effect was, that the footer has more
>> space at the bottomline, but the item-table overwrites the
>> footer again
>> .... Here's my "onEndPage"-Function:
>>
>>     public void onEndPage(PdfWriter writer, Document document) {
>>         try {
>>             Rectangle page = document.getPageSize();
>>             PdfPCell cell;
>>             PdfPTable fussTabelle = new PdfPTable(1);
>>             cell = fussTabelle.getDefaultCell();
>>             cell.setBorderWidth(1);
>>             cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
>>             fussTabelle.addCell(new Phrase("Line1 " +
>>                     "\nLine2: " +
>>                     "Line3\n", smallFont));
>>            //Centers the footertable at the bottom.
>>             fussTabelle.setTotalWidth( (page.getWidth()*0.85F -
>> document.leftMargin() - document.rightMargin()));
>>             fussTabelle.writeSelectedRows(0, -1,
>> document.leftMargin()+(0.075F*page.getWidth()),
>> document.bottomMargin()+20,writer.getDirectContent());
>>         }
>>         catch (Exception e) {
>>             throw new ExceptionConverter(e);
>>         }
>>     }
>>
>> Thank you,
>> Jan
>>
>>
>> Paulo Soares schrieb:
>>    
>>> Increase the bottom marging.
>>>
>>> Paulo
>>>
>>>  
>>>      
>>>> -----Original Message-----
>>>> From: Jan Stanetzki [mailto:stanetzki@...]
>>>> Sent: Wednesday, November 04, 2009 1:33 PM
>>>> To: itext-questions@...
>>>> Subject: [iText-questions] iText PDFTable overwrites Footertable
>>>>
>>>> Hi,
>>>>
>>>> I am new to itext. I usedPageEvent-Exampel
>>>> (http://itextdocs.lowagie.com/examples/com/lowagie/examples/di
>>>> rectcontent/pageevents/EndPage.java)
>>>> for creating a table-footer. I tried to create an
>>>> invoice-document with
>>>> itext, but the itemstable is very long and overwrites the
>>>> footer .... Is
>>>> there any way to declare a "footer area" or sth. like that so
>>>> that the
>>>> table knows "when to break"?!
>>>>
>>>> Thanks,
>>>> Jan
>>>>
>>>> --
>>>> Dipl.-Wirt.-Inf. Jan Stanetzki
>>>> Softwareentwickler, Datenschutzbeauftragter
>>>>
>>>> Gorilla Concept GmbH · Am Graswege 6 · 30169 Hannover
>>>> Fon +49 (0) 511 / 300 345-55
>>>> Fax +49 (0) 511 / 300 345-45
>>>> E-Mail stanetzki@...
>>>> Web www.gorilla-concept.de
>>>>
>>>> Handelsregister HRB 200898 · Amtsgericht Hannover
>>>> Geschäftsführung Oliver Hübsch · Dirk Arnemann
>>>>        
>
>
> 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.
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> iText-questions mailing list
> iText-questions@...
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
> You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


--
Dipl.-Wirt.-Inf. Jan Stanetzki
Softwareentwickler, Datenschutzbeauftragter

Gorilla Concept GmbH · Am Graswege 6 · 30169 Hannover
Fon +49 (0) 511 / 300 345-55
Fax +49 (0) 511 / 300 345-45
E-Mail stanetzki@...
Web www.gorilla-concept.de

Handelsregister HRB 200898 · Amtsgericht Hannover
Geschäftsführung Oliver Hübsch · Dirk Arnemann



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/