kalma zuwa tiff

Maida Kalma zuwa hoton TIFF tare da NET REST API.

A cikin zamani na dijital wanda ke bunƙasa akan haɓakawa da samun dama, canza Takardun Magana zuwa TIFF /) hotuna sun zama masu mahimmanci. TIFF, tsarin hoto da aka yi amfani da shi sosai, yana ba da kyakkyawan haske da inganci, yana mai da shi dacewa da ƙwararru daban-daban da dalilai na kayan tarihi. Canza takaddun Kalma zuwa TIFF yana ba da damar haɗakar da abun ciki na rubutu, sigogi, zane-zane, da ƙari cikin aikace-aikacen tushen hoto da gabatarwa. A cikin wannan labarin, za mu bincika matakai don juyawa Kalma zuwa TIFF ta amfani da NET REST API.

API ɗin REST don Canjawar Kalma zuwa TIFF

Shiga cikin tafiya na canjin daftarin aiki tare da Aspose.Words Cloud SDK don .NET, inda canza takaddun Kalma zuwa TIFF yana ɗaya daga cikin iyawarsa. Wannan SDK mai ƙarfi yana sauƙaƙa tsarin jujjuya yayin ƙara ƙarfinsa zuwa ɗimbin ayyuka masu alaƙa da takardu. Daga salo da tsara takaddun zuwa cire abun ciki da sarrafa bita, yana ba ku damar samun iko mara misaltuwa akan takaddun su.

Kawai bincika ‘Aspose.Words-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin ‘Ƙara Kunshin’. Wannan zai ƙara bayanin SDK a cikin aikace-aikacen NET ɗin ku. Yanzu, kuna buƙatar ziyartar dashboard ɗin Cloud, don samun keɓaɓɓen shaidar abokin ciniki.

Kalma zuwa TIFF a cikin C# .NET

Wannan sashe yana bayyana matakai da cikakkun bayanai game da yadda ake canza kalmar zuwa hoton TIFF ta amfani da C# .NET.

// Don cikakkun misalai da fayilolin bayanai, da fatan za a je zuwa 
https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet

// Samu bayanan abokin ciniki daga https://dashboard.aspose.cloud/
string clientSecret = "4d84d5f6584160cbd91dba1fe145db14";
string clientID = "bb959721-5780-4be6-be35-ff5c3a6aa4a2";

// ƙirƙiri abin daidaitawa ta amfani da ClinetID da bayanan Sirrin Abokin ciniki
var config = new Aspose.Words.Cloud.Sdk.Configuration { ClientId = clientID, ClientSecret = clientSecret };
// fara misali WordsApi
var wordsApi = new WordsApi(config);

// ƙirƙirar wani abu na TiffSaveOptionsData
TiffSaveOptionsData requestSaveOptions = new TiffSaveOptionsData();
// saka sunan fitowar hoton TIFF da za a adana a ma'ajiyar gajimare
requestSaveOptions.FileName = "Resultant.tiff";

// binarization sakamako dabi'u
String tiffBinarizationMethod = "FloydSteinbergDithering";
String dmlEffectsRenderingMode = "Simplified";

// Fihirisar rubutun shafi da ƙidaya adadin shafuka daga takaddar kalmar da za a canza
int pageCount = 1;
int pageIndex = 1;

// Ƙirƙiri abu na SaveAsTiff inda muke ayyana tushen fayil ɗin Kalma don lodawa daga ma'ajiyar girgije
// adadin shafukan da za a canza da fara fihirisar shafuka. Ana yiwa ma'auni na zaɓin alamar banza
SaveAsTiffRequest saveRequest = new SaveAsTiffRequest(
"test_result.docxs",
requestSaveOptions,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
pageCount,
pageIndex,
null,
null,
null,
null,
null,
null,
dmlEffectsRenderingMode,
tiffBinarizationMethod,
null,
null);

