Canza Takardun Kalma zuwa Hotunan TIFF Amfani da Ruby.

Yadda ake Canza Kalma zuwa TIFF – Doc Online zuwa TiFF Converter

Yadda ake canza Kalma zuwa TIFF - Docx akan layi kyauta zuwa mai canza TIFF

Dubawa

Tsarin daftarin aiki na Microsoft Word (DOCX, DOC) yana da fa’idodi da yawa yayin da yake ba da gyare-gyare, dacewa, haɗin gwiwa, damar tsarawa, sauƙin amfani & haɓakawa, yana sa ya zama sanannen zaɓi don ayyukan sarrafa takardu. . A haƙiƙa, tsarin daftarin aiki na Word wata hanya ce mai mahimmanci ga kasuwanci da ƙungiyoyi waɗanda ke buƙatar ƙirƙira, gyara, da raba takardu. Koyaya, TIFF (Tagged Tsarin Fayil na Hoto) sigar da aka yi amfani da ita sosai don adana hotunan raster, gami da hotuna da takaddun leka. Ɗaya daga cikin manyan dalilan TIFF shine samar da tsari mai sassauƙa da ƙarfi don musanyawa da adana hotuna masu inganci. Matsi mara hasara, inganci mai kyau, iyawa, adana bayanai na dogon lokaci da aiki tare suna daga cikin fitattun fa’idodinsa.

Don haka, canza takaddun Kalma zuwa hotunan TIFF yana ba da fa’idodi da yawa, gami da adana hoto, dacewa, sauƙin bugawa da magudi, adana takardu, da ajiyar sarari.

Menene Canjin API zuwa Kalma zuwa TIFF?

Aspose.Words Cloud shine tsarin sarrafa daftarin aiki na tushen girgije wanda ke ba da damar ƙirƙira, gyara, da canza takardu a cikin gajimare. API ɗin yana goyan bayan tsarin fayil da yawa, gami da Microsoft Word (DOC, DOCX), PDF, HTML, da ƙari. Hakazalika, yana da ikon canza kalmar DOCX zuwa hotuna TIFF, yayin da yake tabbatar da matsi mara asara & ingancin hoto, saboda yana sa su dace don buga hotuna.

Yadda ake Sanya Ruby Cloud SDK

Da zarar an daidaita lokacin aikin ruby, mataki na farko a cikin amfani da SDK shine shigarwa. Akwai don saukewa akan RubyGem (an shawarta) da GitHub. Amma, kafin mu ci gaba da shigarwar SDK, muna buƙatar shigar da fakitin dogaro masu zuwa akan tsarin mu.

# Following are the runtime dependencies to setup aspose_words_cloud
faraday 1.4.3 >= 1.4.1
marcel 1.0.1 >= 1.0.0
multipart-parser 0.1.1 >= 0.1.1
# Development dependencies is
minitest 5.14.4 ~> 5.11, >= 5.11.3

Yanzu, da fatan za a aiwatar da umarni mai zuwa a cikin tashar don yin saurin shigarwa na asposewordscloud gem.

gem 'aspose_words_cloud', '~> 22.3'
# or install directly
gem install aspose_words_cloud

Yanzu muhimmin mataki na gaba shine samun ClientID da cikakkun bayanan ClientSecret ta ziyartar Aspose.Cloud dashboard. Idan baku da asusu mai wanzuwa, kawai kuyi rajista ta amfani da hanyar haɗin ƙirƙiri sabon asusu kuma samar da ingantaccen adireshin imel. Yanzu, muna da kyau mu fara da Kalma zuwa TIFF aikin juyawa.

Canjin Kalma zuwa TIFF a cikin Ruby

Sashe na gaba yana bayanin matakan yadda ake canza Kalma zuwa TIFF a cikin aikace-aikacen ruby.

  1. Mataki na farko shine ƙirƙirar sauye-sauyen ruby mai riƙe ClientID da cikakkun bayanan ClientSecret (kamar yadda aka ambata akan Aspose Cloud Dashboard).
  2. Abu na biyu, ƙirƙiri abin sanyi na AsposeWordsCloud kuma wuce ClientID, ClientSecret cikakkun bayanai azaman mahawara.
  3. Mataki na uku shine ƙirƙirar misali na ajin WordsAPI
  4. Yanzu muna buƙatar loda shigar da takaddar Kalma zuwa ma’ajiyar gajimare ta amfani da hanyar UploadFileRequest().
  5. A ƙarshe, canza DOCX zuwa hoton TIFF ta amfani da hanyar saveastiff (..) wanda ke ɗaukar abu na SaveAsTiffRequest azaman hujja.
