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.Watermark-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.Watermark 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.Watermark Cloud SDK for .NET zu verwenden.

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

var configuration = new Configuration("YourClientId", "YourClientSecret");
var apiInstance = new WatermarkApi(configuration);

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

Textwasserzeichen hinzufügen

Dieses Beispiel fügt einem Word-Dokument ein Textwasserzeichen in Arial hinzu.

using System.Collections.Generic;
using GroupDocs.Watermark.Cloud.Sdk.Api;
using GroupDocs.Watermark.Cloud.Sdk.Client;
using GroupDocs.Watermark.Cloud.Sdk.Model;
using GroupDocs.Watermark.Cloud.Sdk.Model.Requests;

var configuration = new Configuration("YourClientId", "YourClientSecret");
var apiInstance = new WatermarkApi(configuration);

var options = new WatermarkOptions
{
    FileInfo = new FileInfo { FilePath = "documents/sample.docx" },
    WatermarkDetails = new List<WatermarkDetails>
    {
        new WatermarkDetails
        {
            TextWatermarkOptions = new TextWatermarkOptions
            {
                Text = "New watermark text",
                FontFamilyName = "Arial",
                FontSize = 12d
            }
        }
    }
};

var response = apiInstance.Add(new AddRequest(options));
Console.WriteLine("Resultant file path: " + response.Path);

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

Bildwasserzeichen hinzufügen

Dieses Beispiel fügt einem Word-Dokument ein Bildwasserzeichen hinzu.

using System.Collections.Generic;
using GroupDocs.Watermark.Cloud.Sdk.Api;
using GroupDocs.Watermark.Cloud.Sdk.Client;
using GroupDocs.Watermark.Cloud.Sdk.Model;
using GroupDocs.Watermark.Cloud.Sdk.Model.Requests;

var configuration = new Configuration("YourClientId", "YourClientSecret");
var apiInstance = new WatermarkApi(configuration);

var options = new WatermarkOptions
{
    FileInfo = new FileInfo { FilePath = "documents/sample.docx" },
    WatermarkDetails = new List<WatermarkDetails>
    {
        new WatermarkDetails
        {
            ImageWatermarkOptions = new ImageWatermarkOptions
            {
                Image = new FileInfo { FilePath = "watermark_images/sample_watermark.png" }
            }
        }
    }
};

var response = apiInstance.Add(new AddRequest(options));
Console.WriteLine("Resultant file path: " + response.Path);

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

Nach Wasserzeichen suchen

Dieses Beispiel sucht in einem PDF nach einem Textwasserzeichen und einem Bildwasserzeichen.

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

var configuration = new Configuration("YourClientId", "YourClientSecret");
var apiInstance = new WatermarkApi(configuration);

var options = new SearchOptions
{
    FileInfo = new FileInfo { FilePath = "with_watermarks/sample.pdf" },
    TextSearchCriteria = new TextSearchCriteria { SearchText = "Watermark text" },
    ImageSearchCriteria = new ImageSearchCriteria
    {
        ImageFileInfo = new FileInfo { FilePath = "watermark_images/sample_watermark.png" }
    }
};

var response = apiInstance.Search(new SearchRequest(options));

foreach (var watermark in response.Watermarks)
{
    Console.WriteLine($"Id: {watermark.Id}, Type: {watermark.PossibleWatermarkType}");
}

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

Wasserzeichen entfernen

Dieses Beispiel entfernt passende Text- und Bildwasserzeichen aus einem PDF.

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

var configuration = new Configuration("YourClientId", "YourClientSecret");
var apiInstance = new WatermarkApi(configuration);

var options = new RemoveOptions
{
    FileInfo = new FileInfo { FilePath = "with_watermarks/sample.pdf" },
    TextSearchCriteria = new TextSearchCriteria { SearchText = "Watermark text" },
    ImageSearchCriteria = new ImageSearchCriteria
    {
        ImageFileInfo = new FileInfo { FilePath = "watermark_images/sample_watermark.png" }
    },
    OutputFolder = "removed_watermarks"
};

var response = apiInstance.Remove(new RemoveRequest(options));
Console.WriteLine("Resultant file path: " + response.Path);

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

Beispiele auf GitHub

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

CategoryExamples
WasserzeichenText hinzufügen, Bild hinzufügen, suchen, ersetzen, entfernen
InfoDokumentinformationen, unterstützte Dateitypen

Beispiele ausführen

  1. Klonen oder laden Sie das Beispiel-Repository herunter
  2. Öffnen Sie Examples/GroupDocs.Watermark.Cloud.Examples.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.Watermark.Cloud.Examples.CSharp/RunExamples.cs und legen Sie Common.MyAppSid und Common.MyAppKey fest
  5. Erstellen und ausführen

Weitere Informationen finden Sie unter Getting Started.


Product Docs Swagger Examples Blog Support Dashboard



 Deutsch