----- Original Message ----- 
From: "Andrea Lombardoni" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, March 18, 2007 1:27 AM
Subject: Re: [iText-questions]iText 2.0.1 - PdfPCell setRotation 
90 -Disappearing text


> Paulo Soares <psoares <at> consiste.pt> writes:
>
>>
>> If the nested table is rotated 90 or 270 you must set the nested table 
>> width
>> with setTotalWidth().
>
> Thank you.
> That did not work, but I was able to make the nested table appear, by 
> calling

You also need setLockedWidth(true).

>                 setFixedHeight(190.0f) on the containing cell (code 
> below).
> It there any way to force a kind of automatic layout? I.e. to find out the 
> value
> to give to setFixedHeight?
>

You always need to give a table width or limit the cell height when 
rotating.

Paulo

> Thank you again.
>
> import java.io.FileOutputStream;
>
> import com.lowagie.text.Document;
> import com.lowagie.text.PageSize;
> import com.lowagie.text.pdf.PdfPCell;
> import com.lowagie.text.pdf.PdfPTable;
> import com.lowagie.text.pdf.PdfWriter;
>
> public class Rotating {
>
>        public static void main(String[] args) {
>
>                Document document = new Document(PageSize.A4);
>                try {
>                        PdfWriter writer = PdfWriter.getInstance(document,
>                                        new 
> FileOutputStream("Rotating.pdf"));
>                        document.open();
>
>                        PdfPTable table = new PdfPTable(1);
>                        PdfPTable t1 = new PdfPTable(2);
>                        t1.addCell("c00");
>                        t1.addCell("long line that gets wrapped?");
>                        t1.addCell("c01");
>                        t1.addCell("long line that gets wrapped?");
>                        PdfPCell c0 = new PdfPCell();
>                        c0.setRotation(90);
>                        c0.addElement(t1);
>                        c0.setFixedHeight(190.0f);
>                        table.addCell(c0);
>                        document.add(table);
>
>                } catch (Exception de) {
>                        de.printStackTrace();
>                }
>                document.close();
>        }
> }
>
>
>> Paulo
>>
>> ----- Original Message ----- 
>> From: "Andrea Lombardoni" <andrea <at> lombardoni.ch>
>> To: <itext-questions <at> lists.sourceforge.net>
>> Sent: Saturday, March 17, 2007 3:15 PM
>> Subject: [iText-questions] iText 2.0.1 - PdfPCell setRotation
>> 90 -Disappearing text
>>
>> > There seems to be a problem with nested PdfPTable and PdfPCell
>> > setRotation.
>> >
>> > When running the following example, a table with no content is 
>> > generated.
>> >
>> > If the setRotation is changed to 180 or removed completely, the the 
>> > output
>> > is
>> > correct.
>> >
>> > import java.io.FileOutputStream;
>> >
>> > import com.lowagie.text.Document;
>> > import com.lowagie.text.PageSize;
>> > import com.lowagie.text.pdf.PdfPCell;
>> > import com.lowagie.text.pdf.PdfPTable;
>> > import com.lowagie.text.pdf.PdfWriter;
>> >
>> > public class Rotating {
>> >
>> >        public static void main(String[] args) {
>> >
>> >                Document document = new Document(PageSize.A4);
>> >                try {
>> >                        PdfWriter writer = 
>> > PdfWriter.getInstance(document,
>> >                                        new
>> > FileOutputStream("Rotating.pdf"));
>> >                        document.open();
>> >
>> >                        PdfPTable table = new PdfPTable(1);
>> >                        PdfPTable t1 = new PdfPTable(2);
>> >                        t1.addCell("c0");
>> >                        t1.addCell("c1");
>> >                        t1.addCell("c2");
>> >                        t1.addCell("c3");
>> >                        PdfPCell c0 = new PdfPCell();
>> >                        //the next line is the responsible!!!
>> >                        c0.setRotation(90);
>> >                        c0.addElement(t1);
>> >                        table.addCell(c0);
>> >                        document.add(table);
>> >
>> >                } catch (Exception de) {
>> >                        de.printStackTrace();
>> >                }
>> >                document.close();
>> >        }
>> > }
>> >
>> >
>> >
>> > -------------------------------------------------------------------------
>> > 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
>> > iText-questions <at> lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/itext-questions
>> > Buy the iText book: http://itext.ugent.be/itext-in-action/
>>
>> -------------------------------------------------------------------------
>> 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
>> iText-questions <at> lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>> Buy the iText book: http://itext.ugent.be/itext-in-action/
>>
>>
>
>
>
>
>
> -------------------------------------------------------------------------
> 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/ 


-------------------------------------------------------------------------
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