Sign In  Sign Up Live-Chat

Columns width and table border not applied converting HTML to PDF

Last post 09-06-2008, 6:52 AM by forever. 8 replies.
Sort Posts: Previous Next
  •  09-10-2007, 12:32 PM 94252

    Columns width and table border not applied converting HTML to PDF

    Hi, I´m working in an application that generates pdf documents using as source html code that is generated using a third party html editor. The convertions is made almost perfectly except for the tables. If I set a width to the columns in a table and set the border width, this settings are not applied in the pdf. I´m doing something wrong? Below is the test code I use.

    Thanks in advance,
                   Sebastián

    string st = @"<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">
    <HTML>
    <head>
    <meta content=""TX13_HTM 13.0.234.500"" name=GENERATOR>
    <title> - This document has been created with TX Text Control Trial Version 13.0.NET - You can use this trial version for further 31 days.</title>
    </head>
    <body bgcolor=""#FFFFFF"" text=""#000000"">
    <table cellspacing=""0"" cellpadding=""0"" cols=""2"" border=""1"">
    <tr align=""left"" valign=""top"">
    <td width=""133"" style=""WIDTH:133px; padding-left: 2px; padding-right: 2px;"">
    <div><span style=""font-family:'Arial';font-size:10pt;"">Test 1:</span></div>
    </td>
    <td width=""459"" style=""WIDTH:459px; padding-left: 2px; padding-right: 2px;"">
    <div><span style=""font-family:'Arial';font-size:10pt;"">XXXXXXXXXXXXXXXX</span></div>
    </td>
    </tr>
    </table>
    <table cellspacing=""0"" cellpadding=""0"" cols=""2"" border=""1"">
    <tr align=""left"" valign=""top"">
    <td width=""133"" style=""WIDTH:133px; padding-left: 2px; padding-right: 2px;"">
    <div><span style=""font-family:'Arial';font-size:10pt;"">Test test 2:</span></div>
    </td>
    <td width=""459"" style=""WIDTH:459px; padding-left: 2px; padding-right: 2px;"">
    <div><span style=""font-family:'Arial';font-size:10pt;"">YYYYYYYYYYYYYYY</span></div>
    </td>
    </tr>
    </table>
    </body>
    </html>"
    ;

    Pdf pdfAux = new Pdf();
    StringReader lectorAuxiliar = new StringReader(st);
    pdfAux.BindHTML(lectorAuxiliar);
    pdfAux.Save("c:/test.pdf");

     
  •  09-10-2007, 8:45 PM 94313 in reply to 94252

    Re: Columns width and table border not applied converting HTML to PDF

    Attachment: Present (inaccessible)

    Hi,

    I have tested the code that you provided. I was able to reproduce the error regarding width. However the border seems to be working fine. Attached is the pdf that I got after setting the border of first table to 4.

    I will discuss the width issue with the developers and we will inform you about a solution as soon as possible.

    Thanks.

     
  •  09-16-2007, 6:13 PM 95058 in reply to 94252

    Re: Columns width and table border not applied converting HTML to PDF

    Attachment: Present (inaccessible)
    Hi,

    The feature is supported now. Please try the attachment before we publish new hotfix.

    Best regards.

    Hans Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-17-2007, 10:56 AM 95162 in reply to 95058

    Re: Columns width and table border not applied converting HTML to PDF

    Thank you Hans, it works perfectly!!!

    I'm still having problems with the table borders, the example I previously post was not the correct one for this issue. Here is the code I use to test the tables and cells borders.

    Thanks,
           Sebastian

    string st = @"
    <html>
    <body bgcolor=""#FFFFFF"" text=""#000000"">
       <table cellspacing=""0"" cellpadding=""0"" cols=""4"">
          <tr align=""left"" valign=""top"">
             <td width=""25%"" style=""border-bottom: 1px solid black; border-left: 1px solid black;border-top: 1px solid black; border-right: 1px solid black;"">
                <div align=""center"" style=""text-indent: 0pt; margin-left: 0pt; margin-top: 3pt; margin-bottom: 7pt; margin-right: 0pt; line-height: 100%;""><span style=""font-family: 'Arial'; font-size: 10pt;""><b>XXXXXXX</b></span></div>
             </td>
             <td width=""25%"" style=""border-bottom: 1px solid black; border-left: 1px solid black; border-top: 1px solid black; border-right: 1px solid black;"">
                <div align=""center"" style=""text-indent: 0pt; margin-left: 0pt; margin-top: 3pt; margin-bottom: 7pt; margin-right: 0pt; line-height: 100%;""><span style=""font-family: 'Arial'; font-size: 10pt;""><b>YYYYYYYYYY</b></span></div>
             </td>
             <td width=""25%"" style=""border-bottom: 1px solid black; border-left: 1px solid black; border-top: 1px solid black; border-right: 1px solid black;"">
                <div align=""center"" style=""text-indent: 0pt; margin-left: 0pt; margin-top: 3pt; margin-bottom: 7pt; margin-right: 0pt; line-height: 100%;""><span style=""font-family: 'Arial'; font-size: 10pt;""><b>ZZZZZZZZZZZZZ</b></span></div>
             </td>
             <td width=""25%"" style=""border-bottom: 1px solid black; border-left: 1px solid black; border-top: 1px solid black; border-right: 1px solid black;"">
                <div align=""center"" style=""text-indent: 0pt; margin-left: 0pt; margin-top: 3pt; margin-bottom: 7pt; margin-right: 0pt; line-height: 100%;""><span style=""font-family: 'Arial'; font-size: 10pt;""><b>WWWWWWWW WWWWWW WWWWW</b></span></div>
             </td>
          </tr>
       </table>
    </body>
    </html>"
    ;

    Pdf pdfAux = new Pdf();
    StringReader lectorAuxiliar = new StringReader(st);
    pdfAux.BindHTML(lectorAuxiliar);
    pdfAux.Save("c:/test.pdf");

     
  •  09-17-2007, 8:50 PM 95217 in reply to 95162

    Re: Columns width and table border not applied converting HTML to PDF

    I have logged this issue as PDFNET-3750. We will try to fix it soon.

    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-18-2007, 9:10 AM 95297 in reply to 95162

    Re: Columns width and table border not applied converting HTML to PDF

    Hi,

      Thank you for considering Aspose. The problem you mentioned is not covered yet. We will fix it by next Monday, Sept.21th.


    Cynthia Hu
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-21-2007, 11:05 AM 95753 in reply to 95162

    Re: Columns width and table border not applied converting HTML to PDF

    Attachment: Present (inaccessible)
    Dear Sebastian,

    Now the table border is supported. Try the attached dll please.

    Best regards.

    Hans Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  09-03-2008, 4:55 AM 142178 in reply to 95753

    Re: Columns width and table border not applied converting HTML to PDF

    Hello,
    I'm using Aspose.Pdf and I try to convert a basic Html Document like above to a pdf erquivalent, but i can't manage.
    I just copy the html above and try to work with it to ensure that the document is correctly converted.
    But it appears that the document is converted but without any borders !

    Is this possible to have a table or a div or something else with this kind of attributes :

    <div style="border-bottom: 1px solid black">My Text here with a bottom border</div>

    Thanks in advance for any help :)

    Kind Regards,


    [.net Framework 2.0 - Aspose.Pdf v3.7.0.0]

     
  •  09-06-2008, 6:52 AM 142719 in reply to 142178

    Re: Columns width and table border not applied converting HTML to PDF

    Hi,

    Sorry for replying to you late.

    The style="border-bottom: 1px solid black" is supported inside <Table> and <Td>. It is not supported in <tr> and <div>. We have not considered border setting for <div>. Border for table is supported if it is not set inside <tr>.

     


    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
View as RSS news feed in XML