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.
If you experience errors, when you try to download a file, make sure your network policies (enforced by your company or ISP) allow downloading ZIP and/or MSI files.

Instalasi
Paket tersedia di npmjs.com dan dapat diinstal melalui npm dengan menjalankan perintah berikut:
npm install groupdocs-viewer-cloud

Persyaratan
Dependensi
SDK memerlukan paket berikut:
| Package | Constraint |
|---|
| axios | 1.8.4 |
| form-data | * |
| jsonwebtoken | 9.0.1 |
| qs | 6.11.2 |
Mulai cepat
Dapatkan kredensial API Anda
Untuk menggunakan GroupDocs.Viewer Cloud, daftar di GroupDocs.Cloud Dashboard dan dapatkan Client ID dan Client Secret Anda.
Inisialisasi API
Gunakan kode berikut untuk mulai menggunakan GroupDocs.Viewer Cloud SDK for Node.js.
"use strict";
const viewer_cloud = require("groupdocs-viewer-cloud");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new viewer_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const viewApi = viewer_cloud.ViewApi.fromConfig(config);
Lihat contoh lengkap di RunExamples.js.
Konversi dan unduh dokumen
Setelah diinisialisasi, gunakan contoh dasar ini untuk merender dokumen lokal ke JPG tanpa mengunggahnya ke penyimpanan cloud.
"use strict";
const viewer_cloud = require("groupdocs-viewer-cloud");
const fs = require("fs");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new viewer_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const viewApi = viewer_cloud.ViewApi.fromConfig(config);
(async () => {
let format = "jpg";
let filebuf = fs.readFileSync("./Resources/SampleFiles/sample.docx");
let request = new viewer_cloud.ConvertAndDownloadRequest(format, filebuf);
let response = await viewApi.convertAndDownload(request);
console.log("ConvertAndDownload completed: " + response.length);
})();
Lihat contoh lengkap di ConvertAndDownload.js.
Render dokumen ke HTML responsif
Contoh ini membuat tampilan HTML dengan tata letak responsif.
"use strict";
const viewer_cloud = require("groupdocs-viewer-cloud");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new viewer_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const viewApi = viewer_cloud.ViewApi.fromConfig(config);
(async () => {
let fileInfo = new viewer_cloud.FileInfo();
fileInfo.filePath = "SampleFiles/sample.docx";
let viewOptions = new viewer_cloud.ViewOptions();
viewOptions.fileInfo = fileInfo;
viewOptions.viewFormat = viewer_cloud.ViewOptions.ViewFormatEnum.HTML;
viewOptions.renderOptions = new viewer_cloud.HtmlOptions();
viewOptions.renderOptions.isResponsive = true;
let request = new viewer_cloud.CreateViewRequest(viewOptions);
let response = await viewApi.createView(request);
console.log("HtmlViewerResponsiveLayout completed: " + response.pages.length);
})();
Lihat contoh lengkap di HtmlViewerResponsiveLayout.js.
Render halaman terpilih
Contoh ini merender halaman 2 dan 3 dokumen ke HTML.
"use strict";
const viewer_cloud = require("groupdocs-viewer-cloud");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new viewer_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const viewApi = viewer_cloud.ViewApi.fromConfig(config);
(async () => {
let fileInfo = new viewer_cloud.FileInfo();
fileInfo.filePath = "SampleFiles/sample.docx";
let viewOptions = new viewer_cloud.ViewOptions();
viewOptions.fileInfo = fileInfo;
viewOptions.viewFormat = viewer_cloud.ViewOptions.ViewFormatEnum.HTML;
viewOptions.renderOptions = new viewer_cloud.HtmlOptions();
viewOptions.renderOptions.pagesToRender = [2, 3];
let request = new viewer_cloud.CreateViewRequest(viewOptions);
let response = await viewApi.createView(request);
console.log("RenderSelectedPages completed: " + response.pages.length);
})();
Lihat contoh lengkap di RenderSelectedPages.js.
Lihat dokumen yang dilindungi kata sandi
Contoh ini merender dokumen Word yang dilindungi kata sandi ke HTML.
"use strict";
const viewer_cloud = require("groupdocs-viewer-cloud");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new viewer_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const viewApi = viewer_cloud.ViewApi.fromConfig(config);
(async () => {
let fileInfo = new viewer_cloud.FileInfo();
fileInfo.filePath = "SampleFiles/password_protected.docx";
fileInfo.password = "12345";
let viewOptions = new viewer_cloud.ViewOptions();
viewOptions.fileInfo = fileInfo;
viewOptions.viewFormat = viewer_cloud.ViewOptions.ViewFormatEnum.HTML;
let request = new viewer_cloud.CreateViewRequest(viewOptions);
let response = await viewApi.createView(request);
console.log("ViewProtectedDocument completed: " + response.pages.length);
})();
Lihat contoh lengkap di ViewProtectedDocument.js.
Ambil format dokumen yang dapat dirender oleh API.
"use strict";
const viewer_cloud = require("groupdocs-viewer-cloud");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new viewer_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const infoApi = viewer_cloud.InfoApi.fromConfig(config);
(async () => {
let response = await infoApi.getSupportedFileFormats();
console.log("Formats count: " + response.formats.length);
})();
Lihat contoh lengkap di GetSupportedFormats.js.
Contoh di GitHub
Repositori GroupDocs.Viewer Cloud Node.js Examples berisi contoh siap dijalankan yang mencakup:
| Category | Examples |
|---|
| Basic Usage | Konversi dan unduh, penampil HTML, penampil gambar, penampil PDF, informasi dokumen, lampiran, format yang didukung |
| Rendering Options | Halaman terpilih, halaman berurutan, tanda air, catatan, komentar, font khusus |
| Loading Options | Dokumen yang dilindungi kata sandi, pengodean |
| File Types | Arsip, CAD, email, PDF, lembar bentang, Visio, Word, Outlook, dan file proyek |
Cara menjalankan contoh
- Klon atau unduh repositori contoh
- Edit
Examples/RunExamples.js dan atur clientId serta clientSecret - Buka direktori
Examples - Jalankan
npm install - Jalankan
npm update - Jalankan
npm run-script start
Untuk detail selengkapnya, kunjungi Getting Started.

Document Rendering API | Node.js 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 | Responsive HTML | Attachment Rendering | Secure API Access | Cloud Storage Integration