Convert html string to pdf with external resource

would like to check how do i generate a pdf from HTML string with external resources like font file, custom CSS files, boostrap CSS?

1 Like

@bczm8703

Could you please share the complete detail of your use case along with input HTML? Please also share the expected output PDF. We will then provide you more information on it.

hi. i want to convert the following HTML into pdf. the HTML contains some bootstrap class and my own CSS classes. would like to know how do load the bootstrap CSS to Aspose so that the pdf will look like the attached image

<html>
<body>
  <div>
    <h2>1 Jan 2021 Factsheet</h2>
  </div>
  <div class="container-fluid">
    <div class="row">
      <div class="col-6 fw-bold">Date generated</div>
      <div class="col-6">1 Jan 2021</div>
    </div>
      <div class="row">
      <div class="col-6 fw-bold">Time generated</div>
      <div class="col-6">9.00am</div>
    </div>
    <div class="row">
      <div class="col-12"><h1>Company A</h1></div>
    </div>
    <div class="row">
      <div class="col-12">
        <div class="user-status bg-warning" style="font-size:12px;"><span>Key Member</span></div>
        <div class="user-status bg-warning" style="font-size:12px;"><span>Straegic partner</span></div>
      </div>
    </div>
     <div class="row">
      <div class="col-6 fw-bold">Membership category</div>
      <div class="col-6">Associate</div>
    </div>
     <div class="row">
      <div class="col-6 fw-bold">Description</div>
      <div class="col-6">Proin eu sagittis pellentesque dui consequat netus. Odio et arcu nisi, dui vel eleifend pellentesque congue. Vivamus nunc porta aliquet duis elementum</div>
    </div>
     <div class="row">
      <div class="col-6 fw-bold">Premises address</div>
      <div class="col-6">123 road 3</div>
    </div>
  </div>
</body>
</html>

samplePDF.png (13.7 KB)

@bczm8703

Please refer to the following article to convert HTML to PDF.
Convert HTML to PDF file in .NET

If you face any issue, please share complete CSS files and input HTML for testing. We will investigate the issue and provide you information on it.

A post was merged into an existing topic: Multiselect and radio is not working in PDF After conversion of html to pdf file