HTML Content to PDF – Aspose.HTML Cloud
This article demonstrates how to convert HTML content provided as a direct string input into PDF documents using the Aspose.HTML Cloud API.
Before proceeding, ensure you have obtained an authorization token. Visit the Authorization Guide for more information.
HTML Content Example
Here’s an example of HTML content that we’ll convert to PDF:
1<html>
2 <body>
3 <h1>HTML Content to PDF</h1>
4 <p>This PDF document was generated directly from HTML content.</p>
5 </body>
6</html>
API Request
Endpoint: POST https://api.aspose.cloud/v4.0/html/conversion/html-pdf/sync
Request Body:
1{
2 "InputContent": "<html><body><h1>HTML Content to PDF</h1><p>This PDF document was generated directly from HTML content.</p></body></html>"
3}