Blader door onze producten

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.


Product Docs Swagger Examples Blog Support Dashboard

Installation

Das Paket ist verfügbar auf nuget.org und kann über die Paketmanager-Konsole mit dem folgenden Befehl installiert werden:

NuGet\Install-Package GroupDocs.editor-Cloud

Version NuGet NuGet-GroupDocsCloud


Anforderungen

  • .NET Framework 2.0 oder .NET Standard 2.0
  • NuGet
  • System.Web bei Zielplattform .NET Framework 2.0
  • GroupDocs Cloud-Anmeldeinformationen — Client ID and Client Secret aus dem Dashboard

Schnellstart

API-Anmeldeinformationen abrufen

Um GroupDocs.Editor Cloud zu verwenden, registrieren Sie sich im GroupDocs.Cloud-Dashboard und rufen Sie Client ID und Client Secret ab.

API initialisieren

Verwenden Sie den folgenden Code, um das GroupDocs.Editor Cloud SDK for .NET zu verwenden.

using GroupDocs.Editor.Cloud.Sdk.Api;
using GroupDocs.Editor.Cloud.Sdk.Client;

string MyClientId = "YourClientId";
string MyClientSecret = "YourClientSecret";

var config = new Configuration(MyClientId, MyClientSecret);

var apiInstance = new EditApi(config);

Das vollständige Beispiel finden Sie in Common.cs.

Word-Dokument bearbeiten

Dieses Beispiel lädt ein kennwortgeschütztes Word-Dokument, ersetzt Text im HTML und speichert eine DOCX-Datei.

using System.IO;
using System.Text;
using GroupDocs.Editor.Cloud.Sdk.Api;
using GroupDocs.Editor.Cloud.Sdk.Client;
using GroupDocs.Editor.Cloud.Sdk.Model;
using GroupDocs.Editor.Cloud.Sdk.Model.Requests;
using FileInfo = GroupDocs.Editor.Cloud.Sdk.Model.FileInfo;

var config = new Configuration("YourClientId", "YourClientSecret");
var editApi = new EditApi(config);
var fileApi = new FileApi(config);

var loadOptions = new WordProcessingLoadOptions
{
    FileInfo = new FileInfo
    {
        FilePath = "WordProcessing/password-protected.docx",
        Password = "password"
    },
    OutputPath = "output"
};

var loadResult = editApi.Load(new LoadRequest(loadOptions));
var stream = fileApi.DownloadFile(new DownloadFileRequest(loadResult.HtmlPath));
var htmlString = new StreamReader(stream, Encoding.UTF8).ReadToEnd();
htmlString = htmlString.Replace("Sample test text", "Hello world");

fileApi.UploadFile(new UploadFileRequest(loadResult.HtmlPath, new MemoryStream(Encoding.UTF8.GetBytes(htmlString))));

var saveOptions = new WordProcessingSaveOptions
{
    FileInfo = loadOptions.FileInfo,
    OutputPath = "output/edited.docx",
    HtmlPath = loadResult.HtmlPath,
    ResourcesPath = loadResult.ResourcesPath
};

var saveResult = editApi.Save(new SaveRequest(saveOptions));
Console.WriteLine("Document edited: " + saveResult.Path);

Das vollständige Beispiel finden Sie in EditWordProcessingDocument.cs.

Tabellenkalkulation bearbeiten

Dieses Beispiel lädt das erste Arbeitsblatt, ersetzt Text und speichert eine XLSX-Datei.

using System.IO;
using System.Text;
using GroupDocs.Editor.Cloud.Sdk.Api;
using GroupDocs.Editor.Cloud.Sdk.Client;
using GroupDocs.Editor.Cloud.Sdk.Model;
using GroupDocs.Editor.Cloud.Sdk.Model.Requests;
using FileInfo = GroupDocs.Editor.Cloud.Sdk.Model.FileInfo;

var config = new Configuration("YourClientId", "YourClientSecret");
var editApi = new EditApi(config);
var fileApi = new FileApi(config);

var loadOptions = new SpreadsheetLoadOptions
{
    FileInfo = new FileInfo { FilePath = "Spreadsheet/four-sheets.xlsx" },
    OutputPath = "output",
    WorksheetIndex = 0
};

var loadResult = editApi.Load(new LoadRequest(loadOptions));
var stream = fileApi.DownloadFile(new DownloadFileRequest(loadResult.HtmlPath));
var htmlString = new StreamReader(stream, Encoding.UTF8).ReadToEnd();
htmlString = htmlString.Replace("This is sample sheet", "This is sample sheep");

fileApi.UploadFile(new UploadFileRequest(loadResult.HtmlPath, new MemoryStream(Encoding.UTF8.GetBytes(htmlString))));

var saveOptions = new SpreadsheetSaveOptions
{
    FileInfo = loadOptions.FileInfo,
    OutputPath = "output/edited.xlsx",
    HtmlPath = loadResult.HtmlPath,
    ResourcesPath = loadResult.ResourcesPath
};

var saveResult = editApi.Save(new SaveRequest(saveOptions));
Console.WriteLine("Document edited: " + saveResult.Path);

Das vollständige Beispiel finden Sie in EditSpreadsheetDocument.cs.

Dokumentinformationen abrufen

Dieses Beispiel gibt die Seitenzahl eines kennwortgeschützten Word-Dokuments zurück.

using GroupDocs.Editor.Cloud.Sdk.Api;
using GroupDocs.Editor.Cloud.Sdk.Client;
using GroupDocs.Editor.Cloud.Sdk.Model;
using GroupDocs.Editor.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
var apiInstance = new InfoApi(config);

var request = new GetInfoRequest(new FileInfo
{
    FilePath = "WordProcessing/password-protected.docx",
    Password = "password"
});

var response = apiInstance.GetInfo(request);
Console.WriteLine("InfoResult.Pages.Count: " + response.PageCount);

Das vollständige Beispiel finden Sie in GetDocumentInformation.cs.

Unterstützte Dateitypen abrufen

Rufen Sie die Formate ab, die die editor-API akzeptiert.

using GroupDocs.Editor.Cloud.Sdk.Api;
using GroupDocs.Editor.Cloud.Sdk.Client;

var config = new Configuration("YourClientId", "YourClientSecret");
var apiInstance = new InfoApi(config);

var response = apiInstance.GetSupportedFileFormats();

foreach (var entry in response.Formats)
{
    Console.WriteLine($"{entry.FileFormat}: {string.Join(",", entry.Extension)}");
}

Das vollständige Beispiel finden Sie in GetSupportedFileTypes.cs.

Beispiele auf GitHub

Das Repository GroupDocs.Editor Cloud .NET Examples enthält sofort ausführbare Beispiele zu folgenden Themen:

CategoryExamples
BearbeitenTextverarbeitung, Tabellenkalkulation, Präsentation, Text mit Trennzeichen, Nur-Text
InfoDokumentinformationen, unterstützte Dateitypen, Lizenzverbrauch

Beispiele ausführen

  1. Klonen oder laden Sie das Beispiel-Repository herunter
  2. Öffnen Sie Examples/GroupDocs.Editor.Cloud.Examples.CSharp.sln in Visual Studio 2017 oder höher
  3. Klicken Sie mit der rechten Maustaste auf die Projektmappe und wählen Sie Enable NuGet Package Restore
  4. Bearbeiten Sie Examples/GroupDocs.Editor.Cloud.Examples.CSharp/RunExamples.cs und legen Sie Common.MyClientId und Common.MyClientSecret fest
  5. Erstellen und ausführen

Weitere Informationen finden Sie unter Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Schlagwörter

Document Editing API | .NET Cloud API | GroupDocs.Editor Cloud | REST API | Word Processing Formats | Spreadsheet Formats | Presentation Formats | Text Formats | CSV Files | DOCX Documents | XLSX Documents | PPTX Presentations | Password-Protected Files | Cloud Storage Integration | Document Info Retrieval | File Operations | API Explorer | Multi-Platform Support | SDK Support | Secure API Access


 Deutsch