// kira API don fara aiwatar da canjin DOC zuwa TIFF
wordsApi.SaveAsTiff(saveRequest);

Bari mu bincika cikakkun bayanai game da snippet code da aka bayyana a sama.

var config = new Configuration { ClientId = clientID, ClientSecret = clientSecret };
WordsApi wordsApi = new WordsApi(config);

Da farko, muna buƙatar ƙirƙirar misali na ajin ‘WordsApi’ yayin ƙaddamar da bayanan abokin ciniki azaman mahawara.

TiffSaveOptionsData requestSaveOptions = new TiffSaveOptionsData();

Ƙirƙiri wani abu na ajin TiffSaveOptions inda muka ayyana sunan sakamakon sakamakon hoton TIFF.

SaveAsTiffRequest saveRequest = new SaveAsTiffRequest(...)

Ƙirƙiri wani abu na aji na SaveAsTiffRequest inda muka wuce sunan shigarwar daftarin aiki Word, saveTIff buƙatun, sakamakon sunan fayil sauran mahimman bayanai azaman hujjar shigarwa.

wordsApi.SaveAsTiff(saveRequest);

A ƙarshe, kira API don fara Kalma zuwa TIFF aikin canza fayil.

Canjin DOC zuwa TIFF ta amfani da Umarnin CURL

Shiga cikin daular Kalma maras kyau zuwa canjin TIFF ta amfani da haɗin kai mai ƙarfi na Aspose.Words Cloud da umarnin cURL. Wannan tsari mai ƙarfi yana sauƙaƙe tsarin canji, kuma yana ba da takaddun Kalma mara ƙarfi zuwa canza hotuna masu inganci na TIFF. Ta amfani da umarnin cURL, zaku iya tsara jujjuya kai tsaye daga tashar, da kuma daidaita tsarin cikin yanayin layin umarni.

Lokacin bin wannan hanyar, mataki na farko a wannan hanyar shine samar da alamar samun damar JWT ta aiwatar da umarni mai zuwa:

curl -v "https://api.aspose.cloud/connect/token" \
 -X POST \
 -d "grant_type=client_credentials&client_id=657e7b18-bbdb-4ab1-bf0a-62314331eec9&client_secret=c3bdccf30cae3625ecaa26700787e172" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Accept: application/json"

Da zarar muna da alamar JWT, da fatan za a aiwatar da umarni mai zuwa don canza HTML zuwa tsarin DOCX.

curl -v "https://api.aspose.cloud/v4.0/words/{sourceDOC}/saveAs/tiff" \
-X PUT \
-H "Authorization: Bearer {accessToken}" \
-H "Content-Type: application/json" \
-d "{ \"SaveFormat\": \"tiff\", \"FileName\": \"finaloutput.tiff\" }" 

Kawai maye gurbin ‘sourceDOC’ tare da sunan shigarwar Word DOC da aka rigaya akwai a cikin ma’ajiyar girgije, da ‘accessToken’ tare da alamar samun damar JWT da aka samar a sama.

Kammalawa

A ƙarshe, jujjuyawar takaddun Kalma zuwa hotuna TIFF abu ne mai mahimmanci a cikin ingantaccen sarrafa takardu. Bugu da ƙari, ta hanyar canza takaddun Kalma zuwa hotuna TIFF, kuna buɗe sabbin damar don wakilcin gani da rabawa, haɓaka aikin daftarin aiki a cikin yanayin dijital. Don haka ko dai ku yi amfani da haɗin Aspose.Words Cloud da umarnin cURL waɗanda ke ba da tsari mai sauƙi kuma mai sauƙi don cimma wannan canji ta hanyar layin umarni, ko kuma ku gwada amfani da Aspose.Words Cloud SDK don NET, wanda ke ba da ƙarin cikakkun bayanai. aiki ayyuka.

Hanyoyin haɗi masu amfani

Labarai masu alaka

Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: