Excel kanggo tembung

Ngonversi Excel dadi Word ing Jawa

Ngonversi buku kerja Excel dadi dokumen Word bisa dadi tugas sing mumetake lan butuh wektu, utamane nalika nggarap data sing akeh. Nanging, kanthi kekuwatan Java REST API, sampeyan bisa nyepetake lan ngotomatisasi proses ngowahi file Excel dadi dokumen Word, ngirit wektu lan tenaga. Ing postingan blog iki, kita bakal menehi pandhuan langkah-langkah babagan cara ngowahi file Excel dadi dokumen Word nggunakake Java REST API, uga nyorot sawetara keuntungan utama nggunakake alat sing kuat iki. Apa sampeyan pangembang utawa pangguna bisnis, pandhuan iki bakal mbantu sampeyan nyederhanakake lan ngoptimalake proses konversi Excel menyang Word.

Excel kanggo Word Conversion API

Aspose.Cells Cloud SDK for Java minangka alat sing kuat kanggo nggarap file Excel ing méga, nawakake macem-macem fitur kanggo pangolahan lan konversi data. Salah sawijining keuntungan utama nggunakake Aspose.Cells Cloud yaiku kemampuan kanggo ngowahi file Excel dadi dokumen Word kanthi gampang. Kanthi ngetutake langkah-langkah prasaja, streamline alur kerja lan otomatis proses konversi Excel menyang Word.

Kanggo miwiti, kita kudu nggawe proyek jinis mbangun maven lan nambah rincian ing ngisor iki ing file pom.xml.

<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>

Sawise iku, gawe akun liwat Aspose Cloud lan goleki ID Klien lan rincian Rahasia Klien saka Dashboard.

Ngonversi Excel dadi Word ing Jawa

Bagean iki nyedhiyakake informasi langkah-langkah babagan cara ngowahi dokumen Excel dadi Word nggunakake Java.

  • Gawe conto CellsApi nalika nyedhiyakake kredensial klien minangka argumen input.
  • Gawe variabel kanthi jeneng input Excel, format asil minangka DOC, lan jeneng file asil.
  • Maca file Excel saka drive lokal nggunakake conto File.
  • Pungkasan, nelpon metode cellsWorkbookPutConvertWorkbook(…) kanggo miwiti operasi konversi Excel menyang Word.
// 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 = "bb959721-5780-4be6-be35-ff5c3a6aa4a2";
    String clientSecret = "4d84d5f6584160cbd91dba1fe145db14";
  
    // nggawe conto CellsApi nggunakake kredensial klien
    CellsApi api = new CellsApi(clientId,clientSecret);
    		
    // jeneng input buku kerja Excel
    String fileName = "myDocument.xlsx";
    // rincian sandi yen workbook ing ndhelik
    String password = null;
        
    // format file asil
    String format = "DOCX";
    		
    // mbukak file saka sistem lokal
    File file = new File(fileName);	
    
    // nindakake operasi konversi dokumen
    File response = api.cellsWorkbookPutConvertWorkbook(file, format, password, "Resultant.docx", null, null);  
            
    // pesen sukses print
    System.out.println("Successfull conversion of Excel to Word !");
    }catch(Exception ex)
    {
	      System.out.println(ex);
    }
Excel menyang pratinjau Word

gambar 1: - Pratinjau Konversi Excel menyang Word

Buku kerja Excel input sing digunakake ing conto ing ndhuwur bisa diundhuh saka myDocument.xlsx.

Ekspor Excel menyang Word nggunakake perintah cURL

Saiki, yen sampeyan nggoleki cara sing gampang lan efisien kanggo ngowahi file Excel dadi dokumen Word, perintah cURL bisa dadi alat sing kuat ing arsenal sampeyan. Kanthi cURL, sampeyan bisa kanthi gampang ngirim panjalukan HTTP menyang server lan nampa respon, dadi becik kanggo ngotomatisasi macem-macem tugas, kalebu konversi Excel menyang Word. 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=bb959721-5780-4be6-be35-ff5c3a6aa4a2&client_secret=4d84d5f6584160cbd91dba1fe145db14" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Sawise token JWT wis digawe, kita kudu nglakokake printah ing ngisor iki, sing ngemot input Excel saka panyimpenan Cloud lan ngekspor output menyang format Word. Sawise konversi, asil DOCX uga disimpen ing panyimpenan Cloud.

curl -v -X GET "https://api.aspose.cloud/v3.0/cells/myDocument.xlsx?format=DOCX&isAutoFit=true&onlySaveTable=true&outPath=Resultant.docx&checkExcelRestriction=true" \
-H  "accept: application/json" \
-H  "authorization: Bearer <JWT Token>"
Ekspor Excel menyang Word

Gambar 2: - Pratinjau konversi Excel menyang Word

Panutup

Kesimpulane, ngowahi file Excel dadi dokumen Word bisa dadi game-changer kanggo bisnis lan individu sing pengin nyepetake alur kerja lan nyederhanakake pangolahan data. Apa sampeyan nggunakake Aspose.Cells Cloud SDK kanggo Java utawa perintah cURL, loro alat kasebut nyedhiyakake fitur sing kuat kanggo ngowahi file Excel dadi dokumen Word kanthi gampang. Mupangate alat sing kuat iki kanggo nambah produktivitas lan efisiensi. Coba alat kasebut lan temokake carane bisa ngowahi cara sampeyan nggarap data.

Kode sumber lengkap Cloud SDK kasedhiya kanggo diundhuh ing GitHub. Salajengipun, yen sampeyan nemoni masalah nalika nggunakake API, hubungi kita liwat [forum dhukungan produk] gratis 9.

Artikel sing Disaranake

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