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_editor_cloud

Gem Version Gem Total Downloads Ruby-GroupDocsCloud


Anforderungen

Abhängigkeiten

Das SDK benötigt die folgenden Gems:

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

Schnellstart

API-Anmeldeinformationen erhalten

Um GroupDocs.Editor 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.Editor Cloud SDK for Ruby zu nutzen.

require 'groupdocs_editor_cloud'

# Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsEditorCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

editApi = GroupDocsEditorCloud::EditApi.from_config(config)

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

Ein Textverarbeitungsdokument bearbeiten

Nach der Initialisierung laden Sie mit diesem grundlegenden Beispiel ein kennwortgeschütztes Dokument, ändern dessen HTML und speichern es wieder als DOCX.

require 'groupdocs_editor_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsEditorCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

fileApi = GroupDocsEditorCloud::FileApi.from_config(config)
editApi = GroupDocsEditorCloud::EditApi.from_config(config)

fileInfo = GroupDocsEditorCloud::FileInfo.new
fileInfo.file_path = 'WordProcessing/password-protected.docx'
fileInfo.password = 'password'

loadOptions = GroupDocsEditorCloud::WordProcessingLoadOptions.new
loadOptions.file_info = fileInfo
loadOptions.output_path = "output"

loadRequest = GroupDocsEditorCloud::LoadRequest.new(loadOptions)
loadResult = editApi.load(loadRequest)

htmlFile = fileApi.download_file(GroupDocsEditorCloud::DownloadFileRequest.new loadResult.html_path)
htmlFile.open
html = htmlFile.read
htmlFile.close

html = html.gsub("Sample test text", "Hello world")

htmlFile = File.open(htmlFile.path, "w")
htmlFile.write(html)
htmlFile.close
uploadRequest = GroupDocsEditorCloud::UploadFileRequest.new loadResult.html_path, File.open(htmlFile.path, "r")
fileApi.upload_file(uploadRequest)

saveOptions = GroupDocsEditorCloud::WordProcessingSaveOptions.new
saveOptions.file_info = fileInfo
saveOptions.output_path = "output/edited.docx"
saveOptions.html_path = loadResult.html_path
saveOptions.resources_path = loadResult.resources_path

saveRequest = GroupDocsEditorCloud::SaveRequest.new(saveOptions)
saveResult = editApi.save(saveRequest)

puts("Document edited: " + saveResult.path)

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

Eine Tabelle bearbeiten

Dieses Beispiel lädt das erste Arbeitsblatt, bearbeitet das HTML und speichert es wieder als XLSX.

require 'groupdocs_editor_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsEditorCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

fileApi = GroupDocsEditorCloud::FileApi.from_config(config)
editApi = GroupDocsEditorCloud::EditApi.from_config(config)

fileInfo = GroupDocsEditorCloud::FileInfo.new
fileInfo.file_path = 'Spreadsheet/four-sheets.xlsx'

loadOptions = GroupDocsEditorCloud::SpreadsheetLoadOptions.new
loadOptions.file_info = fileInfo
loadOptions.output_path = "output"
loadOptions.worksheet_index = 0

loadRequest = GroupDocsEditorCloud::LoadRequest.new(loadOptions)
loadResult = editApi.load(loadRequest)

htmlFile = fileApi.download_file(GroupDocsEditorCloud::DownloadFileRequest.new loadResult.html_path)
htmlFile.open
html = htmlFile.read
htmlFile.close

html = html.gsub("This is sample sheet", "This is sample sheep")

htmlFile = File.open(htmlFile.path, "w")
htmlFile.write(html)
htmlFile.close
uploadRequest = GroupDocsEditorCloud::UploadFileRequest.new loadResult.html_path, File.open(htmlFile.path, "r")
fileApi.upload_file(uploadRequest)

saveOptions = GroupDocsEditorCloud::SpreadsheetSaveOptions.new
saveOptions.file_info = fileInfo
saveOptions.output_path = "output/edited.xlsx"
saveOptions.html_path = loadResult.html_path
saveOptions.resources_path = loadResult.resources_path

saveRequest = GroupDocsEditorCloud::SaveRequest.new(saveOptions)
saveResult = editApi.save(saveRequest)

puts("Document edited: " + saveResult.path)

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

Dokumentinformationen abrufen

Dieses Beispiel liest die Seitenzahl eines kennwortgeschützten Dokuments.

require 'groupdocs_editor_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsEditorCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

infoApi = GroupDocsEditorCloud::InfoApi.from_config(config)
fileInfo = GroupDocsEditorCloud::FileInfo.new
fileInfo.file_path = 'WordProcessing/password-protected.docx'
fileInfo.password = 'password'
request = GroupDocsEditorCloud::GetInfoRequest.new(fileInfo)
response = infoApi.get_info(request)
puts("Pages count = " + response.page_count.to_s)

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

Unterstützte Editor-Formate abrufen

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

require 'groupdocs_editor_cloud'

client_id = "YourClientId"
client_secret = "YourClientSecret"

config = GroupDocsEditorCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"

infoApi = GroupDocsEditorCloud::InfoApi.from_config(config)
result = infoApi.get_supported_file_formats()
result.formats.each do |format|
    puts(format.file_format)
end

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

Beispiele auf GitHub

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

CategoryExamples
Edit OperationsTextverarbeitung, Tabellen, Präsentationen, Text und Dateien mit Trennzeichen
InfoDokumentinformationen, Lizenzverbrauch, unterstützte Dateitypen

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_editor_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 Editing API | Ruby Cloud API | GroupDocs.Editor Cloud | REST API | Word Processing Formats | Spreadsheet Formats | Presentation Formats | Text Formats | CSV Files | DOCX Documents | XLSX Documents | PPTX Presentations | Password-Protected Files | Cloud Storage Integration | Document Info Retrieval | File Operations | WYSIWYG Editing | Multi-Platform Support | Secure API Access | HTML Editing | Cross-platform API



 Deutsch