Gunakake perpustakaan Ruby kanggo nggabungake HTML menyang gambar liwat REST API. Gabungke loro utawa luwih HTML berkas dadi siji berkas gambar nganggo Ruby.
Gabung HTML file kanthi gampang lan ekspor asil menyang format grafis ing Ruby kode. Pustaka Ruby iki dirancang kanggo nggabungake pirang-pirang HTML file dadi siji gambar kanthi nggunakake REST API, yaiku kanthi ngirim telpon HTTPS liwat Internet.
Iki minangka solusi gabungan HTML to Image profesional, Cloud-native sing nyedhiyakake programer Ruby kanthi keluwesan pangembangan lan fitur sing kuat. Kanthi nggabungake file, sampeyan bisa ngotomatisasi alur kerja HTML/Gambar digital lan mbukak sawetara bagean rutin proses kasebut menyang piranti lunak Ruby pangolahan HTML sing cepet lan efisien.
Sampeyan bisa uga kudu nggabungake HTML file dadi siji gambar ing pirang-pirang kasus. Contone, sampeyan bisa uga pengin nggabungake macem-macem HTML file bebarengan sadurunge nyetak utawa arsip.
Penggabungan HTML bisa dadi bagean saka pendekatan pangolahan dokumen terpadu kanggo ngasilake gambar saka sumber data sing beda. tugas kuwi ndherek nggunakake HTML lengkap / Gambar manipulasi Ruby perpustakaan sing bakal proses pesawat saka HTML file lan gabungke bebarengan ing wektu paling cendhak, mrodhuksi output grafis kompak lan akurat.
Kanggo nindakake gabungan HTML kanggo-Gambar ing Ruby, sampeyan butuh paling ora rong HTML file sumber. Kanggo miwiti kanthi cepet, priksa conto Ruby kode ing ngisor iki.
require 'aspose_words_cloud'
AsposeWordsCloud.configure do |config|
config.client_data['ClientId'] = '####-####-####-####-####'
config.client_data['ClientSecret'] = '##################'
end
@words_api = WordsAPI.new
document = File.open('Input1.html')
mergeProps = DocumentEntry.new({
:FileReference => AsposeWordsCloud::FileReference.fromRemoteFilePath('Input2.html'),
:ImportFormatMode => 'KeepSourceFormatting'})
document_entries = [mergeProps]
document_list = DocumentEntryList.new({:DocumentEntries => document_entries})
append_document_online = AppendDocumentOnlineRequest.new(document: document,
document_list: document_list)
merged_docs = @words_api.append_document_online(append_document_online)
split_document_online = SplitDocumentOnlineRequest.new(document: merged_docs,
format: 'jpg', zip_output: true)
@words_api.split_document_online(split_document_online)
Instal Aspose.Words Cloud SDK for Ruby nggunakake layanan hosting RubyGems. gem install aspose_words_cloud kanggo nginstal paket kasebut. Minangka alternatif, sampeyan bisa kanthi manual kloning Aspose.Words Cloud SDK for Ruby saka GitHub lan nggunakake ing project. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.
Ruby 2.6 utawa luwih anyar
Deleng Repository Documentation kanggo ndeleng rincian.
Sampeyan bisa nggunakake format populer liyane: