Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active June 6, 2020 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-cloud/71361d5535cecdec762e5f72b6966c7a to your computer and use it in GitHub Desktop.
Save aspose-cloud/71361d5535cecdec762e5f72b6966c7a to your computer and use it in GitHub Desktop.
This Gist contains examples of aspose.cloud APIs for Blog Posts
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Pdf-Cloud
// For complete examples and data files, please go to https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-dotnet
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
const string name = "PdfWithBookmarks.pdf";
string bookmarkPath = "2";
var bookmark = new Bookmark();
bookmark.Action = "GoTo";
bookmark.Bold = true;
bookmark.Italic = false;
bookmark.Title = "New Bookmark XYZ";
bookmark.PageDisplay = "XYZ";
bookmark.PageDisplayBottom = 10;
bookmark.PageDisplayLeft = 10;
bookmark.PageDisplayRight = 10;
bookmark.PageDisplayTop = 10;
bookmark.PageDisplayZoom = 2;
bookmark.PageNumber = 2;
bookmark.Color = new Color(255, 255, 0, 0);
var bookmarks = new List<Bookmark>();
bookmarks.Add(bookmark);
var response = pdfApi.PostBookmark(name, bookmarkPath, bookmarks, folder: TempFolder);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Cells-Cloud
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet
CellsApi cellsApi = new CellsApi(AppKey, AppSid);
string name = "myDocument.xlsx";
string sheetName = "SHEET4";
string chartType = "Pie";
int? upperLeftRow = 5;
int? upperLeftColumn = 5;
int? lowerRightRow = 10;
int? lowerRightColumn = 10;
string area = "C7:D11";
bool? isVertical = true;
string categoryData = null;
bool? isAutoGetSerialName = null;
string title = null;
string folder = "TEMPFOLDER";
UpdateDataFile(cellsApi,folder, name);
var response = cellsApi.CellsChartsPutWorksheetAddChart(name, sheetName, chartType, upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, area, isVertical, categoryData, isAutoGetSerialName, title, folder);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Words-Cloud
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet
WordsApi wordsApi = new WordsApi(MyAppKey, MyAppSid);
var localName = "Test_Document.docx";
var remoteName = "TestInsertDocumentWatermarkImage.docx";
var fullName = Path.Combine(this.dataFolder, remoteName);
var destFileName = Path.Combine(BaseTestOutPath, remoteName);
double rotationAngle = 0F;
var image = "aspose-cloud.png";
using (var file = File.OpenRead(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + image))
{
this.UploadFileToStorage(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));
var request = new InsertWatermarkImageRequest(remoteName,
file,
this.dataFolder,
rotationAngle: rotationAngle,
destFileName: destFileName);
var actual = wordsApi.InsertWatermarkImage(request);
}
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Words-Cloud
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet
WordsApi wordsApi = new WordsApi(MyAppKey, MyAppSid);
var localName = "Test_Document.docx";
var remoteName = "TestInsertWatermarkText.docx";
var fullName = Path.Combine(this.dataFolder, remoteName);
var destFileName = Path.Combine(BaseTestOutPath, remoteName);
var body = new WatermarkText { Text = "WATERMARK", RotationAngle = 315.0f };
this.UploadFileToStorage(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));
var request = new InsertWatermarkTextRequest(remoteName, body, this.dataFolder, destFileName: destFileName);
var actual = wordsApi.InsertWatermarkText(request);
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Get Authenication Token(JWT)
curl "https://api.aspose.cloud/connect/token"
-X POST
-d "grant_type=client_credentials&client_id=[App_SID]&client_secret=[App_Key]"
-H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json"
// Upload file to Aspose Cloud Storage
curl -X PUT "https://api.aspose.cloud/v3.0/3d/storage/file/Temp/test.fbx"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: multipart/form-data"
-F "File=@C:/Temp/test.fbx"
// Convert 3D file to other supported format
curl -X POST "https://api.aspose.cloud/v3.0/3d/saveas/newformat?name=test.fbx&newformat=pdf&newfilename=test.pdf&IsOverwrite=false"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Get Authenication Token(JWT)
curl "https://api.aspose.cloud/connect/token"
-X POST
-d "grant_type=client_credentials&client_id=[App_SID]&client_secret=[App_Key]"
-H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json"
// Upload file to Aspose Cloud Storage
curl -X PUT "https://api.aspose.cloud/v3.0/3d/storage/file/Temp/Aspose3D.pdf"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: multipart/form-data"
-F "File=@C:/Temp/Aspose3D.pdf"
// Triangulate a 3D file
curl -X POST "https://api.aspose.cloud/v3.0/3d/triangulate/new?name=Aspose3D.pdf&newfilename=triangle.pdf&newformat=pdf"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to upload file to Cloud Storage
curl -v "https://api.aspose.cloud/v3.0/3d/storage/file/Test1.fbx" \
-X PUT \
-H "accept: application/json" \
-H "authorization: Bearer <jwt token>" \
-H "Content-Type: multipart/form-data" \
-d {"File":{}}
// cURL example to convert FBX to PDF
// set values of parameters to specify file names and formats
curl -v "https://api.aspose.cloud/v3.0/3d/saveas/newformat?name=Test1.fbx&newformat=pdf&newfilename=FBXtoPDF.pdf&IsOverwrite=false" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer <jwt token>"
// cURL example to download file from Cloud Storage
curl -X GET "https://api.aspose.cloud/v3.0/3d/storage/file/FBXtoPDF.pdf" \
-H "accept: multipart/form-data" \
-H "authorization: Bearer <jwt token>" \
-o FBXtoPDF.pdf
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to upload file to Cloud Storage
curl -v "https://api.aspose.cloud/v3.0/3d/storage/file/Test1.glb" \
-X PUT \
-H "accept: application/json" \
-H "authorization: Bearer <jwt token>" \
-H "Content-Type: multipart/form-data" \
-d {"File":{}}
// cURL example to convert GLB to PDF
// set values of parameters to specify file names and formats
curl -v "https://api.aspose.cloud/v3.0/3d/saveas/newformat?name=Test1.glb&newformat=pdf&newfilename=GLBtoPDF.pdf&IsOverwrite=false" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer <jwt token>"
// cURL example to download file from Cloud Storage
curl -X GET "https://api.aspose.cloud/v3.0/3d/storage/file/GLBtoPDF.pdf" \
-H "accept: multipart/form-data" \
-H "authorization: Bearer <jwt token>" \
-o GLBtoPDF.pdf
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Instantiate Aspose BarCode Cloud API SDK
var barCodeApi = new BarCodeApi(AppKey, AppSid);
// Set Filename of image
String datafolder = "C:/Temp/";
// Set Filename of image
String name = "sample-barcode";
// Set Text to encode inside barcode
String text = "Aspose.BarCode";
// Set Barcode Symbology
String type = "datamatrix";
// Set Barcode Image Format
String format = "PNG";
// Sets if checksum will be added to barcode image.
String enableChecksum = null;
// Set optional params (if any)
float? resolutionX = null;
float? resolutionY = null;
float? dimensionX = null;
float? dimensionY = null;
try
{
// Invoke Aspose.BarCode Cloud SDK API to create barcode and returns result as stream in the response
using (Stream response = barCodeApi.BarCodeGetBarCodeGenerate(new BarCodeGetBarCodeGenerateRequest(text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, enableChecksum)))
// Download generated barcode from api response
using (FileStream stream = File.Create(datafolder + name + "." + format))
{
response.CopyTo(stream);
}
Console.WriteLine("Generate Barcode to Local File, Done!");
}
catch (Exception ex)
{
Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Instantiate Aspose BarCode Cloud API SDK
var barCodeApi = new BarCodeApi(AppKey, AppSid);
// Set Filename of image
String datafolder = "C:/Temp/";
// Set input file name
String name = "sample-barcode.png";
// The barcode type. If this parameter is empty, autodetection of all supported types is used.
String type = "";
// Set mode for checksum validation during recognition
String checksumValidation = "";
// Set if FNC symbol stripping should be performed
bool stripFnc = false;
// Set recognition of rotated barcode
int rotationAngle = 0;
// Set the image file url
String url = null;
Stream file = System.IO.File.OpenRead(datafolder + name);
try
{
// Invoke Aspose.BarCode Cloud SDK API to read barcode from local file
var apiResponse = barCodeApi.BarCodePostBarCodeRecognizeFromUrlorContent( new BarCodePostBarCodeRecognizeFromUrlorContentRequest(type, checksumValidation, stripFnc, rotationAngle, url, file));
if (apiResponse != null)
{
foreach (var barcode in apiResponse.BarCodes)
{
Console.WriteLine("Codetext: " + barcode.BarCodeValue + "\nType: " + barcode.BarCodeType);
}
Console.WriteLine("Read Barcode from Local File, Done!");
}
}
catch (Exception ex)
{
Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Cells-Cloud
private CellsApi instance;
instance = new CellsApi( clientId, clientSecret);
string name = "myDocument.xlsx";
string sheetName = "SHEET4";
string chartType = "Pie";
int? upperLeftRow = 5;
int? upperLeftColumn = 5;
int? lowerRightRow = 20;
int? lowerRightColumn = 15;
string area = "A1:A3";
bool? isVertical = true;
string categoryData = null;
bool? isAutoGetSerialName = null;
string title = "TEST TITLE";
string folder = TEMPFOLDER;
UpdateDataFile(instance,folder, name);
var response = instance.CellsChartsPutWorksheetAddChart(name, sheetName, chartType, upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, area, isVertical, categoryData, isAutoGetSerialName, title, folder);
Assert.IsInstanceOf<ChartsResponse>(response, "response is ChartsResponse");
Assert.AreEqual(response.Code, 200);
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to add empty worksheet in previously created workbook
curl -v "https://api.aspose.cloud/v3.0/cells/CellsCloud.xlsx/worksheets/AsposeSheet?position=2" \
-X PUT \
-H "accept: application/json" \
-H "authorization: Bearer <jwt token>"
//Add validation by Index in the worksheet
curl -X PUT "https://api.aspose.cloud/v3.0/cells/aspose_Test.xlsx/worksheets/Sheet1/validations?range=A1:A1&folder=Temp"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to create empty workbook
curl -v "https://api.aspose.cloud/v3.0/cells/CellsCloud.xlsx" \
-X PUT \
-H "accept: application/json" \
-H "Content-Length: 0" \
-H "authorization: Bearer <jwt token>"
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to create empty workbook based on template
curl -v "https://api.aspose.cloud/v3.0/cells/CellsCloud.xlsx?templateFile=Template.xlsx" \
-X PUT \
-H "accept: application/json" \
-H "authorization: Bearer <jwt token>"
//Delete all validation from the worksheet
curl -X DELETE "https://api.aspose.cloud/v3.0/cells/aspose_Test.xlsx/worksheets/Sheet1/validations?folder=Temp"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
//Add custom validation rule by Index in the worksheet
curl -X POST "https://api.aspose.cloud/v3.0/cells/aspose_Test.xlsx/worksheets/Sheet1/validations/0?folder=Temp"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: application/json" -d "{ \"AreaList\": [ { \"EndColumn\": 0, \"EndRow\": 0, \"StartColumn\": 0, \"StartRow\": 0 } ], \"Formula1\": \"=(OR(A1=\\\"Yes\\\",A1=\\\"No\\\"))\", \"Type\": \"Custom\", \"IgnoreBlank\": true}"
// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl "https://api.aspose.cloud/oauth2/token"
-X POST
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]"
-H "Content-Type: application/x-www-form-urlencoded"
-H "Accept: application/json"
// cURL example to upload file to default Aspose Cloud Storage using Aspose.Storage Cloud
curl "https://api.aspose.cloud/v1.1/storage/file?path=test.xlsx"
-X PUT
-T C:/Temp/test.xlsx
-H "Content-Type: multipart/form-data"
-H "Accept: application/json"
-H "Authorization: Bearer [ACCESS_TOKEN]"
// cURL example to convert Excel Document to PDF
curl -v "http://api.aspose.cloud/v1.1/cells/test.xlsx/saveAs?newfilename=test.pdf"
-X POST
-d '{"SaveFormat":"pdf"}'
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer [Access_Token]"
// cURL example to download file from default Aspose Cloud Storage using Aspose.Storage Cloud
curl "https://api.aspose.cloud/v1.1/storage/file?path=test.pdf"
-X GET
-H "Content-Type: application/json"
-H "Accept: multipart/form-data"
-H "Authorization: Bearer [Access_Token]"
--output C:/Temp/test.PDF
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
//cURL example to convert Excel file to PDF
curl -v "https://api.aspose.cloud/v3.0/cells/CellsCloud.xlsx/SaveAs?newfilename=CellsCloud.pdf&isAutoFitRows=false&isAutoFitColumns=false" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer <jwt token>" \
-H "Content-Type: application/json" -d "{ \"SaveFormat\": \"pdf\"}"
// First get JSON Web Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl "https://api.aspose.cloud/connect/token"
-X POST
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]"
-H "Content-Type: application/x-www-form-urlencoded"
-H "Accept: application/json"
// cURL example to upload file to Aspose Cloud Storage
curl -X PUT "https://api.aspose.cloud/v3.0/cells/storage/file/test.xlsx"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: multipart/form-data"
-F "File=@C:/Temp/test.xlsx"
// cURL example to convert XLSX to PDF
curl -X POST "https://api.aspose.cloud/v3.0/cells/test.xlsx/SaveAs?newfilename=test.pdf"
-H "accept: multipart/form-data"
-H "authorization: Bearer [Access_Token]"
-d '{"SaveFormat":"pdf"}'
// Download updated file from Aspose Cloud Storage
curl -X GET "https://api.aspose.cloud/v3.0/cells/storage/file/test.pdf"
-H "accept: multipart/form-data"
-H "authorization: Bearer [Access_Token]"
--output C:/Temp/test_output.pdf
// cURL example to convert Excel Document to Markdown
curl -v "https://api.aspose.cloud/v1.1/cells/Book1.xlsx/SaveAs?newfilename=Book1.md&isAutoFitRows=true&isAutoFitColumns=true" \
-X POST \
-d "{"SaveFormat":"markdown","OnePagePerSheet":true}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer [Access_Token]"
// cURL example to upload file to Aspose Cloud Storage
curl "https://api.aspose.cloud/v1.1/storage/file?path=Book1.xlsx"
-X PUT
-T C:/Temp/Book1.xlsx
-H "Content-Type: multipart/form-data"
-H "Accept: application/json"
-H "Authorization: Bearer [ACCESS_TOKEN]"
# Get your app_sid and app_key at https://dashboard.aspose.cloud (free registration is required).
app_sid = 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxx'
app_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
imaging_api = asposeimagingcloud.ImagingApi(app_key, app_sid)
try:
# upload local image to storage
upload_file_request = asposeimagingcloud.UploadFileRequest('test.otg', 'VariousObjectsMultiPage.otg')
result = imaging_api.upload_file(upload_file_request)
# inspect result.errors list if there were any
# inspect result.uploaded list for uploaded file names
# convert image from storage to BMP
save_as_request = asposeimagingcloud.SaveImageAsRequest('test.otg', 'bmp', None)
converted_image = imaging_api.save_image_as(save_as_request)
# process resulted image
# for example, save it to storage
upload_file_request = asposeimagingcloud.UploadFileRequest('resultImage.bmp', converted_image)
result = imaging_api.upload_file(upload_file_request)
# inspect result.errors list if there were any
# inspect result.uploaded list for uploaded file names
except Exception as e:
print(e)
// cURL example to convert OTG Image to BMP and save result to local drive
curl -X GET "https://api.aspose.cloud/v3.0/imaging/VariousObjectsMultiPage.otg/saveAs?format=bmp"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
--output C:/Temp/OTGtoBMP.bmp
// cURL example to resize an image and save result to local drive
curl -v "https://api.aspose.cloud/v3/imaging/WaterMark.bmp/resize?format=pdf&newWidth=400&newHeight=400" \
-X GET \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer [JWT_Token]" \
-o C:/Temp/WaterMark_out.pdf
// cURL example to upload file from local drive to Aspose default storage
curl -X PUT "https://api.aspose.cloud/v3.0/imaging/storage/file/ImageResult%2FWaterMark_out.pdf" \
-H "accept: application/json" \
-H "authorization: Bearer [JWT_Token]" \
-H "Content-Type: multipart/form-data" \
-T C:/Temp/WaterMark_out.pdf
// Add Bookmarks to PDF docuemnt
curl -X POST "https://api.aspose.cloud/v3.0/pdf/4pages.pdf/bookmarks/bookmark"
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer [JWT_Access_Token]"
-d "[{"Title": "Page 1 (XYZ)", "Italic": true, "Bold": false, "Color": {"A": 255, "R": 255, "G": 0, "B": 0 }, "Action": "GoTo", "Level": null, "Destination": null, "PageDisplay": "XYZ", "PageDisplay_Bottom": null, "PageDisplay_Left": 82, "PageDisplay_Right": null, "PageDisplay_Top": 784, "PageDisplay_Zoom": 2, "PageNumber": 1, "RemoteFile": null, "Bookmarks": null, "Links": null } ]"
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.PDF-Cloud
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
string name = "02_pages.pdf";
var textBoxes = new List<TextBoxField> {
new TextBoxField(PageIndex: 1, IsGroup: false)
{
Color = new Color(255, 255, 0, 0),
Multiline = true,
MaxLen = 100,
Rect = new Rectangle(100, 100, 500, 200),
Value = "Page 1\nValue",
PartialName = "testField",
},
new TextBoxField(PageIndex: 2, IsGroup: false)
{
Color = new Color(255, 255, 0, 0),
Multiline = true,
MaxLen = 100,
Rect = new Rectangle(100, 100, 500, 200),
Value = "Page 2\nValue",
PartialName = "testField1",
}
};
// Add TextBoxField
var response = pdfApi.PostTextBoxFields(name, textBoxes);
Console.WriteLine(response);
public void PostPageCertifyTest()
{
const string name = "4pages.pdf";
UploadFile(name, name);
const string signatureName = "33226.p12";
UploadFile(signatureName, signatureName);
const string pass = "sIikZSmz";
DocMDPAccessPermissionType permissionType = DocMDPAccessPermissionType.NoChanges;
Signature signature = new Signature(
Authority: "Sergey Smal",
Contact: "test@mail.ru",
Date: "08/01/2012 12:15:00.000 PM",
FormFieldName: "Signature1",
Location: "Ukraine",
Password: pass,
Rectangle: new Rectangle(
LLX: 100,
LLY: 100,
URX: 500,
URY: 200),
SignaturePath: Path.Combine(TempFolder, signatureName),
SignatureType: SignatureType.PKCS7,
Visible: true,
ShowProperties: false);
var response = PdfApi.PostPageCertify(name, pageNumber: 1, sign: signature,
docMdpAccessPermissionType: permissionType.ToString(), folder: TempFolder);
}
// Export FDF Data from PDF Form
curl -X GET "https://api.aspose.cloud/v3.0/pdf/PDF%20Form.pdf/export/fdf"
-H "accept: multipart/form-data"
-H "authorization: Bearer [Access_Token]"
--output C:/Temp/ExportFDF.fdf
// Export XFDF Data from PDF Form
curl -X GET "https://api.aspose.cloud/v3.0/pdf/PDF%20Form.pdf/export/xfdf"
-H "accept: multipart/form-data"
-H "authorization: Bearer [Access_Token]"
--output C:/Temp/ExportXFDF.xfdf
// Export XML Data from PDF Form
curl -X GET "https://api.aspose.cloud/v3.0/pdf/PDF%20Form.pdf/export/xml"
-H "accept: multipart/form-data"
-H "authorization: Bearer [Access_Token]"
--output C:/Temp/ExportXML.xml
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.PDF-Cloud
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
string name = "02_pages.pdf";
// Get TextBox fields list from PDF document
var response = pdfApi.GetDocumentTextBoxFields(name);
foreach ( TextBoxField textBoxField in response.Fields.List)
{
Console.WriteLine(textBoxField);
Console.WriteLine(".....");
}
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.PDF-Cloud
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
string name = "02_pages.pdf";
// Get TextBox field by name from PDF Document
var response = pdfApi.GetTextBoxField(name, fieldName: "testField");
Console.WriteLine(response);
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.PDF-Cloud
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
string name = "02_pages.pdf";
// Get TextBox fields from PDF page
var response = pdfApi.GetPageTextBoxFields(name, pageNumber: 1);
foreach ( TextBoxField textBoxField in response.Fields.List)
{
Console.WriteLine(textBoxField);
Console.WriteLine(".....");
}
// Import FDF Data into PDF Form
curl -X GET "https://api.aspose.cloud/v3.0/pdf/PDF%20Form.pdf/import/fdf?fdfFilePath=ExportFDF.fdf"
-H "accept: multipart/form-data"
-H "authorization: Bearer [Access_Token]"
--output C:/Temp/ImportFDF.pdf
// Import XFDF Data into PDF Form
curl -X GET "https://api.aspose.cloud/v3.0/pdf/PDF%20Form.pdf/import/xfdf?xfdfFilePath=ExportXFDF.xfdf"
-H "accept: multipart/form-data"
-H "authorization: Bearer [Access_Token]"
--output C:/Temp/ImportXFDF.pdf
// Import XML Data into PDF Form
curl -X GET "https://api.aspose.cloud/v3.0/pdf/PDF%20Form.pdf/import/xml?xmlFilePath=exportXML.xml"
-H "accept: multipart/form-data"
-H "authorization: Bearer [Access_Token]"
--output C:/Temp/ImportXML.pdf
import asposepdfcloud
from asposepdfcloud.apis.pdf_api import PdfApi
# Get App key and App SID from https://cloud.aspose.com
pdf_api_client = asposepdfcloud.api_client.ApiClient(
app_key='xxxxxxxxxxxxxxxxxxxxxxxxxxx',
app_sid='xxxxxx-xxxx-xxxx-xxxxxxxx')
pdf_api = PdfApi(pdf_api_client)
filename = 'README.md'
remote_name = 'READMESaveAs.md'
#upload Markdown file to storage
pdf_api.upload_file(remote_name,filename)
#Covert Markdown to PDF and return resultant file in response
response=pdf_api.get_markdown_in_storage_to_pdf(remote_name)
import os
import asposepdfcloud
from asposepdfcloud.apis.pdf_api import PdfApi
# Get App key and App SID from https://cloud.aspose.com
pdf_api_client = asposepdfcloud.api_client.ApiClient(
app_key='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
app_sid='xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')
pdf_api = PdfApi(pdf_api_client)
filename = '4pages.pdf'
remote_name = '4pages.pdf'
output_file= '4pages.xml'
#upload PDF file to storage
pdf_api.upload_file(remote_name,filename)
#Covert PDF to XML and save in Aspose default storage
response=pdf_api.put_pdf_in_storage_to_xml(remote_name,output_file)
print(response)
// Upload file to Aspose Cloud Storage
curl -X PUT "https://api.aspose.cloud/v3.0/pdf/storage/file/4pages.pdf"
-H "accept: application/json"
-H "authorization: Bearer [JWT_Access_Token]"
-H "Content-Type: multipart/form-data"
-T C:/Temp/4pages.pdf
//Update Slide Animation
curl -X PUT "https://api.aspose.cloud/v3.0/slides/animation.pptx/slides/1/animation"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: application/json"
-d "{"mainSequence":[{"type": "Appear","presetClassType":"Entrance","shapeIndex":1,"triggerType":"OnClick"},{"type":"Appear","presetClassType":"Entrance","shapeIndex":2,"triggerType":"OnClick"}],"interactiveSequences":[{"effects":[{"type":"Fly","subtype":"Bottom","presetClassType":"Entrance","shapeIndex":5,"triggerType":"OnClick" }],"triggerShapeIndex": 1}]}"
// Download updated file from Aspose Cloud Storage
curl -X GET "https://api.aspose.cloud/v3.0/slides/storage/file/animation.pptx"
-H "accept: multipart/form-data"
-H "authorization: Bearer [Access_Token]"
-o C:/Temp/animation_out.pptx
// Convert Presentation to POT Template
ccurl -X POST "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/pot"
-H "accept: multipart/form-data"
-H "authorization: Bearer [JWT_Acess_Token]"
-H "Content-Type: application/json"
--output C:/Temp/MyPresentation.pot
// Convert Presentation to Responsive HTML
curl -X POST "https://api.aspose.cloud/v3.0/slides/MyPresentation.pptx/html"
-H "accept: multipart/form-data"
-H "authorization: Bearer [JWT_Acess_Token]"
-H "Content-Type: application/json"
-d "{ "SaveAsZip": true, "SubDirectoryName": null, "SvgResponsiveLayout": true}"
--output C:/Temp/MyPresentation.zip
//Get a JSON/XML representation of the presentation
curl -X GET "https://api.aspose.cloud/v3.0/slides/test.ppt?password=Password123"
-H "x-aspose-timeout: 1"
-H "accept: application/json"
-H "authorization: Bearer [access_token]"
// Upload file to Aspose Cloud Storage
curl -X PUT "https://api.aspose.cloud/v3.0/slides/storage/file/animation.pptx"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: multipart/form-data"
-T C:/Temp/animation.pptx
// Convert Project document to PDF
curl -X GET "https://api.aspose.cloud/v3.0/tasks/NewProductDev.mpp/format?format=6"
-H "accept: multipart/form-data"
-H "authorization: Bearer [JWT_Access_Token]"
--output C:/temp/NewProductDev.pdf
// Upload file to Aspose Cloud Storage
curl -X POST "https://api.aspose.cloud/v3.0/tasks/storage/file/NewProductDev.mpp"
-H "accept: application/json"
-H "authorization: Bearer [JWT_Access_Token]"
-H "Content-Type: multipart/form-data"
-F "File=@C:/Temp/NewProductDev.mpp"
// First get JSON Web Token
// Please get your App Key and App SID from https://dashboard.aspose.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" argument.
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to get a list of paragraphs that are contained in the document or in the section
curl -v "https://api.aspose.cloud/v4.0/words/MyDocument.docx/paragraphs" \
-X GET \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer [Acess_Token]"
// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl "https://api.aspose.cloud/oauth2/token"
-X POST
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]"
-H "Content-Type: application/x-www-form-urlencoded"
-H "Accept: application/json"
// cURL example to upload file to Aspose Cloud Storage
curl "https://api.aspose.cloud/v1.1/storage/file?path=multilevellist.pdf"
-X PUT
-T C:/Temp/multilevellist.pdf
-H "Content-Type: multipart/form-data"
-H "Accept: application/json"
-H "Authorization: Bearer [ACCESS_TOKEN]"
// cURL example to convert PDF Document to Word
curl "https://api.aspose.cloud/v1.1/words/multilevellist.pdf/saveAs"
-X POST
-H "Content-Type: application/json"
-d '{"SaveFormat": "docx","FileName": "multilevellistapi.docx",}'
-H "Accept: application/json"
-H "Authorization: Bearer [ACCESS_TOKEN]"Aspose-Cloud
// First get JSON Web Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to upload file to Aspose Cloud Storage
curl "https://api.aspose.cloud/v4.0/words/storage/file/sample.pptx"
-X PUT
-H "accept: application/json"
-H "Content-Type: multipart/form-data"
-T C:/sample.pptx
-H "authorization: Bearer [ACCESS_TOKEN]"
// cURL example to convert PDF Document to Word
curl "https://api.aspose.cloud/v4.0/words/multilevellist.pdf/saveAs"
-X PUT
-H "Content-Type: application/json"
-d "{"SaveFormat": "docx","FileName": "multilevellistapi.docx",}"
-H "Accept: application/json"
-H "authorization: Bearer [ACCESS_TOKEN]"
//Replace the range contents
curl -X POST "https://api.aspose.cloud/v4.0/words/MyDocument.docx/range/id0.0/id0.1?destFileName=range_replace_test.docx"
-H "accept: application/json"
-H "authorization: Bearer [Acess_Token]"
-H "Content-Type: application/json"
-d "{ \"Text\": \"Aspose File Format Expert\"}"
<?php
require_once('C:\xampp\htdocs\aspose-diagram-cloud-php-master\vendor\autoload.php');
use Aspose\Diagram\Cloud\Api\DiagramApi;
use Aspose\Diagram\Cloud\Api\StorageApi;
use Aspose\Diagram\Cloud\Configuration;
use Aspose\Diagram\Cloud\Model;
$AppKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
$AppSid = 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx'; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
$diagramApi = new DiagramApi("client_credentials",$AppSid,$AppKey);
$storageApi = new StorageApi("client_credentials",$AppSid,$AppKey);
try {
$localFilePath = 'Drawing1.vsdx';
$destfilename = 'Drawing1.pdf';
$folder="Temp";
// Upload file to default storage
$response =$storageApi->uploadFile($folder,$localFilePath);
// Convert VSDX to PDF with SaveOptions
$saveOptionsRequest= new Model\SaveOptionsRequest();
$saveOptionsRequest->setFileName($destfilename);
$saveOptionsRequest->setFolder($folder);
$saveOptions = new Model\PdfSaveOptions();
$saveOptions->setIsExportComments(true);
$saveOptions->setJpegQuality(100);
$saveOptionsRequest->setSaveOptions($saveOptions);
$response=$diagramApi->saveAs($filename, $saveOptionsRequest, $folder, "true");
print_r($response);
echo "Completed!!!!";
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
PHP_EOL;
}
?>
// First get JSON Web Token
// Please get your App Key and App SID from https://dashboard.aspose.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" argument.
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to convert HTML file to PDF
curl -v "https://api.aspose.cloud/v3.0/html/convert/pdf?outPath=Aspose.HTML_Cloud.pdf" \
-X POST \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "file=@Aspose.HTML_Cloud.html;type=text/html" \
-H "authorization: Bearer <jwt token>"
// First get JSON Web Token
// Please get your App Key and App SID from https://dashboard.aspose.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" argument.
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to convert web page to PDF
curl -v "https://api.aspose.cloud/v3.0/html/convert/pdf?sourceUrl=https%3A%2F%2Fcompany.aspose.cloud/" \
-X GET \
-H "accept: multipart/form-data" \
-H "authorization: Bearer <jwt token>" \
-o Aspose.HTML_URLtoPDF.pdf
// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -X POST "https://api.aspose.cloud/connect/token"
-d "grant_type=client_credentials&client_id=[AppSID]&client_secret=[AppKey]"
-H "Content-Type: application/x-www-form-urlencoded"
-H "Accept: application/json"
//Upload soruce TIFF image to Aspose default storage
curl -X PUT "https://api.aspose.cloud/v3.0/imaging/storage/file/Temp%2FSampleTiff.tiff"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: multipart/form-data"
-F "imageData=@C:/Temp/SampleTiff.tiff"
//Update SVG image settings
curl -X PUT "https://api.aspose.cloud/v3.0/imaging/SampleTiff.tiff/filterEffect?format=tiff&filterType=GaussianBlur&folder=Temp"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: application/json"
-d "{"Radius":100,"Sigma":1}"
--output C:/Temp/Test.tiff
using System;
using System.IO;
using Aspose.Imaging.Cloud.Sdk.Api;
using Aspose.Imaging.Cloud.Sdk.Model.Requests;
namespace AsposeImagingCloudSdkExamples
{
/// <summary>
/// Deskew image example.
/// </summary>
/// <seealso cref="AsposeImagingCloudSDKExamples.ImagingBase" />
class DeskewImage : ImagingBase
{
/// <summary>
/// Initializes a new instance of the <see cref="DeskewImage"/> class.
/// </summary>
/// <param name="imagingApi">The imaging API.</param>
public DeskewImage(ImagingApi imagingApi) : base(imagingApi)
{
PrintHeader("Deskew image example:");
}
/// <summary>
/// Gets the name of the example image file.
/// </summary>
/// <value>
/// The name of the example image file.
/// </value>
/// <remarks>
/// Input formats could be one of the following:
/// BMP, GIF, JPEG, JPEG2000, PSD, TIFF, WEBP, PNG
/// </remarks>
protected override string SampleImageFileName => "Sample_05_Scan1_SkewToLeft.tif";
private const string SaveImageFormat = "tif";
/// <summary>
/// Deskews an image from a cloud storage.
/// </summary>
public void DeskewImageFromStorage()
{
Console.WriteLine("Deskew the image from cloud storage");
UploadSampleImageToCloud();
bool resizeProportionally = true;
string bkColor = "white";
string folder = CloudPath; // Input file is saved at the Examples folder in the storage
string storage = null; // We are using default Cloud Storage
var request = new DeskewImageRequest(SampleImageFileName, resizeProportionally, bkColor, folder, storage);
Console.WriteLine($"Call DeskewImage with params: resizeProportionally:{resizeProportionally}, bkColor:{bkColor}");
using (Stream updatedImage = this.ImagingApi.DeskewImage(request))
{
SaveUpdatedSampleImageToOutput(updatedImage, false, SaveImageFormat);
}
Console.WriteLine();
}
/// <summary>
/// Deskew an existing image, and upload updated image to a cloud storage.
/// </summary>
public void DeskewImageAndUploadToStorage()
{
Console.WriteLine("Deskews the image and upload to cloud storage");
UploadSampleImageToCloud();
bool resizeProportionally = true;
string bkColor = null;
string folder = CloudPath; // Input file is saved at the Examples folder in the storage
string storage = null; // We are using default Cloud Storage
var request = new DeskewImageRequest(SampleImageFileName, resizeProportionally, bkColor, folder, storage);
Console.WriteLine($"Call DeskewImage with params: resizeProportionally:{resizeProportionally}, bkColor:{bkColor}");
using (Stream updatedImage = this.ImagingApi.DeskewImage(request))
{
UploadImageToCloud(GetModifiedSampleImageFileName(false, SaveImageFormat), updatedImage);
}
Console.WriteLine();
}
/// <summary>
/// Deskews an image. Image data is passed in a request stream.
/// </summary>
public void CreateDeskewedImageFromRequestBody()
{
Console.WriteLine("Deskews the image from request body");
using (FileStream inputImageStream = File.OpenRead(Path.Combine(ExampleImagesFolder, SampleImageFileName)))
{
bool resizeProportionally = true;
string bkColor = "white";
string storage = null; // We are using default Cloud Storage
string outPath = null; // Path to updated file (if this is empty, response contains streamed image)
var request = new CreateDeskewedImageRequest(inputImageStream, resizeProportionally, bkColor, outPath, storage);
Console.WriteLine($"Call DeskewImage with params: resizeProportionally:{resizeProportionally}, bkColor:{bkColor}");
using (Stream updatedImage = this.ImagingApi.CreateDeskewedImage(request))
{
SaveUpdatedSampleImageToOutput(updatedImage, true, SaveImageFormat);
}
}
Console.WriteLine();
}
}
}
// Finding Duplicte Images
double? similarityThreshold = 80; // The similarity threshold
string folder = null; // Path to input files
string storage = null; // We are using default Cloud Storage
ImageDuplicatesSet imageDuplicatesSet = imagingApi.FindImageDuplicates(new FindImageDuplicatesRequest(searchContextId, similarityThreshold, folder, storage));
Console.WriteLine("Duplicates Set Count: " + imageDuplicatesSet.Duplicates.Count);
// process duplicates search results
foreach (var duplicates in imageDuplicatesSet.Duplicates)
{
Console.WriteLine("Duplicates:");
foreach (var duplicate in duplicates.DuplicateImages)
{
Console.WriteLine(
$"ImageName: {duplicate.ImageId}, Similarity: {duplicate.Similarity}");
}
// extract images features
foreach (FileInfo image in images)
{
CreateImageFeatures(image.Name, false, searchContextId);
}
/////////////////////
// Extract images features and add them to search context.
public static void CreateImageFeatures(string storageSourcePath, bool isFolder, string searchContextId)
{
var request = isFolder
? new CreateImageFeaturesRequest(searchContextId, imageId: null, imagesFolder: storageSourcePath, storage: null)
: new CreateImageFeaturesRequest(searchContextId, imageId: storageSourcePath, storage: null);
imagingApi.CreateImageFeatures(request);
}
def search_image_from_web_source(self):
"""Finds the similar images from the URL source"""
print('Finds similar images from URL:')
similarity_threshold = 30.0
max_count = 3
folder = ImagingAiBase.CLOUD_PATH # Folder with image to process
storage = None # We are using default Cloud Storage
# Add images from the website to the search context
image_source_url = urllib.quote_plus('https://www.f1news.ru/interview/hamilton/140909.shtml')
self._imaging_api.create_web_site_image_features(
requests.CreateWebSiteImageFeaturesRequest(self._search_context_id, image_source_url, folder, storage))
self._wait_idle(self._search_context_id)
# Download the image from the website
image_data = req.get('https://cdn.f1ne.ws/userfiles/hamilton/140909.jpg')
path = os.path.abspath(os.path.join(ImagingAiBase.OUTPUT_FOLDER, 'WebSearchSample.jpg'))
with open(path, "wb") as f:
f.write(image_data.content)
# Resize downloaded image to demonstrate search engine capabilities
resized_image = self._imaging_api.create_resized_image(requests.CreateResizedImageRequest(
path, 600, 400, "jpg", storage=storage))
# Upload image to cloud
image_name = 'ReverseSearch.jpg'
self._imaging_api.upload_file(requests.UploadFileRequest(ImagingAiBase.CLOUD_PATH + "/" + image_name,
resized_image, storage))
# Find similar images in the search context
find_response = self._imaging_api.find_similar_images(
requests.FindSimilarImagesRequest(self._search_context_id, similarity_threshold, max_count,
image_id=ImagingAiBase.CLOUD_PATH + "/" + image_name,
folder=folder, storage=storage))
print('Similar images found: ' + str(len(find_response.results)))
print('Similar image id: ' + find_response.results[0].image_id)
print('Similarity: ' + str(find_response.results[0].similarity))
// Create new search context
string searchContextId = CreateImageSearch();
////////////////
public static string CreateImageSearch()
{
string detector = "akaze";
string matchingAlgorithm = "randomBinaryTree";
string folder = null; // File will be saved at the root of the storage
string storage = null; // We are using default Cloud Storage
CreateImageSearchRequest createSearchContextRequest = new CreateImageSearchRequest(detector,matchingAlgorithm, folder, storage);
SearchContextStatus status = imagingApi.CreateImageSearch(createSearchContextRequest);
return status.Id;
}
// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -X POST "https://api.aspose.cloud/connect/token"
-d "grant_type=client_credentials&client_id=[AppSID]&client_secret=[AppKey]"
-H "Content-Type: application/x-www-form-urlencoded"
-H "Accept: application/json"
//Upload soruce SVG image to Aspose default storage
curl -X PUT "https://api.aspose.cloud/v3.0/imaging/storage/file/Temp%2Fcs2cpp.svg"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: multipart/form-data"
-F "imageData=@C:/Temp/cs2cpp.svg"
//Update SVG image settings
curl -X GET "https://api.aspose.cloud/v3.0/imaging/test.svg/svg?colorType=Rgb&textAsShapes=true&scaleX=0&scaleY=0&bkColor=white&fromScratch=false&folder=Temp&format=svg"
-H "accept: application/json"
-H "authorization: Bearer [Acess_Token]"
--output C:/Temp/test_updated.svg
// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -X POST "https://api.aspose.cloud/connect/token"
-d "grant_type=client_credentials&client_id=[AppSID]&client_secret=[AppKey]"
-H "Content-Type: application/x-www-form-urlencoded"
-H "Accept: application/json"
//Rasterize SVG image to PNG with scale setting
curl -X POST "https://api.aspose.cloud/v3.0/imaging/svg?colorType=Rgb&textAsShapes=false&scaleX=2&scaleY=2&bkColor=gray&fromScratch=false&format=png"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: multipart/form-data"
-F "imageData=@C:/Temp/Test.svg"
--output C:/Temp/Test.png
// Upload input images to Cloud Storage
DirectoryInfo dir = new DirectoryInfo(PathToDataFiles);
FileInfo[] images = dir.GetFiles();
foreach (FileInfo image in images)
{
// Upload local image to Cloud Storage
using (FileStream localInputImage = System.IO.File.OpenRead(image.FullName))
{
var uploadFileRequest = new UploadFileRequest(image.Name, localInputImage);
FilesUploadResult result = imagingApi.UploadFile(uploadFileRequest);
}
}
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Instantiate Aspose BarCode Cloud API SDK
PdfApi pdfApi = new PdfApi(MyAppKey, MyAppSid);
string name = "Hello world.pdf";
string TempFolder = "Temp";
var field = new Aspose.Pdf.Cloud.Sdk.Model.Field(
Name: "checkboxfield",
Type: FieldType.Boolean,
Values: new List<string> { "1" },
Rect: new Rectangle(
LLX: 330,
LLY: 670,
URX: 340,
URY: 680
));
var response = pdfApi.PostCreateField(name, 1, field, folder: TempFolder);
Console.WriteLine(response);
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to upload file to AWS S3 Storage
curl -v "https://api.aspose.cloud/v3.0/pdf/storage/file?path=HtmlWithImage.zip&storageName=S3FirstStorage" \
-X PUT \
-T HtmlWithImage.zip \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Authorization: Bearer <jwt token>"
// cURL example to convert HTML file (located on AWS S3 Storage) to PDF and save the resulting file on local storage
curl -v "https://api.aspose.cloud/v3.0/pdf/create/html?srcPath=HtmlWithImage.zip&htmlFileName=HtmlWithImage.html&height=650&width=250&storage=S3FirstStorage" \
-X GET \
-H "Content-Type: application/json" \
-H "Accept: multipart/form-data" \
-H "Authorization: Bearer <jwt token>" \
-o fromHtml.pdf
public void getHtmlInStorageToPdfTest() throws ApiException
{
// Get App key and App SID from https://www.aspose.cloud/
PdfApi apiInstance = new PdfApi("app_key", "app_sid");
String name = "HtmlWithImage.zip";
th.uploadFile(name);
String htmlFileName = "HtmlWithImage.html";
double height = 650;
double width = 250;
String srcPath = th.tempFolder + '/' + name;
File response = th.pdfApi.getHtmlInStorageToPdf(srcPath, htmlFileName, height, width,
null, null, null, null, null, null);
assertNotNull(response);
}
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[API_SID]&client_secret=[API_KEY]” \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to upload file to Aspose Cloud Storage
curl -v "https://api.aspose.cloud/v3.0/pdf/storage/file?path=HtmlWithImage.zip" \
-X PUT \
-T HtmlWithImage.zip \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Authorization: Bearer <jwt token>"
// cURL example to convert HTML file (located on storage) to PDF and save the resulting file on local storage
curl -v "https://api.aspose.cloud/v3.0/pdf/create/html?srcPath=HtmlWithImage.zip&htmlFileName=HtmlWithImage.html&height=650&width=250" \
-X GET \
-H "Content-Type: application/json" \
-H "Accept: multipart/form-data" \
-H "Authorization: Bearer <jwt token>" \
-o fromHtml.pdf
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Instantiate Aspose BarCode Cloud API SDK
PdfApi pdfApi = new PdfApi(MyAppKey, MyAppSid);
string name = "Hello world.pdf";
string TempFolder = "Temp";
var radioButtons = new List<RadioButtonField> {
new RadioButtonField(PageIndex: 1, IsGroup: false, Selected: 1)
{
Color = new Color(255, 255, 0, 0),
Rect = new Rectangle(75, 700, 150, 710),
PartialName = "testField",
Style = BoxStyle.Cross,
Margin = new MarginInfo{ Bottom = 0, Left = 0, Right = 0, Top = 0 },
RadioButtonOptionsField = new List<RadioButtonOptionField>
{
new RadioButtonOptionField(PageIndex: 1, IsGroup: false)
{
OptionName = "1",
Rect = new Rectangle(90, 700, 100, 710),
//Style = BoxStyle.Square
},
new RadioButtonOptionField(PageIndex: 1, IsGroup: false)
{
OptionName = "2",
Rect = new Rectangle(140, 700, 150, 710),
}
}
}
};
var response = pdfApi.PostRadioButtonFields(name, radioButtons, folder: TempFolder);
Console.WriteLine(response);
// Get App Key and App SID from https://dashboard.aspose.cloud/
Aspose.Slides.Cloud.Sdk.Configuration config = new Aspose.Slides.Cloud.Sdk.Configuration();
config.AppKey = MyAppKey;
config.AppSid = MyAppSid;
SlidesApi slidesApi = new SlidesApi(config);
var localfile = "C:/Temp/slide.pptx";
var format = ExportFormat.Pdf;
String password = null;
String fontFolder = null;
//Convert a Presentation from request body to PDF document and return as stream reponse
var request = new PostSlidesConvertRequest(format, System.IO.File.OpenRead(localfile), password, fontFolder);
var response = slidesApi.PostSlidesConvert(request);
//Save stream response as PDF on local drive
var fileStream = System.IO.File.Create("C:/Temp/test.pdf");
response.CopyTo(fileStream);
fileStream.Close();
// Get App Key and App SID from https://dashboard.aspose.cloud/
Aspose.Slides.Cloud.Sdk.Configuration config = new Aspose.Slides.Cloud.Sdk.Configuration();
config.AppKey = MyAppKey;
config.AppSid = MyAppSid;
config.CustomHeaders.Add("Cache-Control", "no-cache");
SlidesApi slidesApi = new SlidesApi(config);
.......
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Get Authenication Token(JWT)
curl "https://api.aspose.cloud/connect/token"
-X POST
-d "grant_type=client_credentials&client_id=[App_SID]&client_secret=[App_Key]"
-H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json"
// Layout Mode of Chart Plot Area
curl -X POST "https://api.aspose.cloud/v3.0/slides/MyPresentationWideScreen.pptx/slides/2/shapes?folder=Temp"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
-H "Content-Type: application/json"
-d "{ "type": "Chart", "shapeType": "Chart", "chartType": "ClusteredColumn",
"series":
[{ "dataPointType": "OneValue",
"dataPoints": [{ "value": 30.903210132803398 }, { "value": 93.970356133752659 }, { "value": 62.40113110393338 }],
"type": "ClusteredColumn", "name": "Seria 0", "isColorVaried": false }, { "dataPointType": "OneValue",
"dataPoints": [{ "value": 5.55788800379163 }, { "value": 76.488545432914307 }, { "value": 27.763909952605104 }],
"type": "ClusteredColumn", "name": "Seria 1", "isColorVaried": false }, { "dataPointType": "OneValue",
"dataPoints": [{ "value": 22.545063226737579 }, { "value": 94.39623946994368 }, { "value": 99.253436550150369 }],
"type": "ClusteredColumn", "name": "Seria 2", "isColorVaried": false }, { "dataPointType": "OneValue",
"dataPoints": [{ "value": 78.624130077019387 }, { "value": 57.199312121234513 }, { "value": 58.8933876524183 }],
"type": "ClusteredColumn", "name": "Seria 3", "isColorVaried": false }],
"categories": [ "Category 0", "Category 1", "Category 2" ],
"title": { "text": "Seasonal fluctuation", "hasTitle": false }, "name": "", "width": 600.0, "height": 500.0,
"alternativeText": "", "hidden": false, "x": 10.0, "y": 15.0,"LayoutTargetType": "Outer", "zOrderPosition": 0
}"
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Get Authenication Token(JWT)
curl "https://api.aspose.cloud/connect/token"
-X POST
-d "grant_type=client_credentials&client_id=[App_SID]&client_secret=[App_Key]"
-H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json"
// Update showDataLabelsOverMaximum property of a Chart
curl -X PUT "https://api.aspose.cloud/v3.0/slides/my3.pptx/slides/1/shapes/1?folder=Temp"
-H "accept: application/json"
-H "Content-Type: application/json"
-H "authorization: Bearer [Access_Token]"
-d "{ "type":"Chart", "shapeType":"Chart", "chartType":"ClusteredColumn", "showDataLabelsOverMaximum":true}"
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Get Authenication Token(JWT)
curl "https://api.aspose.cloud/connect/token"
-X POST
-d "grant_type=client_credentials&client_id=[App_SID]&client_secret=[App_Key]"
-H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json"
// Set Presentation Slide Size
curl -X PUT "https://api.aspose.cloud/v3.0/slides/MyPresentationBanner.pptx/slideSize?folder=Temp&sizeType=Widescreen"
-H "accept: application/json"
-H "authorization: Bearer [Access_Token]"
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to convert whole presentation to PDF
curl -v "https://api.aspose.cloud/v3.0/slides/CloudSample.pptx/Pdf" \
-X POST \
-H "accept: multipart/form-data" \
-H "authorization: Bearer <jwt token>" \
-H "Content-Type: application/json" \
-H "x-aspose-client: Containerize.Swagger" \
-d "{ \"Format\": \"pdf\"}" \
-o Presentation.pdf
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to convert a slide to PDF
curl -v "https://api.aspose.cloud/v3.0/slides/CloudSample.pptx/slides/2/Pdf" \
-X POST \
-H "accept: multipart/form-data" \
-H "authorization: Bearer <jwt token>" \
-H "Content-Type: application/json" \
-H "x-aspose-client: Containerize.Swagger" \
-d "{ \"Format\": \"pdf\"}" \
-o Slide.pdf
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to upload file to Cloud Storage
curl -v "https://api.aspose.cloud/v3.0/slides/storage/file/CloudSample.pptx" \
-X PUT \
-T CloudSample.pptx \
-H "accept: application/json" \
-H "Content-Length: 0" \
-H "authorization: Bearer <jwt token>" \
-H "Content-Type: application/json" \
-H "x-aspose-client: Containerize.Swagger" \
-d {"file":{}}
// First get JSON Web Token
// Please get your App Key and App SID from https://dashboard.aspose.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" argument.
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to create a new word document
curl -v "https://api.aspose.cloud/v4.0/words/create?fileName=TestDocument.docx" \
-X PUT \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Length: 0" \
-H "Authorization: Bearer <jwt token>"
// First get JSON Web Token
// Please get your App Key and App SID from https://dashboard.aspose.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" argument.
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to convert MS Word Document to PDF
curl -v "https://api.aspose.cloud/v4.0/words/convert?format=pdf" \
-X PUT \
-F document=@TableDocument.doc \
-H "Content-Type: multipart/form-data" \
-H "Accept: multipart/form-data" \
-H "Authorization: Bearer <jwt token>" \
-o TableDocument.pdf
import asposewordscloud
import asposewordscloud.models.requests
api_client = asposewordscloud.ApiClient()
# Get App key and App SID from https://cloud.aspose.com
api_client.configuration.host = 'https://api.aspose.cloud'
api_client.configuration.api_key['api_key'] = 'xxxxxxxxxxxxxxxxxxxxxxxxx' # Put your appKey here
api_client.configuration.api_key['app_sid'] = 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx' # Put your appSid here
words_api = asposewordscloud.WordsApi(api_client)
filename = 'TestFile.docx'
remote_name = 'TestPostDocumentSaveAs.docx'
dest_name = 'TestPostDocumentSaveAs.epub'
#upload DOCX file to storage
request_upload = asposewordscloud.models.requests.UploadFileRequest(filename,remote_name)
response_upload = words_api.upload_file(request_upload)
#Convert DOCX to EPUB and save to storage
save_options = asposewordscloud.SaveOptionsData(save_format='epub', file_name=dest_name)
request_conversion = asposewordscloud.models.requests.SaveAsRequest(remote_name, save_options)
response_conversion = words_api.save_as(request_conversion)
print(response_conversion)
For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet
string MyAppKey = "xxxxxxxxxxxxxxxxxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxx-xxxx-xxxxx-xxxxx-xxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
WordsApi wordsApi = new WordsApi(MyAppKey, MyAppSid);
var localName = "Test.docx";
var remoteName = "Test.docx";
var folder = "Temp";
var fullName = Path.Combine(folder, remoteName);
var body = new TiffSaveOptionsData { FileName = "abc.tiff", SaveFormat = "tiff" };
body.ImageColorMode = "Grayscale";
body.TiffBinarizationMethod = "FloydSteinbergDithering";
body.ThresholdForFloydSteinbergDithering = 254;
body.TiffCompression = "Ccitt3";
//upload source Word document to Aspsoe default storage
wordsApi.UploadFile(new Aspose.Words.Cloud.Sdk.Model.Requests.UploadFileRequest(System.IO.File.OpenRead(localName),fullName));
// Convert Word document to TIFF
var request = new SaveAsTiffRequest(remoteName,body,folder);
var actual =wordsApi.SaveAsTiff(request);
Console.WriteLine(actual);
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to convert DOCX document to HTML on local storage
curl -v "https://api.aspose.cloud/v4.0/words/convert?format=html" \
-X PUT \
-T DOCXtoHTML.docx \
-H "Content-Type: application/json" \
-H "accept: application/json" \
-H "authorization: Bearer <jwt token>" \
-o DOCXtoHTML.html
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to convert DOCX document to HTML and save output files as ZIP
curl -v "https://api.aspose.cloud/v4.0/words/DOCXtoHTML.docx/saveAs" \
-X PUT \
-d "{'SaveFormat': 'html', 'FileName': 'DOCXtoHTML.html', 'ZipOutput': true}" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "authorization: Bearer "<jwt token>
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to load web page and save it to docx format
curl -v "https://api.aspose.cloud/v4.0/words/loadWebDocument" \
-X PUT \
-d "{ 'LoadingDocumentUrl': 'https://www.le.ac.uk/oerresources/bdra/html/page_09.htm', 'SaveOptions': { 'SaveFormat': 'docx', 'FileName': 'HTMLDocument.docx', 'SaveRoutingSlip': true } }" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <jwt token>"
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Cells-Cloud
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet
CellsApi cellsApi = new CellsApi(AppKey, AppSid);
string name = "myDocument.xlsx";
string sheetName = "SHEET3";
int? chartIndex = 0;
Title title = new Title();
title.Text = "Test title";
string folder = "TEMPFOLDER";
UpdateDataFile(cellsApi,folder, name);
var response = cellsApi.CellsChartsPostWorksheetChartTitle(name, sheetName, chartIndex, title, folder);
// Get App Key and App SID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Cells-Cloud
private CellsApi instance;
instance = new CellsApi( clientId, clientSecret);
string name = "myDocument.xlsx";
string sheetName = "SHEET4";
int? chartNumber = 0;
string folder = TEMPFOLDER;
string format = "png";
UpdateDataFile(instance,folder, name);
var response = instance.CellsChartsGetWorksheetChart(name, sheetName, chartNumber, format, folder);
Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream");
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Pdf-Cloud
// For complete examples and data files, please go to https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-dotnet
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
const string name = "PdfWithBookmarks.pdf";
string bookmarkPath = "1/1";
var response = pdfApi.DeleteBookmark(name, bookmarkPath, folder: TempFolder);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Cells-Cloud
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet
CellsApi cellsApi = new CellsApi(AppKey, AppSid);
string name = "myDocument1.xlsx";
string sheetName = "SHEET4";
int? chartIndex = 0;
string folder = "TEMPFOLDER";
UpdateDataFile(cellsApi,folder, name);
var response = cellsApi.CellsChartsDeleteWorksheetDeleteChart(name, sheetName, chartIndex, folder);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Cells-Cloud
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet
CellsApi cellsApi = new CellsApi(AppKey, AppSid);
string name = "BOOK1.xlsx";
string sheetName = "SHEET1";
int? index = 0;
string folder = "TEMPFOLDER";
var response = cellsApi.CellsConditionalFormattingsDeleteWorksheetConditionalFormatting(name, sheetName, index, folder);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Words-Cloud
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet
WordsApi wordsApi = new WordsApi(MyAppKey, MyAppSid);
var localName = "TestDeleteDocumentWatermark.docx";
var remoteName = "TestDeleteDocumentWatermark.docx";
var fullName = Path.Combine(this.dataFolder, remoteName);
var destFileName = Path.Combine(BaseTestOutPath, remoteName);
this.UploadFileToStorage(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));
var request = new DeleteWatermarkRequest(remoteName, this.dataFolder, destFileName: destFileName);
var actual = wordsApi.DeleteWatermark(request);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Imaging-Cloud
// For complete examples and data files, please go to https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-dotnet
const string MyAppKey = "";
const string MyAppSid = "";
this.ImagingApi = new ImagingApi(MyAppKey, MyAppSid, "https://api.aspose.cloud/", "v3.0", false);
const string SaveImageFormat = "bmp";
string fileName = "Test.bmp";
// Upload local image to Cloud Storage
using (FileStream localInputImage = File.OpenRead(fileName))
{
var uploadFileRequest = new UploadFileRequest(fileName, localInputImage);
FilesUploadResult result = this.ImagingApi.UploadFile(uploadFileRequest);
}
string folder = null;
string storage = null; // using default Cloud Storage
var request = new GrayscaleImageRequest(fileName, folder, storage);
Console.WriteLine($"Call Grayscale Image");
using (Stream updatedImage = this.ImagingApi.GrayscaleImage(request))
{
// Upload updated image to Cloud Storage
string outPath = "Grayscale_out." + SaveImageFormat;
var uploadFileRequest = new UploadFileRequest(outPath, updatedImage);
FilesUploadResult result = this.ImagingApi.UploadFile(uploadFileRequest);
}
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Imaging-Cloud
// For complete examples and data files, please go to https://github.com/aspose-imaging-cloud/aspose-imaging-cloud-dotnet
Console.WriteLine("Grayscales the image from request body");
const string MyAppKey = "";
const string MyAppSid = "";
this.ImagingApi = new ImagingApi(MyAppKey, MyAppSid, "https://api.aspose.cloud/", "v3.0", false);
const string SaveImageFormat = "png";
string fileName = "WaterMark.png";
using (FileStream inputImageStream = File.OpenRead(ImagingBase.PathToDataFiles + fileName))
{
string storage = null; // We are using default Cloud Storage
string outPath = null; // Path to updated file (if this is empty, response contains streamed image)
var request = new CreateGrayscaledImageRequest(inputImageStream, outPath, storage);
Console.WriteLine($"Call CreateGrayscale Image");
using (Stream updatedImage = this.ImagingApi.CreateGrayscaledImage(request))
{
SaveUpdatedSampleImageToOutput(updatedImage, true, SaveImageFormat);
}
}
// First get JSON Web Token for authentication
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// First get JSON Web Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to populate MailMerge template with Data
curl -v "https://api.aspose.cloud/v4.0/words/SampleMailMergeTemplate.docx/MailMerge?destFileName=TestPostDocumentExecuteMailMerge.docx" \
-X PUT \
-F data=@SampleMailMergeTemplateData.txt \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Authorization: Bearer [jwt token]"
// First get JSON Web Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to populate Mustache template with Data
curl -v "https://api.aspose.cloud/v4.0/words/TestExecuteTemplate.doc/MailMerge?destFileName=TestPostExecuteTemplate.docx" \
-X PUT \
-F data=@TestExecuteTemplateData.txt \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Authorization: Bearer [jwt token]"
// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/oauth2/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// First get JSON Web Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to insert page numbers into a document
curl -v "https://api.aspose.cloud/v4.0/words/test_multi_pages.docx/PageNumbers" \
-X PUT \
-d '{ "Format": "{PAGE} of {NUMPAGES}", "Alignment": "right", "IsTop": true, "SetPageNumberOnFirstPage": true }' \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer [jwt token]"
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Pdf-Cloud
private const string Name = "marketing.pdf";
private const string TempFolder = "TempPDFcloud";
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
var textReplace = new TextReplace("market", "m_a_r_k_e_t", false);
var textReplaceList = new TextReplaceListRequest(new List<TextReplace> { textReplace },
DefaultFont: "Arial", StartIndex: 0, CountReplace: 0);
var response = PdfApi.PostDocumentTextReplace(Name, textReplaceList, folder: TempFolder);
Assert.That(response.Code, Is.EqualTo(200));
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Pdf-Cloud
private const string Name = "marketing.pdf";
private const string TempFolder = "TempPDFcloud";
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
var rect = new Rectangle(100, 100, 300, 300);
var textReplace = new TextReplace("market", "m_a_r_k_e_t", false, Rect: rect);
var textReplaceList = new TextReplaceListRequest(new List<TextReplace> { textReplace },
StartIndex: 0, CountReplace: 0);
var response = PdfApi.PostPageTextReplace(Name, 1, textReplaceList, folder: TempFolder);
Assert.That(response.Code, Is.EqualTo(200));
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Pdf-Cloud
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
const string name = "4pages.pdf";
string userPassword = @"user $^Password!&";
string ownerPassword = @"owner\//? $12^Password!&";
var response = PdfApi.PostEncryptDocumentInStorage(name,
ToBase64(userPassword), ToBase64(ownerPassword),
cryptoAlgorithm: CryptoAlgorithm.AESx128.ToString(), folder: TempFolder);
Assert.That(response.Code, Is.EqualTo(200));
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Cells-Cloud
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet
CellsApi cellsApi = new CellsApi(AppKey, AppSid);
string name = "BOOK1.xlsx";
string sheetName = "SHEET1";
string cellArea = "A1:C10";
FormatCondition formatcondition = new FormatCondition();
formatcondition.Type = "CellValue";
formatcondition.Operator = "Between";
formatcondition.Formula1 = "10";
formatcondition.Formula2 = "20";
var color = new Color();
color.A = 1;
color.R = 132;
color.G = 157;
color.B = 204;
Style style = new Style();
style.BackgroundColor = color;
formatcondition.Style = style;
string folder = "TEMPFOLDER";
var response = cellsApi.CellsConditionalFormattingsPutWorksheetConditionalFormatting(name, sheetName, cellArea, formatcondition, folder);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Words-Cloud
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet
WordsApi wordsApi = new WordsApi(MyAppKey, MyAppSid);
var localName = "test_multi_pages.docx";
var remoteName = "TestSplitDocument.docx";
var fullName = Path.Combine(this.dataFolder, remoteName);
string format = "docx";
var destFileName = Path.Combine(BaseTestOutPath, Path.GetFileNameWithoutExtension(remoteName) + ".docx");
int from = 3;
int to = 5;
this.UploadFileToStorage(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));
var request = new SplitDocumentRequest(remoteName, this.dataFolder, format: format, @from: from, to: to, destFileName: destFileName);
var actual = wordsApi.SplitDocument(request);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Words-Cloud
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet
WordsApi wordsApi = new WordsApi(MyAppKey, MyAppSid);
var localName = "test_multi_pages.docx";
var remoteName = "TestSplitDocument.docx";
var fullName = Path.Combine(this.dataFolder, remoteName);
string format = "pdf";
var destFileName = Path.Combine(BaseTestOutPath, Path.GetFileNameWithoutExtension(remoteName) + ".pdf");
int from = 2;
int to = 6;
this.UploadFileToStorage(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));
var request = new SplitDocumentRequest(remoteName, this.dataFolder, format: format, @from: from, to: to, destFileName: destFileName);
var actual = wordsApi.SplitDocument(request);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Pdf-Cloud
// For complete examples and data files, please go to https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-dotnet
const string FileName = "4pages.pdf";
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
//Split Page number 2,3 and 4 to separate PDF documents
var response = PdfApi.PostSplitDocument(FileName, from: 2, to: 4 , folder: "TempPdfCloud");
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Words-Cloud
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet
WordsApi wordsApi = new WordsApi(MyAppKey, MyAppSid);
var localName = "test_multi_pages.docx";
var remoteName = "TestSplitDocument.docx";
var fullName = Path.Combine(this.dataFolder, remoteName);
string format = "docx";
var destFileName = Path.Combine(BaseTestOutPath, Path.GetFileNameWithoutExtension(remoteName) + ".docx");
//As we have discussed this uploading above
this.UploadFileToStorage(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));
var request = new SplitDocumentRequest(remoteName, this.dataFolder, format: format, destFileName: destFileName);
var actual = wordsApi.SplitDocument(request);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Pdf-Cloud
// For complete examples and data files, please go to https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-dotnet
const string FileName = "4pages.pdf";
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
//Split whole PDF document page by page, into separate PDF documents
var response = PdfApi.PostSplitDocument(FileName, folder: "TempPdfCloud");
FileStream fs = File.Create(@"D:\ChartImage.png");
response.CopyTo(fs);
fs.Close();
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Pdf-Cloud
// For complete examples and data files, please go to https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-dotnet
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
const string name = "PdfWithBookmarks.pdf";
string bookmarkPath = "1/1";
var bookmark = new Bookmark();
bookmark.Action = "GoTo";
bookmark.Bold = true;
bookmark.Italic = false;
bookmark.Title = "Updated Bookmark XYZ";
bookmark.PageDisplay = "XYZ";
bookmark.PageDisplayBottom = 10;
bookmark.PageDisplayLeft = 10;
bookmark.PageDisplayRight = 10;
bookmark.PageDisplayTop = 10;
bookmark.PageDisplayZoom = 2;
bookmark.PageNumber = 2;
bookmark.Color = new Color(255, 255, 0, 0);
var response = PdfApi.PutBookmark(name, bookmarkPath, bookmark, folder: TempFolder);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Cells-Cloud
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet
CellsApi cellsApi = new CellsApi(AppKey, AppSid);
string name = "BOOK1.xlsx";
string sheetName = "SHEET1";
int? index = 0;
string cellArea = "E6:G8";
string folder = "TEMPFOLDER";
var response = cellsApi.CellsConditionalFormattingsPutWorksheetFormatConditionArea(name, sheetName, index, cellArea, folder);
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Words-Cloud
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet
/// <summary>
/// Uploads file to storage.
/// </summary>
/// <param name="path">Path in storage.</param>
/// <param name="versionId">Api version.</param>
/// <param name="storage">Storage.</param>
/// <param name="fileContent">File content.</param>
protected void UploadFileToStorage(string path, string versionId, string storage, byte[] fileContent)
{
using (var ms = new MemoryStream(fileContent))
{
var request = new UploadFileRequest(ms, path);
this.WordsApi.UploadFile(request);
}
}
// Get AppKey and AppSID from https://dashboard.aspose.cloud/
// Install Nuget Package Aspose.Pdf-Cloud
// For complete examples and data files, please go to https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-dotnet
string FileName = "4pages.pdf";
PdfApi pdfApi = new PdfApi(AppKey, AppSid);
using (var file = System.IO.File.OpenRead(Path.Combine(LocalFolder, FileName)))
{
var response = PdfApi.UploadFile(Path.Combine(StorageFolder, FileName), file);
}
// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl "https://api.aspose.cloud/oauth2/token"
-X POST
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]"
-H "Content-Type: application/x-www-form-urlencoded"
-H "Accept: application/json"
// cURL example to upload file to Aspose Cloud Storage
curl "https://api.aspose.cloud/v1.1/storage/file?path=multilevellist.pdf"
-X PUT
-T C:/Temp/multilevellist.pdf
-H "Content-Type: multipart/form-data"
-H "Accept: application/json"
-H "Authorization: Bearer [ACCESS_TOKEN]"
// cURL example to convert PDF Document to Word
curl "https://api.aspose.cloud/v1.1/words/multilevellist.pdf/saveAs"
-X POST
-H "Content-Type: application/json"
-d '{"SaveFormat": "docx","FileName": "multilevellistapi.docx",}'
-H "Accept: application/json"
-H "Authorization: Bearer [ACCESS_TOKEN]"
///////////////////V4///////////////////////
// First get JSON Web Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
// cURL example to upload file to Aspose Cloud Storage
curl "https://api.aspose.cloud/v4.0/words/storage/file/sample.pptx"
-X PUT
-H "accept: application/json"
-H "Content-Type: multipart/form-data"
-T C:/sample.pptx
-H "authorization: Bearer [ACCESS_TOKEN]"
// cURL example to convert PDF Document to Word
curl "https://api.aspose.cloud/v4.0/words/multilevellist.pdf/saveAs"
-X PUT
-H "Content-Type: application/json"
-d "{"SaveFormat": "docx","FileName": "multilevellistapi.docx",}"
-H "Accept: application/json"
-H "authorization: Bearer [ACCESS_TOKEN]"
curl -X PUT "https://https://api.aspose.cloud/v4.0/words/Test.PDF/saveAs?password=ownerpassword"
-H "accept: application/xml"
-H "Content-Type: application/json"
-d "{ \"SaveFormat\": \"docx\", \"FileName\": \"Text.docx\",}"
-H "authorization: Bearer [ACCESS_TOKEN]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment