|
string clientID = "718e4235-8866-4ebe-bff4-f5a14a4b6466"; // Get ClientID from https://dashboard.aspose.cloud/ |
|
string clientSecret = "388e864b819d8b067a8b1cb625a2ea8e"; // Get CLientSecret from https://dashboard.aspose.cloud/ |
|
|
|
// file name for PDF to be created |
|
String fileName = "input.pdf"; |
|
|
|
// create an instance of PdfApi |
|
PdfApi pdfApi = new PdfApi(clientSecret, clientID); |
|
|
|
// Invoke Aspose.PDF Cloud SDK API to create empty pdf file |
|
DocumentResponse apiResponse = pdfApi.PutCreateDocument(fileName); |
|
|
|
// page number of PDF file |
|
int pageNumber = 1; |
|
|
|
// Insert 1st image in PDF on specified cooridnates |
|
// The cooridnates are in Point starting from Bottom-Left to Top-Right |
|
pdfApi.PostInsertImage(fileName, pageNumber, 10, 850, 310, 650, "Flower-Backgrounds.jpg"); |
|
|
|
// Insert 2nd image in PDF on specified cooridnates |
|
pdfApi.PostInsertImage(fileName, pageNumber, 320, 850, 600, 650, "png-vs-jpeg.jpg"); |
|
|
|
// Insert 3rd image in PDF on specified cooridnates |
|
pdfApi.PostInsertImage(fileName, pageNumber, 10, 620, 310, 420, "purple_flowers_201054.jpg"); |
|
|
|
// Insert 4th image in PDF on specified cooridnates |
|
pdfApi.PostInsertImage(fileName, pageNumber, 320, 620, 600, 420, "Forest.jpg"); |
|
|
|
// convert PDF file to JPEG format and save on Cloud storage |
|
var finalResponse = pdfApi.PutPageConvertToJpeg(fileName,pageNumber,"FinalConverted.jpeg"); |
|
|
|
if (finalResponse != null && finalResponse.Status.Equals("OK")) |
|
{ |
|
Console.WriteLine("PDF Converted to JPEG, Done!"); |
|
Console.ReadKey(); |
|
} |