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 tersedia di rubygems.org dan dapat diinstal melalui gem dengan menjalankan perintah berikut:

gem install groupdocs_viewer_cloud

Gem Version Gem Total Downloads Ruby-GroupDocsCloud


Persyaratan

Dependensi

SDK memerlukan gem berikut:

PackageConstraint
addressable~> 2.8.0, >= 2.8.0
faraday~> 0.14.0

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 Ruby.

require 'groupdocs_viewer_cloud'

# Get your client id and client secret at https://dashboard.groupdocs.cloud
client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsViewerCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

apiInstance = GroupDocsViewerCloud::ViewApi.from_config(config)

Lihat contoh lengkap di RunExamples.rb.

Konversi dan unduh dokumen

Setelah diinisialisasi, gunakan contoh dasar ini untuk merender dokumen lokal ke JPG tanpa mengunggahnya ke penyimpanan cloud.

require 'groupdocs_viewer_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsViewerCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

apiInstance = GroupDocsViewerCloud::ViewApi.from_config(config)

format = "jpg"
file = File.open("Resources/SampleFiles/sample.docx", "r")
request = GroupDocsViewerCloud::ConvertAndDownloadRequest.new format, file
response = apiInstance.convert_and_download(request)

puts("ConvertAndDownload completed: " + response.length.to_s)

Lihat contoh lengkap di ConvertAndDownload.rb.

Render dokumen ke HTML responsif

Contoh ini membuat tampilan HTML dengan tata letak responsif.

require 'groupdocs_viewer_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsViewerCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

apiInstance = GroupDocsViewerCloud::ViewApi.from_config(config)
viewOptions = GroupDocsViewerCloud::ViewOptions.new
viewOptions.file_info = GroupDocsViewerCloud::FileInfo.new
viewOptions.file_info.file_path = "SampleFiles/sample.docx"
viewOptions.view_format = "HTML"
viewOptions.render_options = GroupDocsViewerCloud::HtmlOptions.new
viewOptions.render_options.is_responsive = true

request = GroupDocsViewerCloud::CreateViewRequest.new(viewOptions)
response = apiInstance.create_view(request)

puts("HtmlViewerResponsiveLayout completed: " + response.pages.length.to_s)

Lihat contoh lengkap di HtmlViewerResponsiveLayout.rb.

Render halaman terpilih

Contoh ini merender halaman 2 dan 3 dokumen ke HTML.

require 'groupdocs_viewer_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsViewerCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

apiInstance = GroupDocsViewerCloud::ViewApi.from_config(config)
viewOptions = GroupDocsViewerCloud::ViewOptions.new
viewOptions.file_info = GroupDocsViewerCloud::FileInfo.new
viewOptions.file_info.file_path = "SampleFiles/sample.docx"
viewOptions.view_format = "HTML"
viewOptions.render_options = GroupDocsViewerCloud::HtmlOptions.new
viewOptions.render_options.pages_to_render = [2, 3]

request = GroupDocsViewerCloud::CreateViewRequest.new(viewOptions)
response = apiInstance.create_view(request)

puts("RenderSelectedPages completed: " + response.pages.length.to_s)

Lihat contoh lengkap di RenderSelectedPages.rb.

Lihat dokumen yang dilindungi kata sandi

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

require 'groupdocs_viewer_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsViewerCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

apiInstance = GroupDocsViewerCloud::ViewApi.from_config(config)
viewOptions = GroupDocsViewerCloud::ViewOptions.new
viewOptions.file_info = GroupDocsViewerCloud::FileInfo.new
viewOptions.file_info.file_path = "SampleFiles/password_protected.docx"
viewOptions.file_info.password = "12345"
viewOptions.view_format = "HTML"

request = GroupDocsViewerCloud::CreateViewRequest.new(viewOptions)
response = apiInstance.create_view(request)

puts("ViewProtectedDocument completed: " + response.pages.length.to_s)

Lihat contoh lengkap di ViewProtectedDocument.rb.

Dapatkan format penampil yang didukung

Ambil format dokumen yang dapat dirender oleh API.

require 'groupdocs_viewer_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsViewerCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

infoApi = GroupDocsViewerCloud::InfoApi.from_config(config)
result = infoApi.get_supported_file_formats()
puts("Formats count: " + result.formats.length.to_s)

Lihat contoh lengkap di GetSupportedFormats.rb.

Contoh di GitHub

Repositori GroupDocs.Viewer Cloud Ruby Examples berisi contoh siap dijalankan yang mencakup:

CategoryExamples
Basic UsageKonversi dan unduh, penampil HTML, penampil gambar, penampil PDF, informasi dokumen, lampiran, format yang didukung
Rendering OptionsHalaman terpilih, halaman berurutan, tanda air, catatan, komentar, font khusus
Loading OptionsDokumen yang dilindungi kata sandi, pengodean
File TypesArsip, CAD, email, PDF, lembar bentang, Visio, Word, Outlook, dan file proyek

Cara menjalankan contoh

  1. Klon atau unduh repositori contoh
  2. Edit Examples/RunExamples.rb dan atur client_id serta client_secret
  3. Buka direktori Examples
  4. Jalankan gem install groupdocs_viewer_cloud
  5. Jalankan ruby RunExamples.rb

Untuk detail selengkapnya, kunjungi Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Tags

Document Rendering API | Ruby 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



 Indonesia