Why? The sequence is:
- create a new instance of ColumnText
- load it with a paragraph
- simulate
- create a new instance of ColumnText
- load it with the same paragraph
- write it in the same column or the next
- repeat until no more paragraphs
Best Regards,
Paulo Soares
----- Original Message -----
From: "Guillermo Gonz�lez" <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, July 30, 2003 16:15
Subject: Re: [iText-questions] Keeping paragraphs together with ColumnTExt
Thanks Pablo,
By doing so, do you have therefore to write in another PDF file to use
this
new instance of Columntext?
That's all...
Best Regards,
Guillermo
----- Original Message -----
From: "Paulo Soares" <[EMAIL PROTECTED]>
To: "Guillermo Gonz�lez" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, July 30, 2003 10:53
Subject: Re: [iText-questions] Keeping paragraphs together with
ColumnTExt
> The simulation destroys the content. You have to create a new instance
when
> doing it for real. The next version has a duplicate method in
ColumnText
to
> ease the reversion to a previous state.
>
> Best Regards,
> Paulo Soares
>
> ----- Original Message -----
> From: "Guillermo Gonz�lez" <[EMAIL PROTECTED]>
> To: "Paulo Soares" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Wednesday, July 30, 2003 14:43
> Subject: Re: [iText-questions] Keeping paragraphs together with
ColumnTExt
>
>
> Thanks Pablo, BTW your library is great!
>
> I've tried simulation with go(true) before, doing something like this:
>
> ct.setSimpleColumn(right[0], 25, left[0], 800, leading,
> Element.ALIGN_LEFT);
> (...)
> While (rs.next()) {
> (...)
> ct.addText(p);
> if (go(true) == ct.NO_MORE_COLUMN)
> {
> column++;
> if (column > n_columns - 1) {
> document.newPage();
> column = 0;
> }
> ct.setSimpleColumn(right[column], 25, left[column], 800,
> leading,
> Element.ALIGN_LEFT);
> }
> ct.addText(p);
> ct.go()
>
> But, going back to the PDF generated, by some reason, a blank
paragraph
> or
> something similar is generated betwen each paragraph added. Should I
> create
> a new instance of ct using ct.simpleColumn every time I run go(true),
> and I
> will need write in the same paragraph?
>
> Regards,
> Guillermo
>
> ----- Original Message -----
> From: "Paulo Soares" <[EMAIL PROTECTED]>
> To: "Guillermo Gonz�lez" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Wednesday, July 30, 2003 06:11
> Subject: Re: [iText-questions] Keeping paragraphs together with
> ColumnTExt
>
>
> > You'll have to first simulate if the paragraph fits and then write
it
> in
> the
> > same column or the next. Note that the simulation destroys the
> instance
> and
> > a new ColumnText instance must be created.
> >
> > Best Regards,
> > Paulo Soares
> >
> > ----- Original Message -----
> > From: "Guillermo Gonz�lez" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 30, 2003 2:44
> > Subject: [iText-questions] Keeping paragraphs together with
ColumnTExt
> >
> >
> > > Hi,
> > >
> > > It is posible to let a whole paragraph to remain together if a
> > > NO_MORE_COLUMN is reached using ColumnText and you change to
another
> > > column?
> > >
> > > I'm using the following code:
> > >
> > >
> > > float[] right = {50, 300};
> > > float[] left = {290, 550};
> > > int leading = 11;
> > >
> > > ct.setSimpleColumn(right[0], 25, left[0], 800, leading,
> > > Element.ALIGN_LEFT);
> > >
> > > int column = 0;
> > > int n_columns = 2;
> > >
> > > while(rs.next()) {
> > > Phrase p = new Phrase();
> > > p.add(new Chunk("\n" + rs.getString("nombre"), titulo));
> > > p.add(new Chunk("\n" + rs.getString("direccion") + "\n",
> > > direccion));
> > > ct.addText(p);
> > >
> > > if (ct.go() == ct.NO_MORE_COLUMN)
> > > {
> > > column++;
> > > if (column > n_columns - 1) {
> > > document.newPage();
> > > column = 0;
> > > }
> > >
> > > ct.setSimpleColumn(right[column], 25, left[column], 800,
> leading,
> > > Element.ALIGN_LEFT);
> > > }
> > > }
> > >
> > > Regards,
> > > Guillermo
> > >
> >
>
>
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions