foliojs / pdfkit

A JavaScript PDF generation library for Node and the browser
http://pdfkit.org/
MIT License
9.86k stars 1.15k forks source link

Unable to convert an html into pdf #1541

Closed prakhyat-bhartia closed 2 months ago

prakhyat-bhartia commented 2 months ago

Bug Report

Not converting into correct pdf

Description of the problem

I have generated a custom html but for a particular content it is unable to convert it into html. Basically the error is been occurring due to this part <td

    style="border-bottom: none; margin-bottom:10px;/*padding-top: 8px; padding-bottom:4px;*/"
  >

        <table cellpadding="0" cellspacing="0" width="100%">

          <tr>
            <td align="left">
<tr>
  <td>

      <a name="1-54-240711-93984814" id= 1-54-240711-93984814 
        href="http://www.cfy42.us/url/n5_uj_wBc9hbOKZFXOEI_yHA8bficdn2jXmimrRVxaV9Ww1y0p29aL1t9oq0vgA=="
        style="text-decoration: none;
        line-height:1.4;
        list-style: disc outside none;
        color:#3070BD;font-size:16px;font-style:normal;font-family:Arial,sans-serif;font-weight:bold;line-height:1.4;background-color:transparent"
        target="_blank">
      Are you a robot?
      </a>

    <!-- End of populating story "title" -->

    <p style="display:block;
      margin-top: 4px;
      margin-bottom: 4px;
      clear:both;
      color:#707070;font-size:12px;font-style:normal;font-family:Arial,sans-serif;font-weight:normal;line-height:1.3;background-color:transparent;">

        <img height="16"
             src="/media/images/contify-postlogin-assets/icons/png-icons/locked-transparent.png?v=2"
             style="vertical-align: sub;"
        >

        <a href="http://www.cfy42.us/url/n5_uj_wBc9hbOKZFXOEI_yHA8bficdn2jXmimrRVxaV9Ww1y0p29aL1t9oq0vgA=="
          style="margin-left: 0;
          text-decoration: none;
          color:#707070;font-size:12px;font-style:normal;font-family:Arial,sans-serif;font-weight:normal;line-height:1.3;background-color:transparent;">

              Bloomberg

        </a>

      &nbsp;|&nbsp;

        <span style="text-decoration: none;
          border:none;
          color:inherit!important;">
          11 Jul 2024
        </span>

    </p> <!-- End of populating "pub_date" and "source" -->

  </td>
</tr>

    <tr>
      <td height="12"></td>
    </tr>
    <tr>
      <td>
        <div style=" font-size: 14px;
                  line-height: 1.4;
                  margin: 0;
                  text-decoration:none !important;
                  text-align: justify;
                  word-break: break-word;
                  color:#313131;font-size:14px;font-style:normal;font-family:Arial,sans-serif;font-weight:normal;line-height:1.4;background-color:transparent">

            Why did this happen? Please make sure your browser supports JavaScript and cookies and that you are not blocking them from loading. For more information you can review our Terms of Service and Cookie Policy.

        </div>

      </td>
    </tr>

Code sample

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

18 Jul

1 Updates

 
New Section
Are you a robot?

Bloomberg  |  11 Jul 2024

Why did this happen? Please make sure your browser supports JavaScript and cookies and that you are not blocking them from loading. For more information you can review our Terms of Service and Cookie Policy.
More articles like this? Yes No
 

Curated By

Kamal Gupta

TechTeamTest

kamal.gupta@contify.com

Your environment

liborm85 commented 2 months ago

pdfkit does not support converting from html to pdf.