Jelajahi Produk kami

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

Instalasi

Paket ini tersedia di nuget.org dan dapat diinstal melalui Package Manager Console dengan perintah berikut:

NuGet\Install-Package GroupDocs.viewer-Cloud

Version NuGet NuGet-GroupDocsCloud


Persyaratan

  • .NET Framework 2.0 atau .NET Standard 2.0
  • NuGet
  • System.Web saat menargetkan .NET Framework 2.0
  • Kredensial GroupDocs Cloud — Client ID and Client Secret dari Dasbor

Mulai cepat

Dapatkan kredensial API Anda

Untuk menggunakan GroupDocs.Viewer Cloud, daftar di Dasbor GroupDocs.Cloud dan dapatkan Client ID serta Client Secret.

Inisialisasi API

Gunakan kode berikut untuk mulai menggunakan GroupDocs.Viewer Cloud SDK for .NET.

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

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

var config = new Configuration(MyClientId, MyClientSecret);
config.ApiBaseUrl = "https://api.groupdocs.cloud";

var apiInstance = new ViewApi(config);

Lihat contoh lengkap di Constants.cs.

Mengonversi dokumen lokal ke JPEG

Contoh ini merender dokumen Word lokal ke JPEG tanpa mengunggahnya ke penyimpanan cloud.

using System.IO;
using GroupDocs.Viewer.Cloud.Sdk.Api;
using GroupDocs.Viewer.Cloud.Sdk.Client;
using GroupDocs.Viewer.Cloud.Sdk.Model.Requests;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new ViewApi(config);

var response = apiInstance.ConvertAndDownload(new ConvertAndDownloadRequest("jpg", File.OpenRead("sample.docx")));
Console.WriteLine("ConvertAndDownload completed: " + response.Length + " bytes received");

Lihat contoh lengkap di ConvertAndDownload.cs.

Merender halaman terpilih

Contoh ini merender halaman 2 dan 3 dokumen Word ke HTML.

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

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new ViewApi(config);

var viewOptions = new ViewOptions
{
    FileInfo = new FileInfo { FilePath = "SampleFiles/sample.docx" },
    ViewFormat = ViewOptions.ViewFormatEnum.HTML,
    RenderOptions = new RenderOptions
    {
        PagesToRender = new List<int?> { 2, 3 }
    }
};

var response = apiInstance.CreateView(new CreateViewRequest(viewOptions));
Console.WriteLine("RenderSelectedPages completed: " + response.Pages.Count);

Lihat contoh lengkap di RenderSelectedPages.cs.

Merender dokumen yang dilindungi kata sandi

Contoh ini merender dokumen Word yang dilindungi kata sandi ke HTML.

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

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new ViewApi(config);

var viewOptions = new ViewOptions
{
    FileInfo = new FileInfo
    {
        FilePath = "SampleFiles/password_protected.docx",
        Password = "12345"
    },
    ViewFormat = ViewOptions.ViewFormatEnum.HTML
};

var response = apiInstance.CreateView(new CreateViewRequest(viewOptions));
Console.WriteLine("ViewProtectedDocument completed: " + response.Pages.Count);

Lihat contoh lengkap di ViewProtectedDocument.cs.

Mendapatkan format file yang didukung

Ambil format yang diterima API viewer.

using System.Linq;
using GroupDocs.Viewer.Cloud.Sdk.Api;
using GroupDocs.Viewer.Cloud.Sdk.Client;

var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new InfoApi(config);

var response = apiInstance.GetSupportedFileFormats();

foreach (var entry in response.Formats.Take(5))
{
    Console.WriteLine($"{entry.FileFormat}: {entry.Extension}");
}

Lihat contoh lengkap di GetSupportedFormats.cs.

Contoh di GitHub

Repositori GroupDocs.Viewer Cloud .NET Examples berisi contoh siap jalan yang mencakup:

CategoryExamples
RenderOutput HTML, PDF, dan gambar; halaman terpilih; tanda air; dokumen terlindungi
Menurut formatCAD, email, PDF, lembar bentang, teks, Visio, pemrosesan kata, arsip, Outlook, Project
InfoInformasi dokumen, lampiran, format yang didukung

Cara menjalankan contoh

  1. Klon atau unduh repositori contoh
  2. Buka Examples/GroupDocs.Viewer.Cloud.Examples.CSharp.sln di Visual Studio 2017 atau yang lebih baru
  3. Klik kanan solusi dan pilih Enable NuGet Package Restore
  4. Edit Examples/GroupDocs.Viewer.Cloud.Examples.CSharp/RunExamples.cs lalu atur Constants.MyClientId dan Constants.MyClientSecret
  5. Bangun dan jalankan

Untuk detail selengkapnya, kunjungi Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Tag

Document Rendering API | .NET Cloud API | GroupDocs.Viewer Cloud | REST API | HTML Rendering | PDF Conversion | Image Rendering | Document Viewing | Multi-Page Rendering | Document Streaming | CAD Rendering | E-Mail Message Rendering | Visio Rendering | MS Project Rendering | Outlook Data Rendering | Spreadsheet Rendering | Word Processing Rendering | Custom View Options


Unduh langsung

 Indonesia