/ Published in: Java
This code sample shows how Java developers can create PDF file from HTML using Aspose.Pdf for Cloud API in their REST applications.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//build uri to create empty pdf String strURI = "http://api.aspose.com/v1.1/pdf/outPdfFile.pdf?templateFile=input.html&templateType=html"; InputStreamresponseStream = ProcessCommand(signedURI, "PUT"); Gsongson = new Gson(); //Parse the json string to JObject and Deserializes the JSON to a object. BaseResponsebaseResponse = gson.fromJson(strJSON,BaseResponse.class); if (baseResponse.getCode().equals("200") &&baseResponse.getStatus().equals("OK")) //Here is the BaseResponse class public class BaseResponse { publicBaseResponse() { } }
URL: http://www.aspose.com/docs/display/pdfcloud/Create+PDF+from+HTML