When I use this method (below) none of the data is displayed in the master
(root) table.  I can see the cells have been added but there is no data.

//below this is the method to place everything in the table.

public void appendPostnet (String label, String post){

        post = removeHyphen(post);

        /*
         *Construct 1 col table
         *add cell with a fixed height of H * .85
         *add cell with a fixed height of H * .15
         *label in first cell
         *zip in the secind cell
         *
         **/

        PdfPTable t = new PdfPTable (1);
        t.setTotalWidth(W);
        //t.setKeepTogether(true);
        //t.setWidthPercentage(100);

        PdfPCell cell = new PdfPCell (new Phrase(label, DOC_FONT));
        cell.setFixedHeight(H * .85f);
        //cell.setBorder(Rectangle.NO_BORDER);
        t.addCell(cell);


     /*   if (post.length() > 4 || post.length() < 12) {

            BarcodePostnet pnbc = new BarcodePostnet();

            pnbc.setCode(post);

            cell = new PdfPCell(pnbc.createImageWithBarcode(cb, null,null));
            cell.setFixedHeight(H * .15f);
            //cell.setBorder(Rectangle.NO_BORDER);

            t.addCell(cell);
        }*/

        add(new PdfPCell(t));

    }

/ * ---------------- NEXT METHOD --------------------- */

    public void add (PdfPCell cell){

        /* adds the actual cell to the table  */
        /* Every add() calls this method */


        cell.setFixedHeight(H);

        cell.setNoWrap(NO_CELL_WRAP);

        cell.setPaddingLeft(CELL_LEFT_PADDING);

        cell.setVerticalAlignment(VALIGNMENT);
        cell.setHorizontalAlignment(HALIGNMENT);

        if (!DEBUG) cell.setBorder(Rectangle.NO_BORDER);  //show table
borders in DEBUG mode

        how_many++;  //total amount of labels
        counter++;  // 'int counter' keeps track of how many times
                    // this method is called within a range of X (X = ACROSS)

        table.addCell("");
        table.addCell(cell);
        if (counter == ACROSS) table.addCell("");  //at the end

        if (counter == ACROSS) counter = 0;  //if at the end reset the
counter


    }


Thanks for any help; by the way this is part of a class to build Avery
Label sheets easily with iText, I'm going to release it as public domain. 
The class is complete but this is the only thing I've had a problem with.

Sean Anderson
datavirtue.com






-------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to