|
1 | | -   [](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet/blob/master/LICENSE) |
| 1 | +# GroupDocs.Viewer Cloud Ruby SDK |
| 2 | +Ruby gem for communicating with the GroupDocs.Viewer Cloud API |
2 | 3 |
|
3 | | -# Ruby SDK to View Documents in the Cloud |
| 4 | +## Installation |
4 | 5 |
|
5 | | -[GroupDocs.Viewer Cloud SDK for Ruby](https://products.groupdocs.cloud/viewer/ruby) wraps GroupDocs.Viewer RESTful APIs so you may integrate Document Viewing features in your own apps with zero initial cost. |
6 | | - |
7 | | -GroupDocs.Viewer REST API allows the developers to view & render a number of files formats including Word documents, Excel spreadsheets, PowerPoint presentations, PDF, OpenDocument formats, emails, CAD files & images. |
8 | | - |
9 | | -## Document Viewer Services in REST |
10 | | - |
11 | | -- 90+ supported file formats. |
12 | | -- View documents as PDF, HTML or images. |
13 | | -- Render documents as raster & vector images. |
14 | | -- Render documents with comments & notes. |
15 | | -- Flip or rotate documents pages at 90, 180 or 270 degrees. |
16 | | -- Reorder document pages. |
17 | | -- Render hidden, consecutive or selected document pages. |
18 | | -- Watermark PDF, image or HTML output pages. |
19 | | -- Render with custom fonts as well as replace any missing fonts. |
20 | | -- Load password-protected documents. |
21 | | -- Extract attachment information such as attachment count & names. |
22 | | -- Extract document information like file format, page count, size and visibility, text coordinates, and so on. |
23 | | -- Integrated storage API. |
24 | | - |
25 | | -Check out the [Developer's Guide](https://docs.groupdocs.cloud/viewer/developer-guide/) to know more about GroupDocs.Viewer REST API. |
26 | | - |
27 | | -## Microsoft File Formats |
28 | | - |
29 | | -**Microsoft Word:** DOC, DOCM, DOCX, DOT, DOTM, DOTX\ |
30 | | -**Microsoft Excel:** XLS, XLSX, XLSB, XLSM\ |
31 | | -**Microsoft PowerPoint:** PPTX, PPTM, PPT, PPSX, PPSM, PPS, POTX, POTM\ |
32 | | -**Microsoft Project:** MPP, MPT\ |
33 | | -**Microsoft Outlook:** MSG, OST, PST\ |
34 | | -**Microsoft Visio:** VDW, VDX, VSD, VSDM, VSDX, VSS, VSSM, VSSX, VST, VSTM, VSTX, VSX, VTX\ |
35 | | -**Microsoft OneNote:** ONE |
36 | | - |
37 | | -## Other Formats |
38 | | - |
39 | | -**Page Layout Formats:** PDF, XPS, TEX\ |
40 | | -**OpenDocument:** ODT, OTT, ODS, OTS, ODP, OTP\ |
41 | | -**CAD:** DNG, DWF, DWG, DXF, IDC, STL\ |
42 | | -**Images:** BMP, CGM, DCM, DJVU, EMP, EPS, GIF, ICO, JP2, JPG, ODG, PCL, PNG, PS, PSD, SVG, TIFF, WEBP, WMF\ |
43 | | -**Web:** HTML, MHT, MHTML\ |
44 | | -**Emails:** EML, EMLX\ |
45 | | -**eBooks:** EPUB, MOBI\ |
46 | | -**Others:** TXT, RTF, CSV, TSV |
47 | | - |
48 | | -## Get Started with GroupDocs.Viewer Cloud SDK for Ruby |
49 | | - |
50 | | -First create an account at [GroupDocs for Cloud](https://dashboard.groupdocs.cloud/) and get your application information. Next, install the GEM as follows. |
| 6 | +A gem of groupdocs_viewer_cloud is available at [rubygems.org](https://rubygems.org). You can install it with: |
51 | 7 |
|
52 | 8 | ```shell |
53 | 9 | gem install groupdocs_viewer_cloud |
54 | 10 | ``` |
55 | 11 |
|
56 | | -Copy the following into your GEM and run `bundle install` to add the dependency. |
| 12 | +To add dependency to your app copy following into your Gemfile and run `bundle install`: |
57 | 13 |
|
58 | 14 | ``` |
59 | | -gem "groupdocs_viewer_cloud", "~> 20.5" |
| 15 | +gem "groupdocs_viewer_cloud", "~> 21.3" |
60 | 16 | ``` |
61 | 17 |
|
62 | | -## Render N Consecutive Pages of DOCX as HTML |
| 18 | +## Getting Started |
63 | 19 |
|
| 20 | +Please follow the [installation](#installation) procedure and then run the following code: |
64 | 21 | ```ruby |
65 | | -# For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-ruby-samples |
| 22 | +# Load the gem |
66 | 23 | require 'groupdocs_viewer_cloud' |
67 | 24 |
|
68 | | -# Get Client Id and Client Secret from https://dashboard.groupdocs.cloud |
69 | | -$my_client_id = "" |
70 | | -$my_client_secret = "" |
71 | | - |
72 | | -# Create instance of the API |
73 | | -$configuration = GroupDocsViewerCloud::Configuration.new($my_client_id, $my_client_secret) |
74 | | -apiInstance = GroupDocsViewerCloud::ViewApi.from_config($configuration) |
| 25 | +# Get your app_sid and app_key at https://dashboard.groupdocs.cloud (free registration is required). |
| 26 | +app_sid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" |
| 27 | +app_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" |
75 | 28 |
|
76 | | -viewOptions = GroupDocsViewerCloud::ViewOptions.new |
77 | | -viewOptions.file_info = GroupDocsViewerCloud::FileInfo.new |
78 | | -viewOptions.file_info.file_path = "SampleFiles/sample.docx" |
79 | | -viewOptions.view_format = "HTML" |
80 | | -viewOptions.render_options = GroupDocsViewerCloud::HtmlOptions.new |
81 | | -viewOptions.render_options.start_page_number = 1 |
82 | | -viewOptions.render_options.count_pages_to_render = 2 |
| 29 | +# Create instance of the API class |
| 30 | +api = GroupDocsViewerCloud::InfoApi.from_keys(app_sid, app_key) |
83 | 31 |
|
84 | | -request = GroupDocsViewerCloud::CreateViewRequest.new(viewOptions) |
85 | | -response = apiInstance.create_view(request) |
| 32 | +# Retrieve supported file-formats |
| 33 | +response = api.get_supported_file_formats |
86 | 34 |
|
| 35 | +# Print out supported file-formats |
| 36 | +puts("Supported file-formats:") |
| 37 | +response.formats.each do |format| |
| 38 | + puts("#{format.file_format} (#{format.extension})") |
| 39 | +end |
87 | 40 | ``` |
88 | 41 |
|
89 | | -## GroupDocs.Viewer Cloud SDKs in Popular Languages |
| 42 | +## Licensing |
| 43 | +GroupDocs.Viewer Cloud Ruby SDK licensed under [MIT License](LICENSE). |
90 | 44 |
|
91 | | -| .NET | Java | PHP | Python | Ruby | Node.js | Android | |
92 | | -|---|---|---|---|---|---|---| |
93 | | -| [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-php) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-python) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-ruby) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node) | [GitHub](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-android) | |
94 | | -| [NuGet](https://www.nuget.org/packages/GroupDocs.Viewer-Cloud/) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-viewer-cloud) | [Composer](https://packagist.org/packages/groupdocscloud/groupdocs-viewer-cloud) | [PIP](https://pypi.org/project/groupdocs-viewer-cloud/) | [GEM](https://rubygems.org/gems/groupdocs_viewer_cloud) | [NPM](https://www.npmjs.com/package/groupdocs-viewer-cloud) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-viewer-cloud-android) | |
| 45 | +## Resources |
| 46 | ++ [**Website**](https://www.groupdocs.cloud) |
| 47 | ++ [**Product Home**](https://products.groupdocs.cloud/viewer) |
| 48 | ++ [**Documentation**](https://docs.groupdocs.cloud/display/viewercloud/Home) |
| 49 | ++ [**Free Support Forum**](https://forum.groupdocs.cloud/c/viewer) |
| 50 | ++ [**Blog**](https://blog.groupdocs.cloud/category/viewer) |
95 | 51 |
|
96 | | -[Home](https://www.groupdocs.cloud/) | [Product Page](https://products.groupdocs.cloud/viewer/ruby) | [Documentation](https://docs.groupdocs.cloud/viewer/) | [Live Demo](https://products.groupdocs.app/viewer/total) | [API Reference](https://apireference.groupdocs.cloud/viewer/) | [Code Samples](https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-ruby-samples) | [Blog](https://blog.groupdocs.cloud/category/viewer/) | [Free Support](https://forum.groupdocs.cloud/c/viewer) | [Free Trial](https://dashboard.groupdocs.cloud) |
| 52 | +## Contact Us |
| 53 | +Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/viewer). |
0 commit comments