Tables containing HTML Lists (OL/UL)

Hi Thomas,


Thanks for your patience.

The development team has further investigated the issue reported earlier and due to complexity of this problem, its not yet resolved. Please note that the new ETA is Aspose.Pdf for .NET 10.1.0 which is planned to release in February-2015 (still its not a promise but we will try our level best to get it fixed by said time). Please be patient and spare us little time.

Hi Thomas,


Thanks for your patience.

We are pleased to share that the issue reported earlier is resolved and in order to generate correct output, please try using following code snippet based on new Document Object Model (DOM) of Aspose.Pdf namespace.

[C#]

string outFile = “33759.pdf”;<o:p></o:p>

Document doc = new Document();

Page page = doc.Pages.Add();

Aspose.Pdf.Table attributetable = new Aspose.Pdf.Table();

attributetable.RepeatingRowsCount = 1;

attributetable.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 0.1F);

attributetable.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 0.1F);

TextState textFormat2 = new TextState();

textFormat2.Font = FontRepository.FindFont("Trebuchet MS");

textFormat2.FontSize = 11;

attributetable.DefaultCellTextState = textFormat2;

attributetable.DefaultCellPadding = new Aspose.Pdf.MarginInfo();

attributetable.DefaultCellPadding.Top = 3;

attributetable.DefaultCellPadding.Bottom = 3;

attributetable.DefaultCellPadding.Left = 3;

attributetable.DefaultCellPadding.Right = 3;

Aspose.Pdf.Row headerrow = attributetable.Rows.Add();

headerrow.BackgroundColor = Aspose.Pdf.Color.FromArgb(210, 210, 210);

TextState textformatheader = new TextState();

textformatheader.Font = FontRepository.FindFont("Trebuchet MS");

textformatheader.FontSize = 12;

textformatheader.FontStyle = FontStyles.Bold;

headerrow.DefaultCellTextState = textformatheader;

Aspose.Pdf.Cell numbercell = headerrow.Cells.Add("No.");

List<string> descriptionstrings = new List<string>();

descriptionstrings.Add("Coll1");

descriptionstrings.Add("Coll2");

foreach (string headerstr in descriptionstrings)

headerrow.Cells.Add(headerstr);

int rowvar = 0;

for (int i = 0; i < 2; i++)

{

Aspose.Pdf.Row row1 = attributetable.Rows.Add();

if (rowvar%2 != 0) row1.BackgroundColor = Aspose.Pdf.Color.FromArgb(235, 0, 0);

rowvar++;

row1.Cells.Add(rowvar.ToString());

row1.Cells.Add("Value Coll1");

//see Result in PureTabelrowBreak.pdf

HtmlFragment desc = new HtmlFragment( "

  • asd
  • asd
  • asd
  • sad
  • asda
  • "
+ "
  • sda
  • sdas
  • dsad
  • asd
  • asd
  • "
    + "
  • asd
  • asd
  • sad
  • asd
  • asd
  • "
    + "
  • asd
  • asda
  • sda
  • sd
  • asd
  • "
    + "
  • ada
  • sd
  • asd
  • asd
  • asd
  • "
    + "
  • asd
  • as
  • dasdasdasda
  • sd
  • asd
  • "
    + "
  • asd
  • asdsdasdasdasdasda
  • sda
  • sda
  • sdasd
  • "
    + "
  • asdasdasdasdasd
    1. asd
    2. asd
    3. asd
    4. "
    + "
  • asd
  • asd
  • asd
  • asd
  • asd
  • asd
  • "
    + "
  • asd
  • asd
  • asd
  • asd
  • asda
  • sdasdasdasd
  • "
    + "
  • ads
  • asd
  • asda
  • sdasd
  • as
  • das
  • "
    + "
  • das
  • das
  • das
  • das
  • dsddasdasdsa
  • das
  • "
    + "
  • das
  • das
  • das
  • das
  • da
  • sda
  • "
    + "
  • sdas
  • dsdasdasdasd
  • asdasdasd
  • a
  • sda
  • "
    + "
  • sda
  • sd
  • "
    );

    Aspose.Pdf.Cell rowCell = row1.Cells.Add();

    rowCell.Paragraphs.Add(desc);

    }

    attributetable.ColumnAdjustment = ColumnAdjustment.AutoFitToContent;

    page.Paragraphs.Add(attributetable);

    // Save the resultant PDF document

    doc.Save(outFile);

    The issues you have found earlier (filed as PDFNEWNET-33759) have been fixed in Aspose.Pdf for .NET 10.6.0.


    This message was posted using Notification2Forum from Downloads module by Aspose Notifier.