本文整理汇总了Java中com.aspose.storage.api.StorageApi类的典型用法代码示例。如果您正苦于以下问题:Java StorageApi类的具体用法?Java StorageApi怎么用?Java StorageApi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StorageApi类属于com.aspose.storage.api包,在下文中一共展示了StorageApi类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: get-particular-property
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "sample1.xlsx";
Path inputFile = Utils.getPath(GetParticularProperty.class, input);
String propertyName = "Author";
storageApi.PutCreate(input, Utils.STORAGE, null, inputFile.toFile());
com.aspose.cells.model.CellsDocumentPropertyResponse apiResponse = cellsApi.GetDocumentProperty(input,
propertyName, Utils.STORAGE, null);
System.out.println(" Author : " + apiResponse.getDocumentProperty().getValue());
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: get-particular-property
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:27,代码来源:GetParticularProperty.java
示例2: execute
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: get-column-from-worksheet
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
File inputFile = Utils.stream2file("sample1","xlsx", context.getResources().openRawResource(R.raw.sample1));
String sheet = "Sheet1";
int index = 0;
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile);
com.aspose.cells.model.ColumnResponse r = cellsApi
.GetWorksheetColumn("Sample1.xlsx", sheet, index, Utils.STORAGE, null);
System.out.println("Column: " + r.getColumn().getLink().getHref());
}
catch (Exception e) {
e.printStackTrace();
}
//ExEnd: get-column-from-worksheet
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:27,代码来源:GetColumn.java
示例3: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: get-chart-legend
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
Path inputFile = Utils.getPath(GetChartLegend.class, input);
String sheet = "Sheet1";
int chartIndex = 0;
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
com.aspose.cells.model.LegendResponse apiResponse = cellsApi.GetWorksheetChartLegend(input, sheet,
chartIndex, Utils.STORAGE, Utils.FOLDER);
System.out.println("Chart Legend Position :: " + apiResponse.getLegend().getPosition());
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: get-chart-legend
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:27,代码来源:GetChartLegend.java
示例4: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String[] args) {
String name = "SampleAttachment";
String fileName = name + ".pdf";
int attachmentIndex = 1;
String storage = "";
String folder = "";
Path inputFile = Utils.getPath(GetAllBookmarksExample.class, fileName);
try
{
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
PdfApi pdfApi = new PdfApi(Configuration.apiKey, Configuration.appSID, true);
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", inputFile.toFile());
// Invoke Aspose.PDF Cloud SDK API to get specific attachment from a pdf
AttachmentResponse apiResponse = pdfApi.GetDocumentAttachmentByIndex(fileName, attachmentIndex, storage, folder);
if (apiResponse != null && apiResponse.getStatus().equals("OK"))
{
Attachment attach = apiResponse.getAttachment();
System.out.println("Name :: " + attach.getName());
System.out.println("MimeType :: " + attach.getMimeType());
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-Cloud,代码行数:32,代码来源:GetSpecificAttachmentExample.java
示例5: execute
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void execute(Context context) throws Exception {
//ExStart: AddCalendarToProjectExample
// Set input file name
String name = "sampleproject.mpp";
String fileName = null;
String storage = null;
String folder = null;
Calendar body = new Calendar();
body.setUid ( 0);
body.setName ( "TestCalender");
body.setIsBaseCalendar (true);
body.setIsBaselineCalendar ( false);
File input = Utils.stream2file("sample-project","mpp", context.getResources().openRawResource(R.raw.sampleproject));
try
{
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
TasksApi tasksApi = new TasksApi(Configuration.apiKey, Configuration.appSID, true);
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", input);
// Invoke Aspose.Tasks Cloud SDK API to add calendar to project
CalendarItemResponse apiResponse = tasksApi.PostProjectCalendar(name, fileName, storage, folder, body);
if (apiResponse != null)
{
System.out.println("Add Calendar to Project, Done!");
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
//ExEnd: AddCalendarToProjectExample
}
开发者ID:aspose-tasks,项目名称:Aspose.Tasks-for-Cloud,代码行数:37,代码来源:AddCalendarToProjectExample.java
示例6: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String[] args) {
// ExStart: 1
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
WordsApi wordsApi = new WordsApi(Configuration.apiKey, Configuration.appSID, true);
// set destination file name
String fileName = "MathsObject.docx";
Path p1=Utils.getPath(SaveDocumentAsExample.class, fileName);
SaveOptions saveOptions = new SaveOptions();
saveOptions.setSaveFormat("bmp");
saveOptions.setFileName("Data.bmp");
saveOptions.setHorizontalResolution(700);
saveOptions.setVerticleResolution(400);
// upload source file to Aspose cloud storage
storageApi.PutCreate(fileName, "", "", p1.toFile());
// invoke Aspose.Words Cloud SDK API
SaveResponse apiResponse = wordsApi.PostDocumentSaveAs(fileName, null, null, saveOptions);
if (apiResponse != null && apiResponse.getStatus().equals("OK")) {
System.out.println("OK");
}
} catch (Exception e) {
e.printStackTrace();
}
// ExEnd: 1
}
开发者ID:aspose-words,项目名称:Aspose.Words-for-Cloud,代码行数:37,代码来源:SaveDocumentAsExample.java
示例7: execute
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void execute(Context context) throws Exception {
//ExStart: 1
String fileName = "sample1-input.pdf";
int pageNumber = 1;
String storage = "";
String folder = "";
TextReplace body = new TextReplace();
body.setOldValue ( "Sample PDF");
body.setNewValue ( "Sample Aspose PDF");
File input = Utils.stream2file("input","pdf", context.getResources().openRawResource(R.raw.Sample_Annotation));
try
{
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
PdfApi pdfApi = new PdfApi(Configuration.apiKey, Configuration.appSID, true);
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", input);
// Invoke Aspose.PDF Cloud SDK API to replace text in a pdf page
PageTextReplaceResponse apiResponse = pdfApi.PostPageReplaceText(fileName, pageNumber, storage, folder, body);
if (apiResponse != null && apiResponse.getStatus().equals("OK"))
{
System.out.println("Replace Text in a PDF Page, Done!");
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
//ExEnd: 1
}
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-Cloud,代码行数:33,代码来源:RepalceTextInPDFDocument.java
示例8: execute
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void execute(Context context) throws Exception {
// ExStart: 1
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
WordsApi wordsApi = new WordsApi(Configuration.apiKey, Configuration.appSID, true);
// set input file name
String fileName = "MathsObject.docx";
String storage = null;
String folder = null;
File input = Utils.stream2file("MathsObject","docx", context.getResources().openRawResource(R.raw.mathsobject));
// upload input file to aspose cloud storage
storageApi.PutCreate(fileName, "", "",input);
//Invoke the API
OfficeMathObjectsResponse apiResponse = wordsApi.GetOfficeMathObjects("MathsObject.docx", storage, folder);
if (apiResponse != null && apiResponse.getStatus().equals("OK")) {
System.out.println("Reading Math Objects Done");
}
} catch (Exception e) {
e.printStackTrace();
}
// ExEnd: 1
}
开发者ID:aspose-words,项目名称:Aspose.Words-for-Cloud,代码行数:34,代码来源:ReadAllMathObjectsExample.java
示例9: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String[] args) {
//ExStart: 1
String fileName = "sample-input.pptx";
String folder = "";
String storage = "";
Path inputFile = Utils.getPath(ExtractParticularShape.class, fileName);
try {
SlidesApi slidesApi = new SlidesApi(Configuration.apiKey, Configuration.appSID);
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", inputFile.toFile());
// Invoke Aspose.Slides Cloud SDK API to get number of images in a
// presentation
ImagesResponse apiResponse = slidesApi.GetSlidesSlideImages(fileName,1, folder, storage);
if (apiResponse != null) {
int count = apiResponse.getImages().getList().size();
System.out.println("Total Images Found :: " + count);
System.out.println("Get Number of Images in a Presentation, Done!");
}
} catch (Exception ex) {
ex.printStackTrace();
}
//ExEnd: 1
}
开发者ID:aspose-slides,项目名称:Aspose.Slides-for-Cloud,代码行数:33,代码来源:GetNumberOfImagesSlide.java
示例10: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: get-max-data-row
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "sample1.xlsx";
Path inputFile = Utils.getPath(GetMaxDataRowWorksheet.class, input);
String sheetName = "Sheet1";
String cellOrMethodName = "maxdatarow";
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
Integer apiResponse = cellsApi.GetWorksheetCellProperty(input, sheetName, cellOrMethodName, Utils.STORAGE,
Utils.FOLDER);
System.out.println(" MaxDataRow :: " + apiResponse);
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: get-max-data-row
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:28,代码来源:GetMaxDataRowWorksheet.java
示例11: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String[] args) {
//ExStart: 1
// Set input file name
String name = "sample-project.mpp";
String storage = "";
String folder = "";
Integer taskUid = 1;
Path inputFile = Utils.getPath(RetrieveTaskInformationExample.class, name);
try
{
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
TasksApi tasksApi = new TasksApi(Configuration.apiKey, Configuration.appSID, true);
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", inputFile.toFile());
// Invoke Aspose.Tasks Cloud SDK API to add task link to project
SaaSposeResponse apiResponse = tasksApi.GetTaskRecurringInfo(name,taskUid, storage, folder);
if (apiResponse != null && apiResponse.getStatus().equals("OK"))
{
System.out.println("Get Recurring Information For Task Example, Done");
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
//ExEnd: 1
}
开发者ID:aspose-tasks,项目名称:Aspose.Tasks-for-Cloud,代码行数:31,代码来源:GetRecurringInformationForTaskExample.java
示例12: execute
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: unmerge-cells-in-worksheet
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "sample1.xlsx";
Path inputFile = Utils.getPath(UnmergeCellsWorksheet.class, input);
String output = "sample2.xlsx";
Path outputFile = Utils.getPath(UnmergeCellsWorksheet.class, output);
String sheetName = "Sheet1";
Integer startRow = 1;
Integer startColumn = 0;
Integer totalRows = 1;
Integer totalColumns = 5;
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
cellsApi.PostWorksheetUnmerge(input, sheetName, startRow, startColumn, totalRows, totalColumns,
Utils.STORAGE, Utils.FOLDER);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
e.printStackTrace();
}
//ExEnd: unmerge-cells-in-worksheet
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:35,代码来源:UnmergeCellsWorksheet.java
示例13: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: protect-excel-workbook
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
Path inputFile = Utils.getPath(ProtectWorkbook.class, input);
Path outputFile = Utils.getPath(ProtectWorkbook.class, output);
com.aspose.cells.model.WorkbookProtectionRequest properties = new com.aspose.cells.model.WorkbookProtectionRequest();
properties.setPassword("12345678");
properties.setProtectionType("All");
storageApi.PutCreate(input, Utils.STORAGE, null, inputFile.toFile());
cellsApi.PostProtectDocument(input, Utils.STORAGE, null, properties);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
} catch (Exception e) {
e.printStackTrace();
}
// ExEnd: protect-excel-workbook
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:29,代码来源:ProtectWorkbook.java
示例14: execute
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void execute(Context context) throws Exception{
//ExStart: 1
String fileName = "sampleinput.pptx";
int slideIndex = 1;
String folder = "";
String storage = "";
File inputFile = Utils.stream2file("sample-input","pptx", context.getResources().openRawResource(R.raw.sampleinput));
try
{
SlidesApi slidesApi = new SlidesApi(Configuration.apiKey, Configuration.appSID);
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "",inputFile);
// Invoke Aspose.Slides Cloud SDK API to get placeholder count from a slide
PlaceholdersResponse apiResponse = slidesApi.GetSlidesPlaceholders(fileName, slideIndex, folder, storage);
if (apiResponse != null && apiResponse.getStatus().equals("OK"))
{
int placeholderCount = apiResponse.getPlaceholders().getPlaceholderLinks().size();
System.out.println("PlaceholderCount :: " + placeholderCount);
System.out.println("Get Placeholder Count from a PowerPoint Slide, Done!");
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
//ExEnd: 1
}
开发者ID:aspose-slides,项目名称:Aspose.Slides-for-Cloud,代码行数:33,代码来源:GetPlaceHolderCountFromSlide.java
示例15: execute
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: merge-cells-worksheet
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "sample1.xlsx";
File inputFile = Utils.stream2file("sample1","xlsx", context.getResources().openRawResource(R.raw.sample1)); String output = "sample2.xlsx";
File outputFile = Utils.stream2file("sample2","xlsx", context.getResources().openRawResource(R.raw.sample2));
String sheetName = "Sheet1";
Integer startRow = 1;
Integer startColumn = 0;
Integer totalRows = 1;
Integer totalColumns = 5;
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile);
cellsApi.PostWorksheetMerge(input, sheetName, startRow, startColumn, totalRows, totalColumns, Utils.STORAGE,
Utils.FOLDER);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
}
catch (Exception e) {
e.printStackTrace();
}
//ExEnd: merge-cells-worksheet
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:35,代码来源:MergeCellsWorksheet.java
示例16: execute
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: clear-cell-content-style
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "sample1.xlsx";
File inputFile = Utils.stream2file("sample1","xlsx", context.getResources().openRawResource(R.raw.sample1));
String output = "sample2.xlsx";
File outputFile = Utils.stream2file("sample2","xlsx", context.getResources().openRawResource(R.raw.sample2));
String sheetName = "Sheet1";
String range = "A1:A10";
Integer startRow = 1;
Integer startColumn = 1;
Integer endRow = 2;
Integer endColumn = 2;
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile);
cellsApi.PostClearContents(input, sheetName, range, startRow, startColumn, endRow, endColumn,
Utils.STORAGE, Utils.FOLDER);
com.aspose.storage.model.ResponseMessage sr =storageApi.GetDownload(input, null, Utils.STORAGE);
Utils.copyInputStreamToFile(sr.getInputStream(),outputFile);
}
catch (Exception e) {
e.printStackTrace();
}
//ExEnd: clear-cell-content-style
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:38,代码来源:ClearCellContentStyleWorksheet.java
示例17: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: rename-excel-worksheeet
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
Path inputFile = Utils.getPath(RenameWorksheet.class, input);
Path outputFile = Utils.getPath(RenameWorksheet.class, output);
String oldName = "Sheet1";
String newName = "Sheet2";
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
cellsApi.PostRenameWorksheet(input, oldName, newName, null, Utils.STORAGE);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: rename-excel-worksheeet
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:31,代码来源:RenameWorksheet.java
示例18: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String[] args) {
//ExStart: 1
String fileName = "sample-input.pptx";
String folder = "";
String storage = "";
Path inputFile = Utils.getPath(GetSlideCountFromPresentation.class, fileName);
try
{
SlidesApi slidesApi = new SlidesApi(Configuration.apiKey, Configuration.appSID);
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", inputFile.toFile());
// Invoke Aspose.Slides Cloud SDK API to get slide count
SlideListResponse apiResponse = slidesApi.GetSlidesSlidesList(fileName, folder, storage);
if (apiResponse != null && apiResponse.getStatus().equals("OK"))
{
int count = apiResponse.getSlides().getSlideList().size();
System.out.println("Total Slides :: " + count);
System.out.println("Get PowerPoint Slide Count, Done!");
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
//ExEnd: 1
}
开发者ID:aspose-slides,项目名称:Aspose.Slides-for-Cloud,代码行数:29,代码来源:GetSlideCountFromPresentation.java
示例19: execute
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void execute(Context context) throws Exception {
//ExStart: 1
String fileName = "segments.pdf";
int pageNumber = 1;
int fragmentNumber = 1;
int segmentNumber = 1;
String storage = "";
String folder = "";
File input = Utils.stream2file("input","pdf", context.getResources().openRawResource(R.raw.Sample_Annotation));
try
{
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
PdfApi pdfApi = new PdfApi(Configuration.apiKey, Configuration.appSID, true);
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", input);
// Invoke Aspose.PDF Cloud SDK API to get text format of particular segment
TextFormatResponse apiResponse = pdfApi.GetSegmentTextFormat(fileName, pageNumber, fragmentNumber, segmentNumber, storage, folder);
if (apiResponse != null && apiResponse.getStatus().equals("OK"))
{
TextFormat segTextFormat = apiResponse.getTextFormat();
System.out.println("Segment Font Name - " + segTextFormat.getFontName());
System.out.println("Segment Font Size - " + segTextFormat.getFontSize().floatValue());
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
//ExEnd: 1
}
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-Cloud,代码行数:35,代码来源:GetTextFormatOfParticularSegmentExample.java
示例20: main
import com.aspose.storage.api.StorageApi; //导入依赖的package包/类
public static void main(String[] args) {
// ExStart: 1
String fileName = "Book1.xlsx";
String sheetName = "Sheet1";
String storage = null;
String folder = null;
try {
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
// Upload source file to aspose cloud storage
Path inputFile = Utils.getPath(DeleteFilterForFilterColumnExample.class, "Sample.xlsx");
storageApi.PutCreate(fileName, "", "", inputFile.toFile());
// Invoke Aspose.Cells Cloud SDK API to get worksheet autofilter
SaaSposeResponse apiResponse = cellsApi.PutWorksheetFilterTop10(fileName, sheetName,
"range=A1:B1&fieldIndex=0&isTop=true&itemCount=1&isPercent=true&matchBlanks=true", storage, folder);
if (apiResponse != null && apiResponse.getStatus().equals("Ok")) {
System.out.println("Get worksheet autofilter, Done!");
}
} catch (Exception ex) {
ex.printStackTrace();
}
// ExEnd: 1
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:29,代码来源:FilterTop10CriteriaExample.java
注:本文中的com.aspose.storage.api.StorageApi类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论