Convert HTML Forms to PDF – Aspose.HTML Cloud

This article demonstrates how to convert HTML forms into PDF documents using Aspose.HTML Cloud. Converting forms to PDF is ideal for capturing submissions, creating fillable documents, or generating printable forms.

Before proceeding, ensure you have obtained an authorization token. Visit the Authorization Guide for detailed instructions.


HTML Form Example

Here’s an example of an HTML form ready to be converted into PDF:

 1<html>
 2  <body style="font-family: Arial;">
 3    <h1>Application Form</h1>
 4    <form>
 5      <label>Name:</label><br>
 6      <input type="text" name="name" value="John Doe"><br><br>
 7
 8      <label>Email:</label><br>
 9      <input type="email" name="email" value="john.doe@example.com"><br><br>
10
11      <label>Address:</label><br>
12      <textarea name="address">123 Main Street, Anytown</textarea><br><br>
13
14      <label>Subscribe to Newsletter:</label>
15      <input type="checkbox" name="subscribe" checked><br><br>
16
17      <input type="submit" value="Submit">
18    </form>
19  </body>
20</html>

API Request for Form Conversion

Endpoint: POST https://api.aspose.cloud/v4.0/html/conversion/html-pdf/sync

Request Body:

1{
2  "InputContent": "YOUR_HTML_FORM_CONTENT"
3}

Implementation Examples

Detailed examples in C# and JavaScript to convert HTML forms into PDF documents:

See Also