Convert HTML Reports to PDF – Aspose.HTML Cloud
Contents
[
Hide
Show
]This article explains how to convert HTML-based reports into PDF documents using Aspose.HTML Cloud. Converting HTML reports to PDF allows users to easily share, archive, and present structured information clearly and professionally.
Ensure you have an authorization token before starting. See the Authorization Guide for details.
HTML Report Example
Here’s a typical example of an HTML report:
1<html>
2 <body style="font-family: Arial;">
3 <h1>Sales Report Q1 2025</h1>
4 <p>Date: April 1, 2025</p>
5 <table border="1" cellpadding="8">
6 <thead>
7 <tr>
8 <th>Product</th>
9 <th>Region</th>
10 <th>Sales</th>
11 <th>Growth (%)</th>
12 </tr>
13 </thead>
14 <tbody>
15 <tr>
16 <td>Product A</td>
17 <td>North America</td>
18 <td>$120,000</td>
19 <td>5%</td>
20 </tr>
21 <tr>
22 <td>Product B</td>
23 <td>Europe</td>
24 <td>$95,000</td>
25 <td>8%</td>
26 </tr>
27 </tbody>
28 </table>
29 </body>
30</html>
API Request for Report Conversion
Endpoint: POST https://api.aspose.cloud/v4.0/html/conversion/html-pdf/sync
Request Body:
1{
2 "InputContent": "YOUR_GENERATED_HTML_REPORT_CONTENT"
3}
Implementation Examples
Detailed examples in C# and JavaScript for converting HTML reports to PDF: