Excel da PowerPoint aikace-aikace biyu ne da ake amfani da su sosai waɗanda ke da mahimmanci a cikin kasuwanci da masana’antu da yawa. Excel galibi ana amfani dashi don adanawa da tsara bayanai, yayin da PowerPoint galibi ana amfani dashi don ƙirƙirar gabatarwa da nunin faifai. Mayar da fayilolin Excel zuwa gabatarwar PowerPoint aiki ne na gama gari da mutane da yawa ke buƙatar yi, kuma yin shi da hannu na iya ɗaukar lokaci kuma yana iya fuskantar kurakurai. A cikin wannan gidan yanar gizon, za mu samar da cikakken jagora kan yadda ake canza Excel zuwa PowerPoint ta amfani da Java REST API. Za mu rufe fasahohin daban-daban waɗanda za a iya amfani da su don sarrafa tsarin jujjuyawa da yin aiki mai inganci. Ko kai mai haɓakawa ne ko ƙwararrun kasuwanci, wannan jagorar za ta taimaka maka daidaita aikinka da adana lokaci. Bari mu fara!
- API ɗin Canjin Excel zuwa PowerPoint
- Canza Excel zuwa PowerPoint a Java
- Saka Excel cikin PowerPoint ta amfani da Umarnin CURL
API ɗin Canjin Excel zuwa PowerPoint
Aspose.Cells Cloud SDK don Java API ne mai ƙarfi na tushen girgije wanda ke ba da damar iya aiki da yawa don aiki tare da fayilolin Excel. Wasu daga cikin mabuɗin damar sun haɗa da Excel zuwa PowerPoint, XLS zuwa PDF, XLS zuwa HTML, Haɗa da Raba fayilolin Excel da ƙari mai yawa. API ɗin an tsara shi don zama mai sassauƙa da daidaitawa, don haka masu haɓakawa za su iya gina hanyoyin magance takamaiman bukatunsu. Yi aiki da kai da daidaita ayyukan da ke da alaƙa da Excel a cikin gajimare, ba tare da buƙatar shigar da kowace software ko hardware ba.
Yanzu mataki na farko shine ƙara bayanin SDK a cikin aikin Java.
<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>
Idan baku yi rajista ba akan Aspose Cloud, da fatan za a ƙirƙiri asusun kyauta ta amfani da ingantaccen adireshin imel. Sannan a samo ID na Abokin Ciniki da bayanan Sirrin Abokin ciniki daga dashboard.
Canza Excel zuwa PowerPoint a Java
Wannan sashe yana ba da cikakkun bayanai kan yadda ake canza Excel zuwa PowerPoint ta amfani da Java.
- Ƙirƙiri misali na CellsApi yayin ƙaddamar da bayanan abokin ciniki azaman mahawara ta shigarwa.
- Ƙirƙirar masu canji mai riƙe da shigar da sunan Excel, tsarin sakamako azaman PowerPoint, da sunan fayil ɗin fitarwa.
- Karanta fayil ɗin Excel daga faifan gida ta amfani da misalin Fayil.
- Sannan loda takaddar aikin Excel zuwa ma’ajiyar gajimare ta amfani da hanyar uploadFile(…).
- A ƙarshe, kira hanyar cellsWorkbookGetWorkbook(…) don yin fassarar Excel zuwa PowerPoint. Bayan jujjuyawa, fayil ɗin sakamako yana adana a cikin ma’ajiyar girgije.
// 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;
// Ƙayyade don saita layuka na littafin aiki don zama autofit.
Boolean isAutoFit = true;
// Yana ƙayyade ko ajiye bayanan tebur kawai.
Boolean onlySaveTable = true;
// resultant fayil format
String format = "PPTX";
// loda fayil daga tsarin gida
File file = new File(fileName);
// loda shigarwar XLSB zuwa ma'ajin gajimare
api.uploadFile("input.xlsx", file, "default");
// yi aikin canza takarda
File response = api.cellsWorkbookGetWorkbook("input.xlsx", password,format,
isAutoFit, onlySaveTable, null,"default", "Resultant.pptx","default", null);
// buga sakon nasara
System.out.println("Successfull conversion of Excel to PowerPoint !");
}catch(Exception ex)
{
System.out.println(ex.getMessage());
}
Kuna iya yin la’akari da zazzage shigar da littafin aikin Excel da sakamako na PowerPoint daga myDocument.xlsx da Resultant.pptx, bi da bi.
Saka Excel cikin PowerPoint ta amfani da Umarnin CURL
Tunda ana iya samun dama ga REST APIs ta hanyar umarnin cURL, don haka a cikin wannan sashe, zamu canza XLS zuwa PPT ta amfani da umarnin cURL. Yanzu, mataki na farko shine ƙirƙirar alamar samun damar JWT yayin 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 da muke da alamar JWT ta keɓaɓɓen mu, muna buƙatar aiwatar da umarni mai zuwa don ɗora Excel daga ajiyar girgije, aiwatar da juyawa zuwa PowerPoint kuma adana fitarwa a cikin ajiyar girgije.
curl -v -X GET "https://api.aspose.cloud/v3.0/cells/input.xlsx?format=PPTX&isAutoFit=true&onlySaveTable=true&outPath=Resultant.pptx&checkExcelRestriction=true" \
-H "accept: application/json" \
-H "authorization: Bearer <JWT Token>"
Kammalawa
A ƙarshe, Aspose.Cells Cloud yana ba da mafita mai ƙarfi da sassauci don canza fayilolin Excel zuwa gabatarwar PowerPoint da aiki tare da bayanan Excel a cikin girgije. Ta amfani da wannan API, zaku iya daidaita aikinku da sarrafa ayyukan da ke da alaƙa da Excel, yana ba ku damar adana lokaci da rage kurakurai. A cikin wannan gidan yanar gizon, mun ba da cikakken jagora kan yadda ake canza Excel zuwa PowerPoint ta amfani da Java. Muna fatan cewa wannan shafin yanar gizon ya taimaka wajen samar da cikakkun bayanai masu mahimmanci don kasuwancin ku ko bukatun ci gaba.
Idan kun ci karo da kowace matsala yayin amfani da API, da fatan za ku ji daɗin tuntuɓar mu ta [ dandalin tallafin samfur 9.
Labarai masu alaka
Muna ba da shawarar ziyartar hanyoyin haɗin yanar gizo masu zuwa don ƙarin koyo game da: