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 bei rubygems.org und kann über gem mit folgendem Befehl installiert werden:

gem install groupdocs_viewer_cloud

Gem Version Gem Total Downloads Ruby-GroupDocsCloud


Anforderungen

Abhängigkeiten

Das SDK benötigt die folgenden Gems:

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

Schnellstart

API-Anmeldeinformationen erhalten

Um GroupDocs.Viewer Cloud zu nutzen, registrieren Sie sich im GroupDocs.Cloud Dashboard und erhalten Sie Ihre Client ID und Client Secret.

API initialisieren

Verwenden Sie den folgenden Code, um das GroupDocs.Viewer Cloud SDK for Ruby zu nutzen.

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)

Das vollständige Beispiel finden Sie in RunExamples.rb.

Ein Dokument konvertieren und herunterladen

Nach der Initialisierung rendern Sie mit diesem grundlegenden Beispiel ein lokales Dokument als JPG, ohne es in den Cloud-Speicher hochzuladen.

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)

Das vollständige Beispiel finden Sie in ConvertAndDownload.rb.

Ein Dokument als responsives HTML rendern

Dieses Beispiel erstellt eine HTML-Ansicht mit einem responsiven Layout.

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)

Das vollständige Beispiel finden Sie in HtmlViewerResponsiveLayout.rb.

Ausgewählte Seiten rendern

Dieses Beispiel rendert die Seiten 2 und 3 eines Dokuments als 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)

Das vollständige Beispiel finden Sie in RenderSelectedPages.rb.

Ein kennwortgeschütztes Dokument anzeigen

Dieses Beispiel rendert ein kennwortgeschütztes Word-Dokument als 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)

Das vollständige Beispiel finden Sie in ViewProtectedDocument.rb.

Unterstützte Viewer-Formate abrufen

Rufen Sie die Dokumentformate ab, die die API rendern kann.

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)

Das vollständige Beispiel finden Sie in GetSupportedFormats.rb.

Beispiele auf GitHub

Das Repository GroupDocs.Viewer Cloud Ruby Examples enthält sofort ausführbare Beispiele für:

CategoryExamples
Basic UsageKonvertieren und herunterladen, HTML-Viewer, Bild-Viewer, PDF-Viewer, Dokumentinformationen, Anhänge, unterstützte Formate
Rendering OptionsAusgewählte Seiten, aufeinanderfolgende Seiten, Wasserzeichen, Notizen, Kommentare, benutzerdefinierte Schriftarten
Loading OptionsKennwortgeschützte Dokumente, Kodierung
File TypesArchiv-, CAD-, E-Mail-, PDF-, Tabellen-, Visio-, Word-, Outlook- und Projektdateien

So führen Sie die Beispiele aus

  1. Klonen oder laden Sie das Beispiel-Repository herunter
  2. Bearbeiten Sie Examples/RunExamples.rb und setzen Sie client_id und client_secret
  3. Wechseln Sie in das Verzeichnis Examples
  4. Führen Sie gem install groupdocs_viewer_cloud aus
  5. Führen Sie ruby RunExamples.rb aus

Weitere Details finden Sie unter 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



 Deutsch