In this article, you will learn how to convert HTML to PDF programmatically and using free online HTML to PDF Converter.
Created
March 21, 2023 16:35
Free Online HTML to PDF Converter - Convert HTML File to PDF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prepare convert settings | |
ConvertSettings settings = new ConvertSettings(); | |
settings.setFilePath("java-testing/input-sample-file.html"); | |
settings.setFormat("pdf"); | |
settings.setOutputPath("java-testing/output-sample-file.pdf"); | |
// convert to specified format | |
List<StoredConvertedResult> response = apiInstance.convertDocument(new ConvertDocumentRequest(settings)); | |
System.out.println("Document converted successfully: " + response); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create necessary API instances | |
convert_api = groupdocs_conversion_cloud.ConvertApi.from_keys(client_id, client_secret) | |
# Prepare convert settings | |
settings = groupdocs_conversion_cloud.ConvertSettings() | |
settings.file_path = "sample.html" | |
settings.format = "pdf" | |
settings.output_path = "converted" | |
# Convert document request | |
request = groupdocs_conversion_cloud.ConvertDocumentRequest(settings) | |
# convert to specified format | |
result = convert_api.convert_document(request) | |
print("Document converted: " + result[0].path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment