The Word documents suna ko’ina, kuma ana amfani da su don dalilai daban-daban, gami da ƙirƙirar rahotanni, kwangila, da takaddun doka. Koyaya, akwai lokuta inda abubuwan da ke cikin takaddun Word ke buƙatar adana su azaman hotuna masu inganci don bugu, adanawa, ko rabawa. TIFF Tsarin ya fito azaman tsarin da aka fi so don hotuna masu inganci, yana ba da matsi mara asara da dacewa tare da dandamali daban-daban. A cikin wannan labarin, za mu bincika mahimmancin canza takaddun Kalma zuwa tsarin TIFF da samar da cikakkiyar jagora don canza Kalma zuwa TIFF ta amfani da NET Cloud SDK.
- Canjin Kalma zuwa TIFF Document API
- Canza Kalma zuwa TIFF a cikin C#
- DOC zuwa TIFF ta amfani da Umarnin CURL
Canjin Kalma zuwa TIFF Document API
Aspose.Words Cloud SDK don NET shine mafita mai ban mamaki don canza takaddun Kalma zuwa tsarin TIFF. API ɗin REST ne wanda ke ba ku damar ƙirƙira, gyara, da canza takaddun Kalma ta hanyar tsari. Yin amfani da wannan API, zaku iya sauya takaddun Kalma cikin sauƙi zuwa tsari iri-iri, gami da TIFF. SDK yana ba da sauƙi mai sauƙi da sauƙin amfani don yin hulɗa tare da Aspose.Words Cloud API, yana ba ku damar canza takardun Kalma zuwa tsarin TIFF tare da ƙananan layi na lamba.
Yanzu don amfani da SDK, da fatan za a bincika ‘Aspose.Words-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin Ƙara Kunshin don ƙara bayanin SDK a cikin aikin NET. Daga baya, shiga Cloud dashboard kuma sami takaddun shaidar abokin ciniki.
Canza Kalma zuwa TIFF a cikin C#
Za mu tattauna cikakkun bayanai kan yadda ake canza Kalma zuwa TIFF ta amfani da C# .NET. Da fatan za a duba snippet na lamba mai zuwa wanda ke ba ku damar yin jujjuya daftarin aiki Word zuwa TIFF.
// 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 = "7f098199230fc5f2175d494d48f2077c";
string clientID = "ee170169-ca49-49a4-87b7-0e2ff815ea6e";
// ƙ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);
// Sunan rubutun shigar da kalmar
string inputFile = "input-sample.docx";
// format na resultant fayil
string format = "TIFF";
// Sunan sakamakon TIFF
string resultant = "myOutput.tiff";
try
{
// loda fayil ɗin daga rumbun gida
using (var file = System.IO.File.OpenRead(inputFile))
{
// Ƙirƙiri buƙatar FileUpload
var fileRequest = new UploadFileRequest(inputStream,"sourceFile.docx");
// Loda fayil ɗin zuwa ma'ajiyar Cloud
wordsApi.UploadFile(fileRequest);
}
// ƙirƙiri DocumentWithFormatRequest abu na buƙatar
var response = new GetDocumentWithFormatRequest("sourceFile.docx", format: format, outPath: resultant);
// fara aikin daftarin aiki
wordsApi.GetDocumentWithFormat(response);
// buga saƙon nasara idan tuba ya yi nasara
if (response != null && response.Equals("OK"))
{
Console.WriteLine("Word to TIFF conversion completed successfully !");
Console.ReadKey();
}
}catch (Exception ex)
{
Console.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
Bari mu haɓaka fahimta game da guntun lambar juyawa.
var config = new Configuration { ClientId = clientID, ClientSecret = clientSecret };
var wordsApi = new WordsApi(config);
Ƙirƙiri wani abu na Kanfigareshan da misalin WordsApi inda ake amfani da takaddun shaidar abokin ciniki azaman muhawara.
// Create FileUpload request
var fileRequest = new UploadFileRequest(inputStream,"sourceFile.docx");
// Upload the file to Cloud storage
wordsApi.UploadFile(fileRequest);
Karanta takardar shigar da kalmar kuma loda zuwa ma’ajiyar gajimare.
var response = new GetDocumentWithFormatRequest("sourceFile.docx", format: format, outPath: resultant);
Ƙirƙiri misalin abu na GetDocumentWithFormat inda muke samar da sunan shigar da takaddun Kalma, tsarin sakamako kamar ‘TIFF’ da sunan sakamako na TIFF a matsayin muhawara.
wordsApi.GetDocumentWithFormat(response);
Yanzu, kira API don canza Kalma zuwa TIFF kuma adana fitarwa zuwa ajiyar girgije.
Idan muka tsallake gardamar waje, za a dawo da hoton TIFF sakamakon a rafi mai amsawa.
- Za a iya saukewa daftarin kalmar shigar da aka yi amfani da shi a cikin misalin da ke sama daga input-sample.docx.
- Sakamakon TIFF da aka samar kuma za’a iya bayyana shi daga myOutput.tiff.
DOC zuwa TIFF ta amfani da Umarnin CURL
Yana yiwuwa a canza takaddun Kalma zuwa tsarin TIFF ta amfani da umarnin cURL. Aspose.Words Cloud API yana ba da API REST mai sauƙi wanda za’a iya shiga ta amfani da umarnin cURL don canza takaddun Kalma zuwa tsarin TIFF. Kuna iya aika buƙatun HTTP zuwa ƙarshen ƙarshen API tare da madaidaitan ma’auni da bayanan tabbatarwa don canza takaddar Kalma zuwa tsarin TIFF.
Don haka, da farko muna buƙatar samar da alamar samun damar JWT (bisa ga shaidar abokin ciniki) yayin aiwatar da umarni mai zuwa:
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=ee170169-ca49-49a4-87b7-0e2ff815ea6e&client_secret=7f098199230fc5f2175d494d48f2077c" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Yanzu, Da fatan za a aiwatar da umarni mai zuwa, wanda ke loda daftarin aiki na Kalma daga ma’ajin gajimare kuma ya canza shi zuwa hoton TIFF. Sakamakon TIFF ana ajiye shi akan faifan gida.
curl -v "https://api.aspose.cloud/v4.0/words/{sourceFile}?format=tiff" \
-X GET \
-H "accept: application/octet-stream" \
-H "Authorization: Bearer {accessToken}" -o "{outputFile}"
Sauya
{sourceFile}
tare da sunan shigar da daftarin aiki da aka riga aka samu a cikin ma’ajiyar gajimare,{accessToken}
tare da alamar samun damar JWT da aka samar a sama da `{outputFile}’ tare da sunan sakamakon TIFF hoton da za a adana a cikin gida. .
Kammalawa
A ƙarshe, canza takaddun Kalma zuwa tsarin TIFF na iya zama kayan aiki mai mahimmanci don kiyaye amincin daftarin aiki da kuma tabbatar da dacewa a kan dandamali daban-daban. Kamar yadda muka gani, akwai hanyoyi da yawa don canza Kalma zuwa TIFF ta amfani da C# .NET, gami da amfani da Aspose.Words Cloud SDK don NET ko umarnin cURL. Ko kun zaɓi yin amfani da tushen girgijen REST API ko aiki tare da umarnin cURL, yana da mahimmanci ku fahimci nuances na kowace hanya kuma zaɓi mafi kyawun zaɓi don takamaiman yanayin amfanin ku. Don haka tare da waɗannan kayan aiki masu dacewa da ilimi, canza Kalma zuwa TIFF na iya zama tsari mai sauƙi kuma mai tasiri, yana ba ku hotuna masu inganci waɗanda suka dace da bukatun kasuwancin ku.
Hanyoyin haɗi masu amfani
- Shafin girmamawa na samfur
- [Takardun samfur 11
- API tunani
- Lambar tushen SDK
- Tallafin tallafin samfur
Labarai masu alaka
Da fatan za a ziyarci hanyoyin haɗin yanar gizon don ƙarin koyo game da: