Search
 
SCRIPT & CODE EXAMPLE
 

HTML

flutter html to pdf

var htmlContent =
"""
<!DOCTYPE html>
<html>
<head>
  <style>
  table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
  }
  th, td, p {
    padding: 5px;
    text-align: left;
  }
  </style>
</head>
  <body>
    <h2>PDF Generated with flutter_html_to_pdf plugin</h2>
    <table style="width:100%">
      <caption>Sample HTML Table</caption>
      <tr>
        <th>Month</th>
        <th>Savings</th>
      </tr>
      <tr>
        <td>January</td>
        <td>100</td>
      </tr>
      <tr>
        <td>February</td>
        <td>50</td>
      </tr>
    </table>
    <p>Image loaded from web</p>
    <img src="https://i.imgur.com/wxaJsXF.png" alt="web-img">
  </body>
</html>
""";

var targetPath = "/your/sample/path";
var targetFileName = "example_pdf_file"

var generatedPdfFile = await FlutterHtmlToPdf.convertFromHtmlContent(
    htmlContent, targetPath, targetFileName);
Comment

PREVIOUS NEXT
Code Example
Html :: tab image code 
Html :: bold text on HTML button 
Html :: mailto subject 
Html :: top bar html 
Html :: how to check system is 32 or 64 linux 
Html :: predefine data list in input 
Html :: how to get a division to be in centre of screen in responsive web page for screen of any size 
Html :: html phone number 
Html :: canonical link 
Html :: nuxt link relative path 
Html :: change icon html 
Html :: html input radio group 
Html :: html meta tags for seo 
Html :: html multiple checkbox list 
Html :: copyright html 
Html :: html pattern not working 
Html :: android back arrow 
Html :: how to render a sprite in html5 
Html :: html date 
Html :: add csrf token in vuejs 
Html :: onclick to next page in html 
Html :: ion input form autocomplete 
Html :: add svg to html 
Html :: <input autocomplete="off"</input 
Html :: vimeo sdk 
Html :: html submit form onclick 
Html :: contenteditable html 
Html :: how to make a file downloadable in html 
Html :: text monospace bootstrap 
Html :: html bullet symbol 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =