Jelajahi Produk kami

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

Instalasi

Paket tersedia di rubygems.org dan dapat diinstal melalui gem dengan menjalankan perintah berikut:

gem install groupdocs_editor_cloud

Gem Version Gem Total Downloads Ruby-GroupDocsCloud


Persyaratan

Dependensi

SDK memerlukan gem berikut:

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

Mulai cepat

Dapatkan kredensial API Anda

Untuk menggunakan GroupDocs.Editor Cloud, daftar di GroupDocs.Cloud Dashboard dan dapatkan Client ID dan Client Secret Anda.

Inisialisasi API

Gunakan kode berikut untuk mulai menggunakan GroupDocs.Editor Cloud SDK for Ruby.

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)

Lihat contoh lengkap di RunExamples.rb.

Edit dokumen pemrosesan kata

Setelah diinisialisasi, gunakan contoh dasar ini untuk memuat dokumen yang dilindungi kata sandi, mengubah HTML-nya, dan menyimpannya kembali ke 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)

Lihat contoh lengkap di EditWordProcessingDocument.rb.

Edit lembar bentang

Contoh ini memuat lembar kerja pertama, mengedit HTML, dan menyimpannya kembali ke 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)

Lihat contoh lengkap di EditSpreadsheetDocument.rb.

Dapatkan informasi dokumen

Contoh ini membaca jumlah halaman dokumen yang dilindungi kata sandi.

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)

Lihat contoh lengkap di GetDocumentInformation.rb.

Dapatkan format editor yang didukung

Ambil format dokumen yang dapat diedit oleh API.

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

Lihat contoh lengkap di GetSupportedFileTypes.rb.

Contoh di GitHub

Repositori GroupDocs.Editor Cloud Ruby Examples berisi contoh siap dijalankan yang mencakup:

CategoryExamples
Edit OperationsPemrosesan kata, lembar bentang, presentasi, teks, dan file berpembatas
InfoInformasi dokumen, konsumsi lisensi, jenis file yang didukung

Cara menjalankan contoh

  1. Klon atau unduh repositori contoh
  2. Edit Examples/RunExamples.rb dan atur client_id serta client_secret
  3. Buka direktori Examples
  4. Jalankan gem install groupdocs_editor_cloud
  5. Jalankan ruby RunExamples.rb

Untuk detail selengkapnya, kunjungi 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



 Indonesia