HTML JPG PDF XML DOCX
  Product Family
PDF

Konversi PDF ke DOC dalam Node.js SDK

Ekspor dokumen PDF ke berbagai format termasuk DOC dengan Aspose.PDF Cloud Node.js SDK

Get Started

Cara Mengonversi PDF ke DOC Menggunakan Node.js SDK

Untuk mengonversi PDF ke DOC, kita akan menggunakan Aspose.PDF Cloud Node.js SDK Cloud SDK ini membantu programmer Node.js dalam mengembangkan aplikasi pembuat, anotator, editor, dan konverter PDF berbasis cloud menggunakan bahasa pemrograman Node.js melalui Aspose.PDF REST API. Buka NPM pengelola paket, cari Aspose.PDF Cloud, dan instal. Anda juga dapat menggunakan perintah berikut dari Konsol Pengelola Paket.

Perintah Konsol Pengelola Paket


     
    npm install asposepdfcloud --save
     
     

Langkah-langkah Mengonversi PDF ke DOC melalui Node.js

Pengembang Aspose.PDF Cloud Node.js dapat dengan mudah memuat & mengonversi file PDF ke DOC hanya dalam beberapa baris kode.

  1. Muat Aplikasi Rahasia dan Kunci Anda dari file JSON atau tetapkan kredensial dengan cara lain
  2. Buat objek untuk terhubung ke Cloud API
  3. Unggah file dokumen Anda
  4. Lakukan konversi menggunakan getPdfInStorageToDoc
  5. Unduh hasilnya jika diperlukan
 

Contoh kode ini menunjukkan Konversi PDF ke DOC Cloud Node.js SDK


    const fs = require("fs");
    const credentials = require("./credentials.json");
    const { PdfApi } = require("asposepdfcloud");

    // Load your Application Secret and Key from the JSON file or set credentials in another way
    async function convertPDFtoDOC () {
        const localFileName = "C:\\Samples\\sample.pdf";
        const storageFileName = "sample.pdf";
        const pdfApi = new PdfApi(credentials.id, credentials.key);
        let fileData = await fs.readFile(localImageFileName);
        try {
            let uploadResult = await pdfApi.uploadFile(storageFileName, fileData);
            console.log(uploadResult.response.text);
        }
        catch (error) {
            console.error(error.response.text);
        }

        try {
            let convertResult = await pdfApi.getPdfInStorageToDoc(storageFileName, false, "doc");
            fs.writeFileSync("sample.docx", convertResult.body);
            const buffer = await pdfApi.downloadFile(STORAGE_FILENAME);
        } catch (error) {
            console.error(error.response.text);
        }
    }
 
  • Konversi Didukung Lainnya

    Anda juga dapat mengonversi MD ke banyak format file lainnya termasuk beberapa yang tercantum di bawah ini.

    BMP KE PDF (Gambar Bitmap)
    CGM KE PDF (Format Biner Microsoft Word)
    EMF KE PDF (Dokumen Kata Office 2007+)
    EPUB KE PDF (Format Enhanced Metafile)
    GIF KE PDF (Format Pertukaran Grafis)
    HTML KE PDF (Bahasa Markup Hyper Text)
    JPEG KE PDF (Kelompok Ahli Fotografi Bersama)
    LATEX KE PDF (Teks Output LaTeX)
    PCL KE PDF (Bahasa Perintah Printer)
    MD KE PDF (Markdown)
    PDF KE BMP (Gambar Bitmap)
    PDF KE EPUB (Format E-book)
    PDF KE GIF (Format Pertukaran Grafis)
    PDF KE HTML (Hyper Text Markup Language)
    PDF KE JPEG (Joint Photographic Experts Group)
    PDF KE PDF/A (Portable Document Format)
    PDF KE PNG (Portable Network Graphics)
    PDF KE PPTX (Microsoft PowerPoint)
    PDF KE SVG (Scalable Vector Graphics)
    PDF KE TEX (Computer Graphics System)
    PDF KE TIFF (Tagged Image Format)
    PDF KE WORD (Microsoft Word Binary Format)
    PDF KE XLSX (Microsoft Excel Open XML Format Spreadsheet file)
    PDF KE XPS (XML Paper Specifications)
    PNG KE PDF (Portable Network Graphics)
    PS KE PDF (PostScript)
    SVG KE PDF (Scalable Vector Graphics)
    TEKS KE PDF (Text Document)
    TIFF KE PDF (Tagged Image Format)
    XPS KE PDF (XML Paper Specifications)