epub zuwa jpg

Yadda ake sauya ePUB zuwa JPEG ta amfani da NET REST API.

Mayar da EPUB fayiloli zuwa JPG hotuna suna fitar da duniya mai yiwuwa da aiki. a zamanin dijital na yau. Auren nau’ikan nau’ikan nau’ikan nau’ikan guda biyu yana buɗe ƙofofi don haɓaka sadarwar gani, yana ba ku damar ƙirƙirar zane mai ɗaukar ido, raba abun ciki mai jan hankali, da faɗaɗa hangen nesa. A cikin wannan labarin, za mu bincika yadda ake amfani da damar .NET REST API don EPUB zuwa jujjuya JPG, bayyana fa’idodi da yawa waɗanda suka bambanta daga ingantattun labarun gani zuwa ingantaccen raba abun ciki.

API ɗin REST don Canjin Takardu na MS Word

Yin amfani da ƙarfi mai ƙarfi na Aspose.Words Cloud SDK don NET, EPUB zuwa JPG ya zama tsari mara ƙarfi da ƙarfi. Bayan wannan jujjuyawar, wannan ɗimbin SDK yana buɗe duniyar yuwuwar sarrafa daftarin aiki. Da shi, za ka iya sarrafa sarrafa daftarin aiki tsara daftarin aiki, gyara, da kuma juyi ayyuka cikin sauki. Ko kuna aiki tare da EPUB, DOCX, PDF, ko wasu shahararrun nau’ikan tsari, API ɗin yana ba da cikakkiyar kayan aiki don haɓaka ayyukan sarrafa takaddun ku.

Bincika ‘Aspose.Words-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin ‘Ƙara Kunshin’. Wannan zai ƙara bayanin SDK a cikin aikin ku. Na biyu, sami takaddun shaidar abokin ciniki daga dashboard ɗin girgije. Idan ba ku da asusun da ke akwai, kawai ƙirƙirar asusun kyauta ta bin umarnin da aka kayyade a cikin labarin saurin farawa.

Maida EPUB zuwa JPG ta amfani da C# .NET

Da fatan za a bi umarnin da aka bayar a ƙasa don haɓaka EPUB zuwa mai sauya JPG akan layi ta amfani da C# .NET.

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

Ƙirƙiri wani abu na ajin WordsApi inda muka wuce abin Kanfigareshan azaman hujja.

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

Ƙirƙiri misalin Buƙatar inda muka ƙididdige sunan shigar da EPUB, tsarin sakamako kamar JPEG da sunan sakamako na JPEG.

var output =  wordsApi.GetDocumentWithFormat(response);

A ƙarshe, kira API don canza EPUB zuwa JPEG akan layi kuma dawo da hoton fitarwa.

// 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ƙirar misali na WordsApi
WordsApi wordsApi = new WordsApi(new Aspose.Words.Cloud.Sdk.Configuration()
{
    ClientId = clientID,
    ClientSecret = clientSecret
});

// shigar da fayil EPUB
String inputFile = "Sway.epub";
// sakamakon hoton JPEG
String resultant = "resultantNew.jpeg";

// ƙirƙirar DocumentWithFormat abu nema
var response = new GetDocumentWithFormatRequest(inputFile, "JPG", outPath: resultant);

// kunna aikin EPUB zuwa JPEG
var output =  wordsApi.GetDocumentWithFormat(response);

Za a iya sauke samfurin fayil ɗin MPP da aka yi amfani da shi a cikin misalin da ke sama daga Sway.epub.

Ajiye EPUB zuwa JPEG ta amfani da Umarnin CURL

Yin amfani da Aspose.Words Cloud a haɗe tare da umarnin cURL yana sauƙaƙe hanyar daidaitawa ga EPUB zuwa juyawa JPG. Sabis na tushen gajimare, haɗe tare da sauƙaƙan cURL da haɓaka, yana ba da ingantacciyar hanya don canza takaddun EPUB zuwa hotuna JPG masu inganci.

Mataki na farko a wannan hanyar shine samar da alamar samun damar JWT ta amfani da umarni mai zuwa:

curl -v "https://api.aspose.cloud/connect/token" \
 -X POST \
 -d "grant_type=client_credentials&client_id=163c02a1-fcaa-4f79-be54-33012487e783&client_secret=c71cfe618cc6c0944f8f96bdef9813ac" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Accept: application/json"

Da fatan za a aiwatar da umarni mai zuwa don adana EPUB zuwa tsarin JPEG.

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

Sauya ‘inputFile’ tare da sunan shigar da fayil MPP da ake samu a cikin Ma’ajiyar girgije, ‘resultantFile’ tare da sunan fitarwa PDF da ‘accessToken’ tare da alamar samun damar JWT da aka samar a sama.

Kammalawa

A ƙarshe, wannan labarin ya bincika hanyoyi guda biyu masu tasiri don EPUB zuwa jujjuya JPG: na farko ta amfani da Aspose.Words Cloud SDK don NET da na biyu wanda ya ƙunshi umarnin cURL tare da Aspose.Words Cloud. Mun shaida ikon Aspose.Words Cloud SDK, wanda ke ba da hanya mai sauƙi da sauƙi don canza takaddun EPUB zuwa hotuna JPG, duk a cikin tsarin NET. Bugu da ƙari, hanyar umarnin cURL ta nuna sassauci da haɓakar Aspose.Words Cloud, yana ba masu amfani da hanyar da ta dace don ayyukan sarrafa takardu daban-daban.

Hanyoyin haɗi masu amfani

Labarai masu alaka

Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: