0

I created a table using droidText library, the cell within the table doesn't format the text properly, as the text goes over the cell border to the right.

enter image description here

As you can see, the text in the description cell goes over the border to the right. I'm using:

PdfPTable descriptionAndCalcContent = new PdfPTable(4); // 4 columns.
        descriptionAndCalcContent.setWidthPercentage(100);
        descriptionAndCalcContent.setSpacingBefore(10f);
        descriptionAndCalcContent.setWidths(new int[]{250, 50, 50, 50});
        descriptionAndCalcContent.getDefaultCell().setBorderWidth(0f);

        PdfPCell descriptionContent = new PdfPCell(new Paragraph("Descr iptionDescription Description Description Description Description" +
                "Descri ption" +
                "Descri ption" +
                "Descr iption" +
                "Description" +
                "Descri ption" +
                "Description" +
                "Descri ption" +
                "Descr iption" +
                "Description Descript ionDescriptionDescr iptionD escriptionD escript onDescription Description" +
                "DescriptionDes criptionDescripti onDescription" +
                "Descri ption" +
                "Desc ription" +
                "Descrip tionDe scriptionDescriptionDescri ptionDesc riptionDescri ptionDes cription" +
                ""));
description.setBorder(Rectangle.NO_BORDER);

Does anyone know how to fix this problem?

almost a beginner
  • 1,622
  • 2
  • 20
  • 41
  • droidText is obsolete and unsupported. Can you reproduce the problem with the official Android port: [iTextG](http://itextpdf.com/product/itextg)? – Bruno Lowagie Sep 15 '15 at 11:07
  • I figured it out, I just had to add indentation to the cell, that did the job. I just needed to go through the library documentation. Thanks for the response though :) – almost a beginner Sep 16 '15 at 01:48

0 Answers0