XLS menyang PDF

Sinau carane ngowahi Excel dadi PDF Online

XLSB minangka format file binar excel, lan minangka koleksi rekaman lan struktur sing nemtokake isi buku kerja Excel. Isi kasebut bisa uga kalebu tabel nomer, teks, utawa nomer lan teks sing ora terstruktur utawa semi-terstruktur, rumus, sambungan data eksternal, grafik, lan gambar. Ing sisih liya, PDF menehi kemampuan kanggo ndeleng konten ing platform apa wae tanpa kompromi kasetyan. Mula amarga kemampuan iki, kita bakal ngrembug rincian babagan cara ngowahi XLSB dadi PDF kanthi program nggunakake Java SDK.

API Konversi Excel menyang PDF

Aspose.Cells Cloud SDK for Java minangka solusi pemenang penghargaan sing nyedhiyakake kapabilitas kanggo nggawe, ngowahi lan ngowahi format Excel sing populer dadi PDF, HTML, TIFF, CSV, lan format file sing didhukung. Fitur sing kuat lan fleksibel, API berbasis awan iki nyedhiyakake solusi sing gampang lan efisien kanggo ngowahi spreadsheet Excel dadi format PDF. Saiki kanggo nggunakake SDK, kita bakal nambah referensi ing pom.xml saka jinis mbangun 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.5</version>
    </dependency>
</dependencies>

Saiki kanggo nggunakake Cloud SDK, sampeyan kudu ndhaptar akun gratis liwat Aspose Cloud lan goleki / gawe ID Klien lan Rahasia Klien ing Cloud Dashboard.

Ngonversi Excel dadi PDF ing Jawa

Ing bagean ing ngisor iki, kita bakal ngrembug rincian babagan cara ngowahi format XLSB dadi PDF lan nyimpen output ing panyimpenan Cloud.

  • Gawe conto CellsApi nalika nyedhiyakake kredensial klien minangka argumen input
  • Nemtokake jeneng input XLSB, format asil, lan jeneng file output
  • Unggah XLSB input menyang panyimpenan awan nggunakake metode uploadFile(…).
  • Pungkasan, nelpon metode cellsWorkbookGetWorkbook(…) kanggo miwiti operasi konversi
// kanggo conto liyane, bukak https://github.com/aspose-cells-cloud/aspose-cells-cloud-java

try
    {
    // Entuk ClientID lan ClientSecret saka https://dashboard.aspose.cloud/
    String clientId = "bbf94a2c-6d7e-4020-b4d2-b9809741374e";
    String clientSecret = "1c9379bb7d701c26cc87e741a29987bb";
  
    // nggawe conto CellsApi nggunakake kredensial klien
    CellsApi api = new CellsApi(clientId,clientSecret);
		
    // jeneng input XLSB workbook
    String name = "myDocument.xlsb";
    // rincian sandi yen workbook ing ndhelik
    String password = null;
    // Nemtokake manawa nyetel baris buku kerja dadi pas otomatis.
    Boolean isAutoFit = true;
    // Nemtokake apa mung nyimpen data tabel. Mung nggunakake pdf kanggo Excel.
    Boolean onlySaveTable = true;
    // format file asil
    String format = "PDF";
		
    // mbukak file saka sistem lokal
    File file = new File("c://Users/shahbnay/Downloads/"+name);	
    // upload input XLSB menyang panyimpenan maya
    api.uploadFile("input.xlsb", file, "Internal");

    // nindakake operasi konversi dokumen
    File response = api.cellsWorkbookGetWorkbook(name,  password,format, 
			            isAutoFit, onlySaveTable, null,"Internal",  "Resultant.pdf","Internal", null);        
        
    // pesen sukses print
    System.out.println("XLSB sucessfully converted to PDF format !");
    }catch(Exception ex)
    {
        System.out.println(ex);
    }

File sampel sing digunakake ing conto ing ndhuwur bisa diundhuh saka

XLS menyang PDF

Gambar 1: - Pratinjau konversi XLSB dadi PDF

XLSB menyang PDF nggunakake CURL Commands

Ing bagean iki, kita bakal nggunakake perintah cURL kanggo mbukak XLSB saka panyimpenan awan lan ngowahi dadi format PDF. Dadi minangka prasyarat, kita kudu ngasilake token akses JWT adhedhasar kredensial klien.

curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bbf94a2c-6d7e-4020-b4d2-b9809741374e&client_secret=1c9379bb7d701c26cc87e741a29987bb" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Sawise token JWT digawe, mangga jalanake perintah ing ngisor iki kanggo nindakake konversi.

curl -v -X GET "https://api.aspose.cloud/v3.0/cells/input.xlsb?format=PDF&isAutoFit=false&onlySaveTable=false&outPath=Converted.pdf&checkExcelRestriction=true" \
-H  "accept: application/json" \
-H  "authorization: Bearer <JWT Token>"

Kesimpulan

Ing artikel iki, kita wis ngrembug rincian kanggo ngembangake solusi sing kuat lan fleksibel kanggo ngowahi spreadsheet Excel menyang format JSON. API uga bisa ngowahi siji spreadsheet uga sawetara spreadsheet bebarengan. Dadi kanthi bantuan Aspose.Cells Cloud SDK kanggo Jawa, gawe solusi sing dipercaya lan efisien kanggo ngowahi Excel dadi PDF. Ing wektu sing padha, gunakake arsitektur REST kanthi ngowahi XLS dadi PDF nggunakake perintah cURL.

Nanging, kita ngajak sampeyan njelajah dokumentasi produk lan sinau babagan fitur menarik liyane sing ditawakake API. Pungkasan, yen sampeyan nemoni masalah nalika nggunakake API, hubungi kita liwat forum dhukungan produk.

Artikel sing gegandhengan

Disaranake ngunjungi tautan ing ngisor iki kanggo sinau luwih lengkap babagan: