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_parser_cloud

Требования
Зависимости
SDK требует следующие gems:
| Package | Constraint |
|---|
| addressable | ~> 2.8.0, >= 2.8.0 |
| faraday | ~> 0.14.0 |
Быстрый старт
Получите учетные данные API
Чтобы использовать GroupDocs.Parser Cloud, зарегистрируйтесь на GroupDocs.Cloud Dashboard и получите Client ID и Client Secret.
Инициализируйте API
Используйте следующий код, чтобы начать использовать GroupDocs.Parser Cloud SDK for Ruby.
require 'groupdocs_parser_cloud'
# Get your app_sid and app_key at https://dashboard.groupdocs.cloud
app_sid = "YourClientId"
app_key = "YourClientSecret"
config = GroupDocsParserCloud::Configuration.new(app_sid, app_key)
config.api_base_url = "https://api.groupdocs.cloud"
parseApi = GroupDocsParserCloud::ParseApi.from_config(config)
Полный пример см. в RunExamples.rb.
Извлечь текст из документа
После инициализации используйте этот базовый пример, чтобы извлечь текст из целого документа в облачном хранилище.
require 'groupdocs_parser_cloud'
app_sid = "YourClientId"
app_key = "YourClientSecret"
config = GroupDocsParserCloud::Configuration.new(app_sid, app_key)
config.api_base_url = "https://api.groupdocs.cloud"
parseApi = GroupDocsParserCloud::ParseApi.from_config(config)
options = GroupDocsParserCloud::TextOptions.new
options.file_info = GroupDocsParserCloud::FileInfo.new
options.file_info.file_path = "email/eml/embedded-image-and-attachment.eml"
request = GroupDocsParserCloud::TextRequest.new(options)
response = parseApi.text(request)
puts("Text: " + response.text)
Полный пример см. в ExtractTextFromTheWholeDocument.rb.
Извлечь изображения из документа
Этот пример извлекает каждое изображение из презентации.
require 'groupdocs_parser_cloud'
app_sid = "YourClientId"
app_key = "YourClientSecret"
config = GroupDocsParserCloud::Configuration.new(app_sid, app_key)
config.api_base_url = "https://api.groupdocs.cloud"
parseApi = GroupDocsParserCloud::ParseApi.from_config(config)
options = GroupDocsParserCloud::ImagesOptions.new
options.file_info = GroupDocsParserCloud::FileInfo.new
options.file_info.file_path = "slides/three-slides.pptx"
request = GroupDocsParserCloud::ImagesRequest.new(options)
response = parseApi.images(request)
response.images.each do |image|
puts("Image path in storage: " + image.path + ". Download url: " + image.download_url)
puts("Image format: " + image.file_format + ". Page index: " + image.page_index.to_s)
end
Полный пример см. в ExtractImagesFromTheWholeDocument.rb.
Разобрать документ по сохраненному шаблону
Этот пример разбирает документ Word по шаблону, хранящемуся в облачном хранилище. Полный пример создает templates/companies.json, если этого файла нет.
require 'groupdocs_parser_cloud'
app_sid = "YourClientId"
app_key = "YourClientSecret"
config = GroupDocsParserCloud::Configuration.new(app_sid, app_key)
config.api_base_url = "https://api.groupdocs.cloud"
parseApi = GroupDocsParserCloud::ParseApi.from_config(config)
options = GroupDocsParserCloud::ParseOptions.new
options.file_info = GroupDocsParserCloud::FileInfo.new
options.file_info.file_path = "words-processing/docx/companies.docx"
options.template_path = "templates/companies.json"
request = GroupDocsParserCloud::ParseRequest.new(options)
response = parseApi.parse(request)
response.fields_data.each do |data|
unless data.page_area.page_text_area.nil?
puts("Field name: " + data.name + ". Text :" + data.page_area.page_text_area.text)
end
end
Полный пример см. в ParseByTemplateStoredInUserStorage.rb.
Получить поддерживаемые форматы разбора
Получите форматы документов, которые API может разбирать.
require 'groupdocs_parser_cloud'
app_sid = "YourClientId"
app_key = "YourClientSecret"
config = GroupDocsParserCloud::Configuration.new(app_sid, app_key)
config.api_base_url = "https://api.groupdocs.cloud"
infoApi = GroupDocsParserCloud::InfoApi.from_config(config)
result = infoApi.get_supported_file_formats()
puts("Formats count: " + result.formats.length.to_s)
Полный пример см. в GetSupportedFormats.rb.
Примеры на GitHub
Репозиторий GroupDocs.Parser Cloud Ruby Examples содержит готовые к запуску примеры:
| Category | Examples |
|---|
| Parse | Текст, форматированный текст, изображения, штрихкоды, разбор по шаблону, разбор с помощью ИИ |
| Info | Сведения о документе, элементы контейнера, поддерживаемые форматы |
| Templates | Создание или обновление, получение и удаление шаблона |
Как запустить примеры
- Клонируйте или скачайте репозиторий примеров
- Отредактируйте
Examples/RunExamples.rb и задайте app_sid и app_key - Перейдите в каталог
Examples - Выполните
gem install groupdocs_parser_cloud - Выполните
ruby RunExamples.rb
Подробности см. в разделе Getting Started.

Document Data Extraction | Ruby Cloud API | GroupDocs.Parser Cloud | REST API | Text Extraction | Image Extraction | Template Parsing | Data Parsing | Document Information | Container Files | Cloud Storage Integration | File Operations | Folder Operations | Secure API Access | Document Parsing | Metadata Extraction | PDF Parsing | ZIP Files | PST/OST Files | Cross-platform API | Document Processing | Data Extraction API