public static void Run() { // ExStart:1 WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "SampleWordDocument.docx"; String propertyName = "AsposeAuthor"; String storage = null; String folder = null; try { // Upload the file storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Words Cloud SDK API to remove particular document property SaaSposeResponse apiResponse = wordsApi.DeleteDocumentProperty(fileName, propertyName, fileName, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("The document property has been removed successfully"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "sample-merged.pdf"; int pageNumber = 1; int newIndex = 2; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.PDF Cloud SDK API to move pages to new location SaaSposeResponse apiResponse = pdfApi.PostMovePage(fileName, pageNumber, newIndex, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Move PDF Pages to New Locations in a PDF File, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Group_Rows_Sample_Test_Book.xls"; String sheetName = "Sheet1"; int firstIndex = 1; int lastIndex = 1; Boolean hide = false; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to ungroup rows in worksheet SaaSposeResponse apiResponse = cellsApi.PostUngroupWorksheetRows(fileName, sheetName, firstIndex, lastIndex, hide, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("UnGroup Rows in Excel Worksheet, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Sample_Test_Book.xls"; String sheetName = "Sheet2"; String cellarea = "A10:B20"; String value = "1234"; String type = "int"; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to set range value in worksheet SaaSposeResponse apiResponse = cellsApi.PostSetCellRangeValue(fileName, sheetName, cellarea, value, type, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Set Range Value in Excel Worksheet, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Sample_Test_Book.xls"; String storage = ""; String folder = ""; WorkbookEncryptionRequest body = new WorkbookEncryptionRequest(); body.EncryptionType = "XOR"; body.Password = "******"; body.KeyLength = 128; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to encrypt excel workbook SaaSposeResponse apiResponse = cellsApi.PostEncryptDocument(fileName, storage, folder, body); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("File is Encrypted"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Sample-Annotation.pdf"; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.PDF Cloud SDK API to remove all document properties SaaSposeResponse apiResponse = pdfApi.DeleteProperties(fileName, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Remove All Document Properties from a PDF, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "test_multi_pages.docx"; String destFileName = "updated-" + fileName; String headersFootersTypes = null; String storage = null; String folder = null; try { // Upload the file storageApi.PutCreate(fileName, "", storage, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Words Cloud SDK API to remove header and footer SaaSposeResponse apiResponse = wordsApi.DeleteHeadersFooters(fileName, headersFootersTypes, destFileName, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("All headers and footers have been deleted successfully"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "password_protected_Sample_Test_Book.xls"; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to clear modify password SaaSposeResponse apiResponse = cellsApi.DeleteDocumentUnProtectFromChanges(fileName, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Password is removed"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); string fileName = "test.pdf"; int? page = 1; string storage = null; string folder = null; Com.Aspose.PDF.Model.Field body = new Com.Aspose.PDF.Model.Field(); Com.Aspose.PDF.Model.Link link = new Com.Aspose.PDF.Model.Link(); link.Href = "http://api.aspose.cloud/v1.1/pdf/ABFillablewfields.pdf/fields/NewField"; link.Rel = "self"; Com.Aspose.PDF.Model.Rectangle rect = new Com.Aspose.PDF.Model.Rectangle(); rect.X = 100; rect.Y = 100; body.Rect = rect; body.Name = "Signature1"; body.Values = new System.Collections.Generic.List <string> { "" }; body.Type = 0; body.Links = new System.Collections.Generic.List <Com.Aspose.PDF.Model.Link> { link }; //body.SelectedItems = new System.Collections.Generic.List<int?> { 1 }; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.PDF Cloud SDK API to create form field SaaSposeResponse apiResponse = pdfApi.PostCreateField(fileName, page, storage, folder, body); if (apiResponse != null && apiResponse.Status.Equals("OK")) { //pdfApi.PutUpdateField(fileName, storage, folder, body.Name, body); // Download created pdf file Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName, null, null); // Save response stream to a file System.IO.File.WriteAllBytes(Common.GetDataDir() + "SignatureField.pdf", storageRes.ResponseStream); Console.WriteLine("Create a Form Field in a PDF Document, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Sample_Test_Book.xls"; String sheetName = "Sheet1"; int row = 1; int column = 1; int freezedRows = 1; int freezedColumns = 1; String folder = ""; String storage = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to freeze panes in excel worksheet SaaSposeResponse apiResponse = cellsApi.PutWorksheetFreezePanes(fileName, sheetName, row, column, freezedRows, freezedColumns, folder, storage); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Freeze Panes in Excel Worksheet, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 WordsApi wordsApi = new WordsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); string fileName = "GetField.docx"; int sectionIndex = 0; int paragraphIndex = 0; int fieldIndex = 0; string storage = null; string folder = null; try { // Upload the file storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Words Cloud SDK API to delete form field SaaSposeResponse apiResponse = wordsApi.DeleteField(fileName, sectionIndex, paragraphIndex, fieldIndex, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Delete a specific field from a Section or Paragraph in a Word Document, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Sample_Test_Book.xls"; String sheetName = "Sheet6"; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to delete all pictures SaaSposeResponse apiResponse = cellsApi.DeleteWorkSheetPictures(fileName, sheetName, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Delete all Pictures from Excel Worksheet, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Sample_Test_Book.xls"; Boolean isAutoFit = true; int? startRow = 1; int? endRow = 10; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to autofit rows in workbooks SaaSposeResponse apiResponse = cellsApi.PostAutofitWorkbookRows(fileName, startRow, endRow, isAutoFit, storage, folder, null); if (apiResponse != null) { Console.WriteLine("Auto Fit Rows in Excel Workbooks, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Hide_Row_Sample_Test_Book.xls"; String sheetName = "Sheet1"; int startrow = 1; int totalRows = 1; Double height = 1.0; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to unhide rows in excel workbook SaaSposeResponse apiResponse = cellsApi.PostUnhideWorksheetRows(fileName, sheetName, startrow, totalRows, height, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Unhide Rows in Excel Worksheet, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "sample-input-2.pdf"; String signatureFileName = "pkc7-sample.pfx"; String storage = ""; String folder = ""; Signature body = new Signature(); body.Authority = "Farooq Sheikh"; body.Location = "Gojra"; body.Contact = "*****@*****.**"; body.Date = "06/20/2017 2:00:00.000 AM"; body.FormFieldName = "Signature1"; body.Password = "******"; Rectangle rect = new Rectangle(); rect.X = 100; rect.Y = 100; rect.Height = 100; rect.Width = 200; body.Rectangle = rect; body.SignaturePath = signatureFileName; body.SignatureType = "PKCS7"; body.Visible = true; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); storageApi.PutCreate(signatureFileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + signatureFileName)); // Invoke Aspose.PDF Cloud SDK API to sign Pdf document SaaSposeResponse apiResponse = pdfApi.PostSignDocument(fileName, storage, folder, body); if (apiResponse != null && apiResponse.Status.Equals("OK")) { // Download created pdf file Com.Aspose.Storage.Model.ResponseMessage storageRes = storageApi.GetDownload(fileName, null, null); // Save response stream to a file System.IO.File.WriteAllBytes(Common.GetDataDir() + "SignPdfDoc_out.pdf", storageRes.ResponseStream); Console.WriteLine("Sign PDF Documents, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "sample-input.pdf"; String imageFile = "aspose-cloud.png"; int pageNumber = 1; String storage = ""; String folder = ""; Stamp body = new Stamp(); body.FileName = imageFile; body.Background = true; body.Type = "Image"; body.PageIndex = 0; body.LeftMargin = 0.0; body.Opacity = 0.5; body.RightMargin = 0.0; body.TopMargin = 0.0; body.YIndent = 100.0; body.XIndent = 100.0; body.Zoom = 1.0; body.TextState = null; body.Width = 300.0; body.Height = 300.0; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); storageApi.PutCreate(imageFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFile)); // Invoke Aspose.PDF Cloud SDK API to add image stamp to a pdf page SaaSposeResponse apiResponse = pdfApi.PutPageAddStamp(fileName, pageNumber, storage, folder, body); if (apiResponse != null) { Console.WriteLine("Add Image Stamp (Watermark) to a PDF Page, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Embeded_OleObject_Sample_Book1.xlsx"; string sheetName = "Sheet1"; int? oleObjectIndex = 0; string storage = null; string folder = null; string sourceFileName = "Sample_Book2.xls"; string imageFileName = "aspose-logo.png"; Com.Aspose.Cells.Model.OleObject body = new Com.Aspose.Cells.Model.OleObject(); body.SourceFullName = sourceFileName; body.ImageSourceFullName = imageFileName; body.UpperLeftRow = 15; body.UpperLeftColumn = 5; body.Top = 10; body.Bottom = 10; body.Left = 10; body.Height = 400; body.Width = 400; body.IsAutoSize = true; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); storageApi.PutCreate(sourceFileName, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + sourceFileName)); storageApi.PutCreate(imageFileName, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFileName)); // Invoke Aspose.Cells Cloud SDK API to update specific OleObject SaaSposeResponse apiResponse = cellsApi.PostUpdateWorksheetOleObject(fileName, sheetName, oleObjectIndex, storage, folder, body); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Update a specific OleObject from Excel Worksheet, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); string fileName = "sample-input.pdf"; int? pageNumber = 1; string storage = null; string folder = null; Com.Aspose.PDF.Model.Signature body = new Com.Aspose.PDF.Model.Signature(); body.Authority = "Authority"; body.Contact = "*****@*****.**"; body.Date = "18-4-2016"; body.FormFieldName = "Signature1"; body.Location = "Gojra"; body.Password = "******"; Com.Aspose.PDF.Model.Rectangle rect = new Com.Aspose.PDF.Model.Rectangle(); rect.X = 100; rect.Y = 100; rect.Height = 100; rect.Width = 200; body.Rectangle = rect; body.SignaturePath = "pkc7-sample.pfx"; body.SignatureType = "PKCS7"; body.Visible = true; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); storageApi.PutCreate(body.SignaturePath, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + body.SignaturePath)); // Invoke Aspose.PDF Cloud SDK API to sign pdf page SaaSposeResponse apiResponse = pdfApi.PostSignPage(fileName, pageNumber, storage, folder, body); if (apiResponse != null && apiResponse.Status.Equals("Ok")) { Console.WriteLine("Sign PDF Document Page, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public void TestDeleteFormField() { var localName = "FormFilled.docx"; var remoteName = "TestDeleteFormField.docx"; var fullName = Path.Combine(this.dataFolder, remoteName); var formfieldIndex = 0; var destFileName = Path.Combine(BaseTestOutPath, remoteName); this.StorageApi.PutCreate(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(this.fieldFolder) + localName)); var request = new DeleteFormFieldRequest(remoteName, formfieldIndex, this.dataFolder, nodePath: "sections/0", destFileName: destFileName); SaaSposeResponse actual = this.WordsApi.DeleteFormField(request); Assert.AreEqual(200, actual.Code); }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Sample_Test_Book.xls"; String sheetName = "Sheet1"; String cellArea = "A5:A10"; String storage = ""; String folder = ""; SortKey sort = new SortKey(); sort.Key = 0; sort.SortOrder = "descending"; DataSorter body = new DataSorter(); body.CaseSensitive = "false"; body.HasHeaders = "false"; body.SortLeftToRight = "false"; body.KeyList = new List <SortKey> { sort }; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to sort worksheet data SaaSposeResponse apiResponse = cellsApi.PostWorksheetRangeSort(fileName, sheetName, cellArea, storage, folder, body); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Worksheet data is sorted!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Sample_Pivot_Table_Example.xls"; String sheetName = "Sheet2"; int pivotTableIndex = 0; String pivotFieldType = "Row"; Com.Aspose.Cells.Model.PivotTableFieldRequest body = new Com.Aspose.Cells.Model.PivotTableFieldRequest(); body.Data = new System.Collections.Generic.List <int?> { 1, 2 }; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to add pivot field in pivot table SaaSposeResponse apiResponse = cellsApi.PutPivotTableField(fileName, sheetName, pivotTableIndex, pivotFieldType, storage, folder, body); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Add Pivot Field into Pivot Table, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "Sample_Test_Book.xls"; String sheetName = "Sheet1"; String range = "A1:A12"; int? startRow = null; int? startColumn = null; int? endRow = null; int? endColumn = null; String storage = ""; String folder = ""; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.Cells Cloud SDK API to clear cell formatting SaaSposeResponse apiResponse = cellsApi.PostClearFormats(fileName, sheetName, range, startRow, startColumn, endRow, endColumn, storage, folder); if (apiResponse != null && apiResponse.Status.Equals("OK")) { Console.WriteLine("Clear Cells' Formatting in Excel Worksheet, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }
public static void Run() { // ExStart:1 PdfApi pdfApi = new PdfApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH); String fileName = "sample-input.pdf"; int pageNumber = 1; String storage = ""; String folder = ""; Stamp body = new Stamp(); body.Value = "Aspose.com"; body.Background = true; body.Type = "Text"; try { // Upload source file to aspose cloud storage storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName)); // Invoke Aspose.PDF Cloud SDK API to add text stamp to a pdf page SaaSposeResponse apiResponse = pdfApi.PutPageAddStamp(fileName, pageNumber, storage, folder, body); if (apiResponse != null) { Console.WriteLine("Add Text Stamp (Watermark) to a PDF Page, Done!"); Console.ReadKey(); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace); } // ExEnd:1 }