Hello Friends,
 I am new to iText, i have to create some simple PDF file, My Problem is
that whenever i insert bookmarks in my document the  difference between the
table increases(i.e. inserts white space), even when i am not specifying any
code to generate white space.
 Plz help me, i am not able to understand what i have done wrong.
 Thanks in advance.

 Following is the code:

 /*
 * Start of Test.java
 */
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.awt.Color;

 import com.lowagie.text.*;
 import com.lowagie.text.pdf.PdfWriter;

 public class Test {
        public static void main(String args[]){
         System.out.println("Creating PDF File for Create CER");
         // step 1: creation of a document-object
         Document document = new Document();
         try {
             // step 2:
             // we create a writer that listens to the document
             // and directs a PDF-stream to a file
             String fileName    =       String.valueOf(new
java.util.Date().getTime());
             PdfWriter.getInstance(document, new
FileOutputStream(fileName+"Test.pdf"));
             // step 3: we open the document

             document.open();

                        // Add Title to the page

             Paragraph TitlePara                = new Paragraph("Basic Data");
             TitlePara.setAlignment(Element.ALIGN_CENTER);
             Chapter chapter                            = new Chapter(TitlePara, 1);
             chapter.setNumberDepth(0);
             document.add(chapter);

             Table table                                        =       new 
Table(2,3);    // 3 rows, 2 columns


                        Cell yearOfProjectLabelCell     =       new Cell("1st Year of 
project (YYYY)");
                        table.addCell(yearOfProjectLabelCell);

                        Cell yearOfProjectValueCell     =       new Cell("2001");
                        table.addCell(yearOfProjectValueCell);

                        Cell monthFistSpentLabelCell    =       new Cell("Month of 
above year $'s are
first spent");
                        table.addCell(monthFistSpentLabelCell);

                        Cell monthFistSpentValueCell    =       new Cell("Jan");
                        table.addCell(monthFistSpentValueCell);

                        Cell durationLabelCell  =       new Cell("Duration of the 
Project (months)");
                        table.addCell(durationLabelCell);

                        Cell durationValueCell  =       new Cell("6");
                        table.addCell(durationValueCell);
                        document.add(table);
                        document.add(table);



         }
         catch(DocumentException de) {
             System.err.println(de.getMessage());
         }
         catch(IOException ioe) {
             System.err.println(ioe.getMessage());
         }
         // step 5: we close the document
         document.close();
     }
}

/*
* End of Test.java
*/



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to