da doc

Maida ODT zuwa DOC tare da NET REST API.

Ikon canza fayilolin [ODT] (https://docs.fileformat.com/word-processing/odt/) zuwa [DOC] (https://docs.fileformat.com/word-processing/doc/) tsari amfani da .NET REST API ya zama kayan aiki mai mahimmanci ga kasuwanci, ƙwararru, da masu ƙirƙirar abun ciki. Ko kai marubuci ne da ke son raba aikinka a kan dandamali daban-daban, ƙwararren ƙwararren kasuwanci yana buƙatar yin haɗin gwiwa tare da abokan aiki ta amfani da software iri-iri, ko mai haɓaka daftarin aiki mai gudana, fa’idodin sarrafa ODT zuwa tsarin jujjuya DOC a bayyane yake.

Wannan labarin ya zurfafa cikin mahimmancin rawar ODT zuwa juyar da DOC, yana nuna wajibcin wannan fasalin tare da bayyana fa’idodin da yake kawowa ga masana’antu daban-daban.

API ɗin REST don ODT zuwa Canjin Kalma DOC

Yin amfani da damar Aspose.Words Cloud don .NET, tsarin canza fayilolin ODT zuwa tsarin DOC ya zama aiki mai inganci kuma maras kyau. Siffofin sa masu ƙarfi suna ba da kayan aiki mai ƙarfi wanda ke ba ku ikon yin jujjuyawar ODT zuwa DOC ba tare da wahala ba, tabbatar da cewa takaddun ODT suna riƙe tsarinsu, salo, da amincin abun ciki yayin da suke canzawa cikin sauƙi zuwa fayilolin DOC goge.

Bugu da ƙari, wannan tsarin tushen girgije yana sauƙaƙe tsarin jujjuyawar, yana ba ku damar mai da hankali kan abun ciki maimakon ƙwarewar fasaha. Yanzu, don amfani da SDK, kawai bincika ‘Aspose.Words-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin ‘Ƙara Kunshin’. Bugu da ƙari, da fatan za a ziyarci cloud dashboard kuma sami keɓaɓɓen takaddun shaidar abokin ciniki.

Maida ODT zuwa DOC tare da C# .NET

Wannan sashe yana ba da cikakkun bayanai da snippet lambar da ke da alaƙa don yin juzu’in juzu’i na ODT zuwa tsarin DOC.

// 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);

// Shigar da sunan fayil na PDF
String inputFile = "test_multi_pages.odt";

// resultant fayil format
String format = "DOC";

String resultant = "converted.doc";

// loda abun ciki na shigar da fayil ODT don yawo misali
var sourceFile = System.IO.File.OpenRead(inputFile);

 // ƙirƙirar DocumentWithFormat abu nema
 var response = new GetDocumentWithFormatRequest(inputFile, 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 JPG conversion successful !");
    Console.ReadKey();
}
odt zuwa doc preview

Duban ODT zuwa DOC akan layi.

Yanzu, bari mu bincika wasu cikakkun bayanai na snippet code na sama.

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

Ƙirƙiri misali na ajin WordsApi inda muke ƙaddamar da shaidar abokin ciniki azaman muhawara.

var sourceFile = System.IO.File.OpenRead(inputFile);

Load da abun ciki na shigar da fayil ODT don yawo misali.

 var response = new GetDocumentWithFormatRequest(inputFile, format, outPath: resultant);

Ƙirƙiri wani abu na buƙatun jujjuya daftarin aiki inda muka ƙaddamar da shigar da ODT, ƙimar tsarin fitarwa da sunan fayil mai sakamako azaman muhawara.

wordsApi.ConvertDocument(response);

Kira API don fara aikin canza ODT zuwa DOC. Bayan aiki mai nasara, ana adana fayil ɗin sakamakon a cikin ma’ajin gajimare.

Juya ODT zuwa DOCX ta amfani da Umarnin CURL

Juya fayilolin ODT zuwa tsarin DOC an yi shi na musamman dacewa ta hanyar aiki mara kyau na Aspose.Words Cloud da umarnin cURL. Wannan haɗin gwiwa mai ƙarfi yana ba da ingantacciyar hanya don aiwatar da jujjuyawar ODT zuwa DOC ba tare da wahala ba. Wannan haɗin kai mai ƙarfi yana ba ku hanya mai sauƙi don haɓaka dacewar daftarin aiki da ingancin gabatarwa.

Yanzu, tare da wannan hanyar, mataki na farko 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=bb959721-5780-4be6-be35-ff5c3a6aa4a2&client_secret=4d84d5f6584160cbd91dba1fe145db14" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Accept: application/json"

Yanzu kawai aiwatar da umarni mai zuwa don loda shigar da ODT daga ma’ajiyar gajimare, canza shi zuwa tsarin DOCX kuma adana fayil ɗin sakamako akan faifan gida.

curl -v "https://api.aspose.cloud/v4.0/words/{inputFile}?format=DOCX" \
-X GET \
-H "Authorization: Bearer {accessToken}" \
-o "resultant.docx"

Sauya ‘inputFile’ tare da sunan fayil ɗin ODT da ke cikin ma’ajiyar girgije, da ‘accessToken’ tare da alamar JWT da aka ƙirƙira a baya.

Kammalawa

A ƙarshe, jujjuya fayilolin ODT zuwa tsarin DOC yana fitowa azaman mahimmin iyawa, yana magance buƙatun zamani don ingantaccen dacewa da daftarin aiki da gogewar gabatarwa. Tare da ingantattun hanyoyi guda biyu a hannun ku, haɗawar Aspose.Words Cloud don NET da kuma amfani da umarnin cURL, kuna da kayan aiki don kewaya wannan jujjuyawar ba tare da matsala ba dangane da abubuwan da kuke so da buƙatun kasuwanci. Don haka, kowace hanya da kuka zaɓa, zaɓuɓɓukan biyu suna nuna ƙimar sauƙaƙa da musanyar daftarin aiki, tabbatar da cewa abun cikin ku na ODT yana canzawa maras kyau zuwa fayilolin DOC/DOCX masu sana’a.

Hanyoyin haɗi masu amfani

Labarai masu alaka

Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: