Discussion:
[iText-questions] truncate text if cell is fixed?
Lars Martin
2001-09-05 15:05:01 UTC
Permalink
Hi is it possible to truncate the content of a PdfPCell if I set the
height of this cell with PdfPCell.setFixedHeight( 20.0f ) ? I have to
fill a formular (table) and the cells of this formular are fixed in
height and width.

Any hints?
Lars
--
______________________________________________________________________
Lars Martin mailto:***@smb-tec.com
SMB GmbH http://www.smb-tec.com
Paulo Soares
2001-09-05 15:21:04 UTC
Permalink
PdfPCell.setFixedHeight should be called minimumHeight. Currently there's no
way of truncating the text but maybe it should. I'll consider it for the
next release.

Best Regards,
Paulo Soares
-----Original Message-----
Sent: Wednesday, September 05, 2001 18:04
Subject: [iText-questions] truncate text if cell is fixed?
Hi is it possible to truncate the content of a PdfPCell if I set the
height of this cell with PdfPCell.setFixedHeight( 20.0f ) ? I have to
fill a formular (table) and the cells of this formular are fixed in
height and width.
Any hints?
Lars
--
______________________________________________________________________
SMB GmbH http://www.smb-tec.com
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Lars Martin
2001-09-07 07:40:02 UTC
Permalink
On Wed, 5 Sep 2001 18:20:34 +0100
Post by Paulo Soares
PdfPCell.setFixedHeight should be called minimumHeight. Currently there's no
way of truncating the text but maybe it should. I'll consider it for the
next release.
This would be cool. I'm +1 on this. ;-)
--
______________________________________________________________________
Lars Martin mailto:***@smb-tec.com
SMB GmbH http://www.smb-tec.com
Paulo Soares
2001-09-07 08:03:03 UTC
Permalink
I've already fixed this. It will be in the next release.

Best Regards,
Paulo Soares
-----Original Message-----
Sent: Friday, September 07, 2001 10:40
Subject: Re: [iText-questions] truncate text if cell is fixed?
On Wed, 5 Sep 2001 18:20:34 +0100
Post by Paulo Soares
PdfPCell.setFixedHeight should be called minimumHeight. Currently
there's no
Post by Paulo Soares
way of truncating the text but maybe it should. I'll consider it for the
next release.
This would be cool. I'm +1 on this. ;-)
--
______________________________________________________________________
SMB GmbH http://www.smb-tec.com
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Lars Martin
2001-09-07 14:15:04 UTC
Permalink
On Fri, 7 Sep 2001 11:01:37 +0100
Post by Paulo Soares
I've already fixed this. It will be in the next release.
Thanks.

Next question: Is is possible to set the cellspacing of a PdfPTable /
PdfPCell to 0, so an inner PdfPTable would have exactly the same width
and height of its parental PdfPCell?

--
______________________________________________________________________
Lars Martin mailto:***@smb-tec.com
SMB GmbH http://www.smb-tec.com
Lars Martin
2001-09-07 14:31:05 UTC
Permalink
On Fri, 7 Sep 2001 18:14:45 +0200
Post by Lars Martin
Next question: Is is possible to set the cellspacing of a PdfPTable /
PdfPCell to 0, so an inner PdfPTable would have exactly the same width
and height of its parental PdfPCell?
A possible solution could be to make the constructor

PdfPCell( PDfPTable table )

public instead of private/protected. With this small modification
something like:

PdfPTable innerTable = new PdfPTable( 2 );
PdfPCell cell = new PdfPCell( ... );
cell = new PdfPCell( new Phrase( nationality, new Font(Font.COURIER, 11, Font.NORMAL, new Color(0, 0, 0))));
innerTable.addCell( cell );
cell = new PdfPCell( ... );
innerTable.addCell( cell );
...
cell = new PdfPCell( innerTable ); // not possible if protected
cell.setPadding( 0.0f );

outerTable.addCell( cell );

would be possible.
I'm not sure why the constructor is protected. Is this modification
allowed?

Lars
--
______________________________________________________________________
Lars Martin mailto:***@smb-tec.com
SMB GmbH http://www.smb-tec.com
Paulo Soares
2001-09-07 14:28:03 UTC
Permalink
Use PdfPTable.getDefaultCell.setPadding(0). Some fixes were also made to
PdfPCell but this works now.

Best Regards,
Paulo Soares
-----Original Message-----
Sent: Friday, September 07, 2001 17:15
Subject: inner PdfPTable [was: Re: [iText-questions] truncate text if
cell is fixed?]
On Fri, 7 Sep 2001 11:01:37 +0100
Post by Paulo Soares
I've already fixed this. It will be in the next release.
Thanks.
Next question: Is is possible to set the cellspacing of a PdfPTable /
PdfPCell to 0, so an inner PdfPTable would have exactly the same width
and height of its parental PdfPCell?
--
______________________________________________________________________
SMB GmbH http://www.smb-tec.com
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Paulo Soares
2001-09-10 07:56:03 UTC
Permalink
That was the other modification made to PdfPCell. The constructor was
package private because I forgot to put the public keyword in it.

Best Regards,
Paulo Soares
-----Original Message-----
Sent: Friday, September 07, 2001 17:31
Subject: Re: inner PdfPTable [was: Re: [iText-questions] truncate
text if cell is fixed?]
On Fri, 7 Sep 2001 18:14:45 +0200
Post by Lars Martin
Next question: Is is possible to set the cellspacing of a PdfPTable /
PdfPCell to 0, so an inner PdfPTable would have exactly the same width
and height of its parental PdfPCell?
A possible solution could be to make the constructor
PdfPCell( PDfPTable table )
public instead of private/protected. With this small modification
PdfPTable innerTable = new PdfPTable( 2 );
PdfPCell cell = new PdfPCell( ... );
cell = new PdfPCell( new Phrase( nationality, new
Font(Font.COURIER, 11, Font.NORMAL, new Color(0, 0, 0))));
innerTable.addCell( cell );
cell = new PdfPCell( ... );
innerTable.addCell( cell );
...
cell = new PdfPCell( innerTable ); // not possible if protected
cell.setPadding( 0.0f );
outerTable.addCell( cell );
would be possible.
I'm not sure why the constructor is protected. Is this modification
allowed?
Lars
--
______________________________________________________________________
SMB GmbH http://www.smb-tec.com
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Frank Morton
2001-09-10 17:50:04 UTC
Permalink
Newbie here. Really glad to have found this. Is there a list
anywhere of what help is needed?

I'm just getting into the docs, but thought some kind soul
might point me to a place showing me how to put a box
around a Paragraph. That is, build a variable size box with
a known width whose height is determined by how much
text there is.

Thanks.

Frank Morton
***@base2inc.com
Bruno Lowagie
2001-09-11 05:48:01 UTC
Permalink
Post by Frank Morton
Newbie here. Really glad to have found this. Is there a list
anywhere of what help is needed?
What we really, really need, is someone to clean up
the messy Table functionality. I don't have the time
to do it. I wrote that class 1.5 years ago in cooperation
with Alan Soukup who tested the functionality. I am very
happy with people such as Geert Poels and Francesco De
Milato who have worked on the Table class recently and
Paulo Soares who has written the PdfPTable class.

But there is still a lot of work to be done.
Post by Frank Morton
I'm just getting into the docs, but thought some kind soul
might point me to a place showing me how to put a box
around a Paragraph. That is, build a variable size box with
a known width whose height is determined by how much
text there is.
Well, take a look at Paulo's examples (if you go to my
site, click on Paulo's name). you will find a PageEvent
example. When a Paragraph starts or ends, an event is
triggered. On such an event you could draw a rectangle
by positioning a graphic at an absolute position (ch10
of the tutorial).

Bruno

Continue reading on narkive:
Loading...