alihassan143 / htmltopdfwidgets

Html To Pdf
https://pub.dev/packages/htmltopdfwidgets
Apache License 2.0
12 stars 18 forks source link

Inline CSS not loaded. #28

Closed VanilaTechBibhut closed 5 months ago

VanilaTechBibhut commented 6 months ago

Inline CSS of my html string is not rendered in pdf.

alihassan143 commented 6 months ago

@VanilaTechBibhut can you provide sample code to produce

fldvlpr commented 6 months ago

@alihassan143 I'm also facing the same issue,

Following is one of the sample, previously it was working, now it's breaking.

<!DOCTYPE html>

<body>

<!--HEADER/BANNER START-->

<p align=center><img style="max-width: 600px; width: 100%" border=0 hspace=0 alt="Email Banner" align=baseline src="http://trailblz.info/license/images/political-email-banner-600px-wide-122px-high.png"></p>

<div style="max-width: 600px; width: 100%; margin-left: auto; margin-right: auto;" align=center>

<table style="max-width: 600px; height: 25px; margin-left: auto; width: 100%; background-color: #cc0000; margin-right: auto" align=center>

</table>

</div>

<!--HEADER/BANNER END-->

<!--CONTENT OF BODY START-->

<div align=center>

<table style="max-width: 600px; margin-left: auto; width: 100%; margin-right: auto" cellSpacing=0 cellPadding=0 align=center>

<tbody>

<tr>

<td style="max-width: 600px; height: 350px; padding-bottom: 10px; text-align: left; padding-top: 75px; padding-left: 20px; padding-right: 20px; width: 100%; background-color: #fcfcfc; margin-left: auto; margin-right: auto;" vAlign=top>

Dear Subscriber,

<br/>

<br/>

Opening paragraph.

<br/>

<br/>

Main content of message goes here.

<br/>

<br/>

Closing statements.

<br/>

<br/>

Sincerely,

<br/>

<br/>

<img alt=Signature src="http://trailblz.info/license/images/signature-jaun-g-pablo.png" />

</td>

</tr>

<!--CONTENT OF BODY END-->

<!--FOOTER START-->

<tr>

<td style="height: 135px; text-align: center; margin-top: 25px; background-color: #2a2a2a">

<span style="color: #c3c3c3">

<br/>

<u>[www.JuanPabloForCongress.com](http://www.juanpabloforcongress.com/)</u></a>

<br/>

<br/>

Paid for by the Campaign to Elect Juan Pablo for US Congress.

<br/>

1600 Pennsylvania Ave NW

<br/>

Washington, DC 20500

<br/>

<br/>

</span>

<!--SOCIAL OUTLETS START-->

<span><a href="https://www.facebook.com/YourFaceBookPage"><img style="border: 0px; margin-right: 5px; margin-bottom: 10px; opacity: 0.9" alt=Facebook title=Facebook src="http://trailblz.info/license/images/fb-35x35-pixels.png" /></a>

</span>

<span><a href="https://www.twitter.com/YourTwitterPage"><img style="border: 0px; margin-left: 5px; margin-bottom: 10px; opacity: 0.9" alt=Twitter title=Twitter src="http://trailblz.info/license/images/twitter-35x35-pixels.png" /></a>

</span>

<!--SOCIAL OUTLETS END-->

</td>

</tr>

</tbody>

</table>

<!--FOOTER END-->

</div>

</body>

</html>

One more template of mine is also failing, which also had following type of header values in html content like, We are using now your package with Printing package which is supported in android, ios, web and desktop and all this are failing can you please add the support for it.

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="theme-color" content="#1B61B5;" />
    <title>Prescription Template</title>
    <link
      href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap"
      rel="stylesheet"/>
    <style>
      * {
        font-family: "DM Sans", sans-serif;
      }

      table {
        border-spacing: 0;
        border-collapse: collapse;
        margin: 0;
      }

      @media print {
        body {
          -webkit-print-color-adjust: exact;
        }
      }
    </style>
  </head>

Looking forward for updates. Thanks

alihassan143 commented 6 months ago

@fldvlpr i made this package to support rich text documents to be downloaded as pdf as they are written but I didn't plan yet to make this to support all HTML styling but I will work on this scenario to fill the requirements of the different HTML templating

alihassan143 commented 6 months ago

@fldvlpr package is opened to any feature PR if you developed this feature than you can create a PR and I will merge the PR after code review

datpt11 commented 5 months ago

same issue

alihassan143 commented 5 months ago

currently don't have plan to support templating base rendering current goal is to support all RIch Text editor styling formats