Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
JSP - A mailing list about Java Server Pages specification and reference
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
PdfPTable.setKeepTogether(true)

PdfPTable.setKeepTogether(true)

2006-09-01       - By itext.gd@(protected)

 Back
Reply:     1     2     3     4     5  

Hi,

I wrote a small app to check the behaviour of iText when you add a
PdfPTable
to a document via document.add() on which setKeepTogether(true); is set.

These are my experiences:

I add a first table of 60 rows. (So the last row is in the upper half of
the 2nd page)
Then
- when I add a 2nd table containing 15 rows, it fits on the rest of the
2nd page, so it
 is placed there. In fact a 2nd table of 33 rows still fits on the 2nd
 page. So
- when I add a 2nd table containing 34 rows, it starts on the 3rd page.
 Which is due to the setKeepTogether(true)

Now here's the point I have my doubts about:
- When I add a 2nd table containing 60 rows, it also starts on the 3rd
page.
 I wonder why a new page is taken
    - if the table does not fit on one page
    - and so will be split further on?

 The result is:
 page 1: completely filled (1st table)
 page 2: less than half filled (last part of 1st table)
 page 3: completely filled (2nd table)
 page 4: less than half filled (last part of 2nd table)

 Since I didn't program any document.newPage() I would have expected
 the less paper consuming:
 page 1: completely filled (1st table)
 page 2: completely filled (last part of 1st table + first part of 2nd
 table)
 page 3: (almost) completely filled (last part of 2nd table)

I know that I can get this result by not applying setKeepTogether(true)
on the 2nd table,
but how can I know that I shouldn't? How can I know that the 2nd table
doesn't fit on one page?
(according to the methods used by document.add(table))

Kind regards,
Geert

--
http://www.fastmail.fm - The professional email service


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions

©2008 junlu.com - Jax Systems, LLC, U.S.A.