# Load da gem ɗin, Don cikakken jeri don Allah ziyarci https://github.com/aspose-words-cloud/aspose-words-cloud-ruby
require 'aspose_words_cloud'
# Yadda ake canza Word zuwa TIFF da shirye-shirye.
# Samu takaddun shaidar AppKey da AppSID daga https://dashboard.aspose.cloud/applications
@AppSID = "###-######-####-####-##########"
@AppKey = "###############################"
# Haɗa kaddarorin Kanfigareshan tare da WordsApi
AsposeWordsCloud.configure do |config|
config.client_data['ClientId'] = @AppSID
config.client_data['ClientSecret'] = @AppKey
end
# Ƙirƙiri misali na WordsApi
@words_api = WordsAPI.new
# Shigar da fayil ɗin Word
@fileName = "sample.docx"
# Tsarin fayil na ƙarshe
@format = "tiff"
@destName = "word-to-tiff.tiff"
# Loda daftarin aiki na asali zuwa Ma'ajiyar girgije
@words_api.upload_file UploadFileRequest.new(File.new(@fileName, 'rb'), @fileName, nil)
@save_options = TiffSaveOptionsData.new(
{
:SaveFormat => @format,
:FileName => @destName
})
# Ajiye sigogin buƙatun daftarin aiki.
@request = SaveAsTiffRequest.new(@fileName, @save_options, nil, nil, nil, nil, nil)
@out_result = @words_api.save_as_tiff(@request)
# Buga martanin sakamako a cikin na'ura wasan bidiyo
puts(“Word successfully converted to TIFF file” + (@out_result).to_s )
# Ƙarshen misalin fassarar Kalma.

Da zarar an yi nasarar aiwatar da lambar, za a adana sakamakon word-to-tiff.tiff a cikin ma’ajiyar gajimare.

DOC zuwa TIFF ta amfani da Umarnin CURL

Canjin DOC zuwa TIFF ta amfani da umarnin cURL yana ba ku damar canza takaddun Microsoft Word (DOC, DOCX) zuwa hotunan TIFF. Ana yin wannan jujjuyawar ta yin buƙatun API zuwa Aspose.Words Cloud, ta amfani da umarnin cURL. API ɗin yana karɓar fayil ɗin DOC ko DOCX azaman shigarwa kuma yana mayar da sakamakon TIFF. Kamar yadda za’a iya aiwatar da umarnin CURL daga tashar layin umarni, yana ba da damar sarrafa cikakken tsarin jujjuyawa. Hakanan, umarnin cURL da aka yi amfani da su don jujjuyawar za su bambanta dangane da takamaiman API ɗin da ake amfani da su, amma yawanci ya haɗa da aika buƙatun HTTP zuwa API tare da takaddar shigarwa da sauran sigogi masu mahimmanci, da karɓar sakamakon TIFF a cikin martani.

Yanzu, a matsayin abin da ake buƙata don wannan hanyar, muna buƙatar fara samar da alamar JWT bisa ga keɓaɓɓen shaidar abokin cinikinmu.

curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bbf94a2c-6d7e-4020-b4d2-b9809741374e&client_secret=1c9379bb7d701c26cc87e741a29987bb" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Da zarar an ƙirƙiri alamar, da fatan za a yi amfani da umarni mai zuwa don canza DOC zuwa hoton TIFF. Lura, wannan umarni yana tsammanin shigar da Kalma (DOC) ya riga ya kasance a cikin ma’ajiyar gajimare. Bayan nasarar nasarar nasarar, ana kuma adana sakamakon TIFF a cikin ma’ajiyar girgije.

curl -v -X GET "https://api.aspose.cloud/v4.0/words/input.doc?format=TIFF&outPath=converted.tiff" \
-H  "accept: application/octet-stream" \
-H  "Authorization: Bearer <JWT Token>"

NOTE: - Neman Kalma ta kan layi zuwa mai canza TIFF? Da fatan za a gwada amfani da mu Free Online Converter

Kammalawa

A cikin wannan labarin, mun tattauna cikakkun bayanai game da canza takaddun Kalma zuwa hotuna TIFF, saboda buƙatu ce ta gama gari daga kasuwanci da ƙungiyoyi waɗanda ke aiki tare da babban adadin takardu. Ta hanyar yin amfani da ikon Ruby da kuma sassauci na Aspose.Words Cloud, ya zama mai yiwuwa don sarrafa duk tsarin jujjuyawar. Wannan a ƙarshe yana rage lokaci da ƙoƙarin da ake buƙata don canza manyan kundin takardu.

Don ƙarin kayan aiki masu amfani da mu, ana buga cikakkiyar lambar tushe ta Ruby Cloud SDK akan majiya ta GitHub. Hakanan, muna ba da shawarar bincika jagorar mai haɓakawa don koyo game da wasu abubuwan ban sha’awa na API. Bugu da ƙari, kuna iya yin la’akari da amfani da API ta hanyar SwaggerUI Interface kai tsaye a cikin mai binciken gidan yanar gizo.

A ƙarshe, idan kuna da tambayoyi ko shawarwari, da fatan za ku ji daɗin tuntuɓar mu ta tallafin samfuran mu na kyauta 13.

Maudu’ai masu dangantaka

Muna ba da shawarar ziyartar hanyoyin haɗin yanar gizo masu zuwa don koyo game da: