Mayar da maƙunsar bayanai Excel zuwa hotunan JPG yana ba da fa’idodi da yawa ga kasuwanci da daidaikun mutane. Ta hanyar fitar da maƙunsar bayanan ku azaman hotuna masu inganci, zaku iya raba su cikin sauƙi tare da wasu waɗanda ƙila ba su da damar yin amfani da Excel ko waɗanda suka fi son duba bayananku azaman hotuna. Bugu da ƙari, canza Excel zuwa JPG na iya zama hanya mai amfani don ƙirƙirar hoton bayanan ku a wani takamaiman lokaci a cikin lokaci, yana ba ku damar yin la’akari da bayanin ku cikin sauƙi daga baya. Tare da Java REST API, canza Excel zuwa JPG bai taɓa yin sauƙi ba, kuma a cikin wannan jagorar, za mu bincika fa’idodin wannan tsari da ƙarin cikakkun bayanai, da kuma samar da jagorar mataki-mataki don yadda ake yin shi.
- API ɗin Canjin Hoto zuwa Excel
- Canza Excel zuwa JPG a Java
- Ƙirƙirar Hoto mai faɗi ta amfani da Umarnin CURL
API ɗin Canjin Hoto zuwa Excel
Aspose.Cells Cloud SDK don Java kayan aiki ne mai ƙarfi wanda ke ba ku damar sauya maɓallan Excel cikin sauƙi zuwa hotuna JPG tare da aminci mai girma. Ta amfani da wannan SDK, za ku iya daidaita aikin sarrafa daftarin aiki da haɓaka haɗin gwiwa ta hanyar raba bayanan ku a sigar gani. Wannan SDK kuma yana ba da fa’idodi da yawa, gami da ikon keɓance kayan aikin ku, sarrafa sarrafa ayyukanku, da kuma tabbatar da kyakkyawan sakamako tare da ƙaramin ƙoƙari.
Bari mu fara da ƙara bayanin sa a cikin aikin nau’in gini na Java maven.
<repositories>
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.cloud/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cells-cloud</artifactId>
<version>22.8</version>
</dependency>
</dependencies>
Bugu da ƙari, don samun dama ga ayyukan Cloud, kuna buƙatar ƙirƙirar asusun kyauta akan Cloud Dashboard. Sannan sami keɓaɓɓen ID ɗin abokin ciniki da bayanan Sirrin Abokin ciniki.
Canza Excel zuwa JPG a Java
Wannan sashe zai bayyana cikakkun bayanai kan yadda ake canza Excel zuwa JPG ta amfani da Java. A cikin wannan tsari, za mu canza duk takaddun Aiki zuwa hotuna JPG.
- Ƙirƙiri misali na CellsApi kuma samar da takaddun shaidar abokin ciniki azaman muhawara.
- Bayyana sunan shigar da Excel, tsarin sakamako azaman JPG, da sunan fayil ɗin fitarwa a cikin masu canjin kirtani.
- Karanta fayil ɗin Excel daga faifan gida ta amfani da misalin Fayil.
- A ƙarshe, kira hanyar cellsWorkbookPutConvertWorkbook(…) don aikin canza hoto zuwa Excel.
// don ƙarin misalai, da fatan za a ziyarci https://github.com/aspose-cells-cloud/aspose-cells-cloud-java
try
{
// Samu ClientID da ClientSecret daga https://dashboard.aspose.cloud/
String clientId = "bb959721-5780-4be6-be35-ff5c3a6aa4a2";
String clientSecret = "4d84d5f6584160cbd91dba1fe145db14";
// ƙirƙiri misali na CellsApi ta amfani da takaddun shaidar abokin ciniki
CellsApi api = new CellsApi(clientId,clientSecret);
// sunan shigar da littafin aikin Excel
String fileName = "myDocument.xlsx";
// bayanan sirri idan littafin aiki a rufaffen
String password = null;
// resultant fayil format
String format = "JPG";
// loda fayil daga tsarin gida
File file = new File(fileName);
// yi aikin canza takarda
File response = api.cellsWorkbookPutConvertWorkbook(file, format, password, "Resultant.jpg", null, null);
// buga sakon nasara
System.out.println("Excel to JPG Conversion successful !");
}catch(Exception ex)
{
System.out.println(ex);
}
Ana iya saukar da shigar da littafin Ayyukan Excel da aka yi amfani da shi a cikin misalin da ke sama daga myDocument.xlsx.
Ƙirƙirar Hoto mai faɗi ta amfani da Umarnin CURL
Tare da REST API da umarnin cURL, za mu iya sauya fayilolin Excel cikin sauƙi zuwa hotuna JPG ba tare da buƙatar kowane software na musamman ko ilimin shirye-shirye ba. Wannan tsarin yana ba da fa’idodi iri-iri, gami da ikon sarrafa sarrafa ayyukan aiki, haɗin kai tare da wasu tsarin, kuma za mu iya keɓance fitarwa don biyan takamaiman bukatunmu.
Yanzu, don cika wannan buƙatun, muna buƙatar 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"
Da zarar muna da alamar JWT, muna buƙatar aiwatar da wannan umarni don musanya zaɓaɓɓen takaddar aiki mai suna “Sheet2” zuwa tsarin JPG. Bayan jujjuyawar, sakamakon JPG yana dawowa cikin rafi mai amsawa kuma ana iya ajiye shi cikin sauƙi zuwa tuƙi na gida.
curl -v -X GET "https://api.aspose.cloud/v3.0/cells/myDocument.xlsx/worksheets/Sheet2?format=JPG&verticalResolution=800&horizontalResolution=1024" \ -H "accept: application/json" \
-H "authorization: Bearer <JWT Token>" \
-o Converted.jpg
Karshen Magana
Juya maƙunsar bayanai na Excel zuwa hotunan JPG raster wani muhimmin sashi ne na ayyukan sarrafa daftarin aiki na zamani, kuma akwai kayan aikin da yawa da ke akwai don taimakawa wajen cimma wannan aikin. Koyaya, lokacin zabar Aspose.Cells Cloud SDK don Java ko REST API ta umarnin cURL, fa’idodin waɗannan hanyoyin sun fito fili. Bugu da ƙari, Aspose.Cells Cloud SDK don Java yana da ƙima sosai kuma yana iya haɗawa cikin sauƙi tare da sauran tsarin, yana mai da shi kyakkyawan zaɓi don kasuwanci na kowane girma. Muna fatan wannan jagorar ta ba ku cikakkiyar fahimtar fa’idodin fitar da maƙunsar bayanai azaman hotuna, wanda ke ba ku damar haɓaka haɗin gwiwa, daidaita ayyukanku, da tabbatar da cewa bayananku suna cikin sauƙi ga wasu.
Tare da waɗannan fasahohin da ke hannunku, yanzu zaku iya sauya XLS cikin sauƙi zuwa JPG ko XLSX zuwa JPG ba tare da bata lokaci ba, ƙara haɓaka aikin ku kuma ɗaukar aikin sarrafa takaddun ku zuwa mataki na gaba. Idan akwai wani ƙarin tambaya, da fatan a yi shakka a tuntuɓe mu ta zauren tallafin samfur.
Labarai masu alaka
Muna ba da shawarar ziyartar hanyoyin haɗin yanar gizo masu zuwa don ƙarin koyo game da: