Free Support Forum - aspose.com

Nested <OL> Tag is not working in Aspose.pdf

Hi,

We have bought Aspose.pdf Tool and we have been using Aspose.pdf 3.6.2.0. In that When we assign the string with Nested

    to Cells(Html Supported), Aspose is not generating the pdf correctly.

    Sample Code:


    1. One

    2. Two

    3. Three

    4. Four



      1. One

      2. Two

      3. Three

      4. Four



    The above code is working correctly in the browser but not Aspose.pdf. If we dont have nested

      then its working fine.
      Kindly help me.

      Thanks
      Karthik Kumar D
      Verizon Data Services India (P) Ltd


    Hello Karthik,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    Thanks for considering Aspose.

    Can you please explain a little more about your requirement. Either you are adding text containing HTML tags to pdf or converting an HTML to Pdf. As once you mentioned you are assigning a string containing nested

      to cells and secondly you mentioned that its working perfect in Browser.

      More over if you could also provide us the resources that can help us to test this issue along with the code that would be great.

    body { margin: 0 0 0 0; padding:0 0 0 0 }
    td,div { font-family:Tahoma;font-size:8pt;vertical-align:top }
    body { margin: 0 0 0 0; padding:0 0 0 0 }
    .transcript { background-color:#d2d2d2; }
    .messageBlock { margin-left:4px; margin-bottom:3px }
    .message { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; }
    .messageCont { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;}
    .other { color:#39577a;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .myself { color:#da8103;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .system { margin-left:4px; word-wrap:break-word;color:#da8103;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre; }
    .showTimestamp { margin-right:3px; float:right; color:#999999;font-style:normal;font-weight:normal; }
    .other1 { color:#ac2000;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other2 { color:#3c9fa8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other3 { color:#e25614;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other4 { color:#0b6ac8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other5 { color:#b23290;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other6 { color:#02e7c7;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .other7 { color:#5b3284;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }
    .otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }
    .tsDisplay { display:block }

    Hi,

    As our security policy doest not allow us to upload any code, i just give sample code to
    generate the pdf.

    The variable "str" having the html string and its been assigned to the cell in the table.

    Instead of generating the pdf, if we write the html string using Response Object, its coming correctly
    in the browser. but in the pdf, its not working as its coming in the browser.

    You can make use of the following code to reproduce the problem


    Sample Code:

    string str = "

    1. One
    2. Two
    3. Three
    4. Four
    5. " +
      "
      1. One
      2. Two
      3. Three
      4. Four
      5. " +
        "
    ";

    //Response.Write(str);

    Pdf pdf = new Pdf();
    Section section = pdf.Sections.Add();
    Aspose.Pdf.Table table = new Aspose.Pdf.Table();
    section.Paragraphs.Add(table);
    Aspose.Pdf.Row pdfRow = table.Rows.Add();

    Cell cell = pdfRow.Cells.Add(str);
    ((Text)cell.Paragraphs[0]).IsHtmlTagSupported = true;

    pdf.Save("AdHoc-Report.pdf", SaveType.OpenInBrowser, Response);
    Response.End();

    Thanks
    karthik

    Hello karthik,

    Sorry for inconvenience. I have tested the code and have been able to reproduce the issue. I have logged it in our defect management system as PDFNET-5443. Soon we would be looking into this matter and will update you with the status.