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.

Εγκατάσταση
Το πακέτο είναι διαθέσιμο στο rubygems.org και μπορεί να εγκατασταθεί μέσω gem εκτελώντας την παρακάτω εντολή:
gem install groupdocs_viewer_cloud

Απαιτήσεις
Εξαρτήσεις
Το SDK απαιτεί τα ακόλουθα gems:
| Package | Constraint |
|---|
| addressable | ~> 2.8.0, >= 2.8.0 |
| faraday | ~> 0.14.0 |
Γρήγορη εκκίνηση
Λάβετε τα διαπιστευτήρια API
Για να χρησιμοποιήσετε το GroupDocs.Viewer Cloud, εγγραφείτε στον GroupDocs.Cloud Dashboard και λάβετε το Client ID και το Client Secret σας.
Αρχικοποίηση του API
Χρησιμοποιήστε τον παρακάτω κώδικα για να ξεκινήσετε να χρησιμοποιείτε το 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)
Δείτε το πλήρες παράδειγμα στο RunExamples.rb.
Μετατροπή και λήψη εγγράφου
Μετά την αρχικοποίηση, χρησιμοποιήστε αυτό το βασικό παράδειγμα για να αποδώσετε ένα τοπικό έγγραφο σε JPG χωρίς να το μεταφορτώσετε στον χώρο αποθήκευσης 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)
Δείτε το πλήρες παράδειγμα στο ConvertAndDownload.rb.
Απόδοση εγγράφου σε αποκριτική HTML
Αυτό το παράδειγμα δημιουργεί μια προβολή 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.is_responsive = true
request = GroupDocsViewerCloud::CreateViewRequest.new(viewOptions)
response = apiInstance.create_view(request)
puts("HtmlViewerResponsiveLayout completed: " + response.pages.length.to_s)
Δείτε το πλήρες παράδειγμα στο HtmlViewerResponsiveLayout.rb.
Απόδοση επιλεγμένων σελίδων
Αυτό το παράδειγμα αποδίδει τις σελίδες 2 και 3 ενός εγγράφου σε 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)
Δείτε το πλήρες παράδειγμα στο RenderSelectedPages.rb.
Προβολή εγγράφου προστατευμένου με κωδικό πρόσβασης
Αυτό το παράδειγμα αποδίδει ένα έγγραφο Word προστατευμένο με κωδικό πρόσβασης σε 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)
Δείτε το πλήρες παράδειγμα στο ViewProtectedDocument.rb.
Λήψη υποστηριζόμενων μορφών Viewer
Ανακτήστε τις μορφές εγγράφων που μπορεί να αποδώσει το 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)
Δείτε το πλήρες παράδειγμα στο GetSupportedFormats.rb.
Παραδείγματα στο GitHub
Το αποθετήριο GroupDocs.Viewer Cloud Ruby Examples περιλαμβάνει έτοιμα προς εκτέλεση παραδείγματα που καλύπτουν:
| Category | Examples |
|---|
| Basic Usage | Μετατροπή και λήψη, προβολή HTML, προβολή εικόνας, προβολή PDF, πληροφορίες εγγράφου, συνημμένα, υποστηριζόμενες μορφές |
| Rendering Options | Επιλεγμένες σελίδες, διαδοχικές σελίδες, υδατογραφήματα, σημειώσεις, σχόλια, προσαρμοσμένες γραμματοσειρές |
| Loading Options | Έγγραφα προστατευμένα με κωδικό πρόσβασης, κωδικοποίηση |
| File Types | Αρχεία συμπιεσμένων αρχείων, CAD, email, PDF, υπολογιστικών φύλλων, Visio, Word, Outlook και έργων |
Τρόπος εκτέλεσης των παραδειγμάτων
- Κλωνοποιήστε ή κατεβάστε το αποθετήριο παραδειγμάτων
- Επεξεργαστείτε το
Examples/RunExamples.rb και ορίστε τα client_id και client_secret - Μεταβείτε στον κατάλογο
Examples - Εκτελέστε
gem install groupdocs_viewer_cloud - Εκτελέστε
ruby RunExamples.rb
Για περισσότερες λεπτομέρειες, επισκεφθείτε το Getting Started.

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