Solved

how to write coloum names in vertical format in pdf

Posted on 2011-02-23
3
645 Views
Last Modified: 2013-11-23
I am using pdf for printing.. I have many coloums hence the width of each coloum is less.
Therefore the coloum name doesnt fit properly in the coloum.
To avoid this I want to print it in vertical format. Can anyone suggest any solution for this??
0
Comment
Question by:Aurii
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 34960240

Here is an example from the book:

http://itextpdf.com/examples/iia.php?id=202

0
 
LVL 17

Accepted Solution

by:
Dejan Pažin earned 250 total points
ID: 34960266

Forget the above example, this is what you need:

PdfPCell cell = new PdfPCell(new Phrase("Table Header 1"));
cell.setRotation(90);
0
 

Author Comment

by:Aurii
ID: 34960373
I refered the link ..how to implement it in my code

           Document document = new Document(PageSize.A4.rotate());
            PdfWriter.getInstance(document, new FileOutputStream("C:/Reports/Voucher"+i9+".pdf"));
            document.open();
           
           float[] width = {0.5f, 0.5f, 0.5f,1.0f,2.0f,2.5f,0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f};
            PdfPTable table = new PdfPTable(width);
            table.setWidthPercentage(100);
          
          PdfPCell cell = new PdfPCell(new Phrase("UkEkquk ua 8  vkdkj.kh ;knhpk mrkjk", FontFactory.getFont("k30", BaseFont.CP1257, BaseFont.EMBEDDED, 26, Font.BOLD)));
           
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setBorderWidth(0);
            cell.setColspan(14);
            cell.setUseDescender(true);
            table.addCell(cell);
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question