Excel till CS Denna REST API indikerar för convert
en kalkylbladsfil till en csv-formatfil.
Frågeparameter
Parameternamn
Typ
Beskrivning
lösenord
sträng
Lösenordet som behövs för att öppna en Excel-fil.
lagringsnamn
sträng
Lagringsnamnet där filen finns.
kontrolleraExcelBegränsning
bool
Om begränsning av Excel-filen ska kontrolleras när användaren ändrar celler relaterade objekt.
Begäran om brödtextparameter
Parameternamn
Typ
Beskrivning
datafil
datafil
Datafilen sparas i den första delen av det flerdelade innehållet.
Svar
Filinfo
REST API Specifikation
DeOpenAPI-specifikation definierar ett offentligt tillgängligt programmeringsgränssnitt och låter dig utföra REST-interaktioner direkt från en webbläsare.
Du kan användacURL kommandoradsverktyg för att enkelt komma åt webbtjänsterna Aspose.Cells. Följande exempel visar hur man anropar Cloud API med cURL.
Cloud SDK-familjen
Att använda ett SDK är det bästa sättet att snabba upp utvecklingen. Ett SDK tar hand om detaljer på låg nivå och låter dig fokusera på dina projektuppgifter. Vänligen kolla inGitHub-arkivet för en komplett lista över Aspose.Cells Cloud SDK:er.
Följande kodexempel visar hur man anropar Aspose.Cells webbtjänster med hjälp av olika SDK:er:
C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Aspose.Cells.Cloud.SDK.Api.ExampleQuickstart
{
using System;
using System.IO;
using System.Collections.Generic;
using Aspose.Cells.Cloud.SDK.Api;
using Aspose.Cells.Cloud.SDK.Model;
using Aspose.Cells.Cloud.SDK.Request;
public class CellsApiExample
{
string CellsCloudClientId ="....";//get from https://dashboard.aspose.cloud/#/applications
string CellsCloudClientSecret="...";//get from https://dashboard.aspose.cloud/#/applications
CellsApi cellsApi = new CellsApi(CellsCloudClientId, CellsCloudClientSecret);
string localName = "Book1.xlsx";
string localPath = @"D:\TestData\CellsCloud";
string outputFilePath = @"D:\Outpath\result.pdf";
public void ExamplePostConvertWorkbookToPdf()
{
string inputPath = Path.Combine(localPath, localName);
using (var inputFile = File.OpenRead(inputPath))
{
var mapFiles = new Dictionary<string, Stream> { [localName] = inputFile };
var request = new PostConvertWorkbookToPDFRequest { File = mapFiles };
var response = cellsApi.PostConvertWorkbookToPDF(request);
byte[] fileBytes = Convert.FromBase64String(response.FileContent);
File.WriteAllBytes(outputFilePath, fileBytes);
}
}
}
}
Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.aspose.cloud.cells.api;
import com.aspose.cloud.cells.client.*;
import com.aspose.cloud.cells.model.*;
import com.aspose.cloud.cells.request.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.util.HashMap;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class ExapmlePostConvertWorkbookToPDF {
private CellsApi api;
public ExapmleQuickstart(){
try {
String CellsCloudClientId ="....";//get from https://dashboard.aspose.cloud/#/applications
String CellsCloudClientSecret="...";//get from https://dashboard.aspose.cloud/#/applications
api = new CellsApi(CellsCloudClientId, CellsCloudClientSecret);
} catch (ApiException e) {
e.printStackTrace();
}
}
public void PostConvertWorkbookToPDF(){
try{
String localName = "Book1.xlsx";
String localPath = "D:/TestData/CellsCloud";
String outputFilePath ="D:/Outpath/result.pdf";
PostConvertWorkbookToPdfRequest request = new PostConvertWorkbookToPdfRequest();
File inputFile = new File(localPath, localName);
Map<String, File> fileMap = new HashMap<>();
fileMap.put(localName, inputFile);
request.setfile(fileMap);
FileInfo resultFile = this.api.postConvertWorkbookToPdf(request);
yte[] pdfBytes = Base64.getDecoder().decode(resultFile.getFileContent());
Files.write(Paths.get(outputPath), pdfBytes);
} catch (ApiException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}
}
}
PHP
Ruby
Node.js
Python
Perl
Go
Andra API:er implementerar den här funktionen
POST /celler/{namn}/sparaSom API låter dig spara MS Excel-filen som en CSV-fil med ytterligare inställningar och spara resultatet till lagringsplatsen.
Denna REST API convert
Excel-fil till CSV.
PUT /celler/konvertera API låter dig konvertera MS Excel-filen till CSV-filen med ytterligare inställningar och spara resultatet i svaret.
Denna REST API export
Excel-fil till CSV.
HÄMTA /celler/{namn} API låter dig konvertera MS Excel-filen till CSV-filen med ytterligare inställningar och spara resultatet i svaret.