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_conversion_cloud

要件
依存関係
SDK には次の gem が必要です。
| Package | Constraint |
|---|
| addressable | ~> 2.8.0, >= 2.8.0 |
| faraday | ~> 1.10 |
| logger | ~> 1.5 |
クイックスタート
API 認証情報を取得する
GroupDocs.Conversion Cloud を使用するには、GroupDocs.Cloud Dashboard で登録し、Client ID と Client Secret を取得します。
API を初期化する
GroupDocs.Conversion Cloud SDK for Ruby の使用を開始するには、次のコードを使用します。
require 'groupdocs_conversion_cloud'
# Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
client_id = "YourClientId"
client_secret = "YourClientSecret"
config = GroupDocsConversionCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"
convert_api = GroupDocsConversionCloud::ConvertApi.from_config(config)
完全な例は RunExamples.rb を参照してください。
文書を変換する (直接、クラウドストレージなし)
初期化したら、この基本例を使ってローカル文書を変換し、結果を直接受け取ります。
require 'groupdocs_conversion_cloud'
convert_api = GroupDocsConversionCloud::ConvertApi.from_keys("YourClientId", "YourClientSecret")
file = File.open("four-pages.docx", "r")
request = GroupDocsConversionCloud::ConvertDocumentDirectRequest.new("pdf", file)
result = convert_api.convert_document_direct(request)
puts("Document converted: " + result.length.to_s)
完全な例は ConvertToPdfDirect.rb を参照してください。
クラウドストレージを使って文書を変換する
この例はファイルを GroupDocs Cloud ストレージへアップロードし、変換して結果をダウンロードします。
require 'groupdocs_conversion_cloud'
client_id = "YourClientId"
client_secret = "YourClientSecret"
file_api = GroupDocsConversionCloud::FileApi.from_keys(client_id, client_secret)
convert_api = GroupDocsConversionCloud::ConvertApi.from_keys(client_id, client_secret)
file = File.open("myFile.docx", "r")
file_api.upload_file(GroupDocsConversionCloud::UploadFileRequest.new("myFile.docx", file))
settings = GroupDocsConversionCloud::ConvertSettings.new
settings.file_path = "myFile.docx"
settings.format = "pdf"
settings.output_path = "converted"
result = convert_api.convert_document(GroupDocsConversionCloud::ConvertDocumentRequest.new(settings))
puts("Document converted: " + result[0].url)
response = file_api.download_file(GroupDocsConversionCloud::DownloadFileRequest.new("converted/myFile.pdf", nil))
puts("Downloaded: " + response.length.to_s)
詳細は SDK README を参照してください。
さまざまな形式の間で文書を変換する
このコードはパスワードで保護された Word 文書を、出力オプション付きで PDF に変換します。
require 'groupdocs_conversion_cloud'
convert_api = GroupDocsConversionCloud::ConvertApi.from_keys("YourClientId", "YourClientSecret")
settings = GroupDocsConversionCloud::ConvertSettings.new
settings.file_path = "WordProcessing/password-protected.docx"
settings.format = "pdf"
settings.output_path = "converted"
load_options = GroupDocsConversionCloud::WordProcessingLoadOptions.new
load_options.password = "password"
convert_options = GroupDocsConversionCloud::PdfConvertOptions.new
convert_options.center_window = true
convert_options.compress_images = false
convert_options.display_doc_title = true
convert_options.dpi = 1024
convert_options.from_page = 1
convert_options.image_quality = 100
convert_options.password = "password"
convert_options.unembed_fonts = true
settings.load_options = load_options
settings.convert_options = convert_options
result = convert_api.convert_document(GroupDocsConversionCloud::ConvertDocumentRequest.new(settings))
puts("Document converted: " + result[0].url)
完全な例は ConvertToPdf.rb を参照してください。
文書の特定のページを変換する
この例はページ 1 と 3 だけを変換します。
require 'groupdocs_conversion_cloud'
convert_api = GroupDocsConversionCloud::ConvertApi.from_keys("YourClientId", "YourClientSecret")
settings = GroupDocsConversionCloud::ConvertSettings.new
settings.file_path = "WordProcessing/four-pages.docx"
settings.format = "pdf"
settings.output_path = "converted/two-pages.pdf"
convert_options = GroupDocsConversionCloud::PdfConvertOptions.new
convert_options.pages = [1, 3]
settings.convert_options = convert_options
result = convert_api.convert_document(GroupDocsConversionCloud::ConvertDocumentRequest.new(settings))
puts("Document converted: " + result[0].url)
完全な例は ConvertSpecificPages.rb を参照してください。
対応している変換形式を取得する
対応している変換元から変換先への変換を取得します。
require 'groupdocs_conversion_cloud'
info_api = GroupDocsConversionCloud::InfoApi.from_keys("YourClientId", "YourClientSecret")
result = info_api.get_supported_conversion_types(GroupDocsConversionCloud::GetSupportedConversionTypesRequest.new())
puts("Formats count: " + result.length.to_s)
完全な例は GetSupportedConversions.rb を参照してください。
GitHub のサンプル
GroupDocs.Conversion Cloud Ruby Examples リポジトリには、次を扱う実行可能なサンプルが含まれています。
| Category | Examples |
|---|
| Convert | PDF, HTML, 画像, プレゼンテーション, スプレッドシート, ワープロ, 直接変換, 非同期変換 |
| Common Options | 透かし, 特定のページ, 連続するページ, カスタムフォント |
| Load Options | CAD, CSV, メール, HTML, OneNote, PDF, プレゼンテーション, スプレッドシート, テキスト, ワープロ |
| Info | 対応している変換, 文書情報 |
サンプルの実行方法
- サンプルリポジトリ をクローンまたはダウンロードします
Examples/RunExamples.rb を編集し、client_id と client_secret を設定しますExamples ディレクトリに移動しますgem install groupdocs_conversion_cloud を実行しますruby RunExamples.rb を実行します
詳細は Getting Started を参照してください。

Document Conversion API | Ruby Cloud API | GroupDocs.Conversion Cloud | REST API | Document Conversion | Auto-detect Formats | Watermarking API | Multi-Format Output | Batch Document Conversion | PDF Conversion | Custom Conversion Options | Page-by-Page Conversion | Font Replacement | OCR Support | Metadata Extraction | Document Merge | Storage API | Document Information API | Document Load Options | Multi-Language Support | Cloud Storage Integration | SDKs for .NET, Java, Ruby | Secure API Access | Docker Support | Scalable Document Conversion | API Rate Limiting