HTML
JPG
PDF
XML
DOCX
PDF
Konversi PS ke PDF dalam Node.js SDK
Ekspor dokumen PS ke berbagai format termasuk PDF dengan Aspose.PDF Cloud Node.js SDK
Get StartedCara Mengonversi PS ke PDF Menggunakan Node.js SDK
Untuk mengonversi PS ke PDF, kita akan menggunakan Aspose.PDF Cloud Node.js SDK Cloud SDK ini membantu pemrogram Node.js dalam mengembangkan aplikasi pembuat PDF berbasis cloud, anotator, editor, dan konverter 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 untuk Mengonversi PS ke PDF melalui Node.js
Pengembang Aspose.PDF Cloud Node.js dapat dengan mudah memuat & mengonversi file PS ke PDF hanya dalam beberapa baris kode.
- Muat Kunci dan Rahasia Aplikasi Anda dari file JSON atau atur kredensial dengan cara lain
- Buat objek untuk terhubung ke Cloud API
- Unggah file dokumen Anda
- Lakukan konversi menggunakan putPsInStorageToPdf
- Unduh hasilnya jika diperlukan
Kode contoh ini menunjukkan Konversi Cloud Node.js SDK dari PS ke PDF
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 convertPStoPDF() {
const localImageFileName = "C:\\Samples\\sample.ps";
const storageFileName = "sample.ps";
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.putPsInStorageToPdf("sample-ps-to-pdf.pdf", storageFileName);
console.log(convertResult.response.text);
const buffer = await pdfApi.downloadFile(STORAGE_FILENAME);
} catch (error) {
console.error(error.response.text);
}
}
Konversi Lain yang Didukung
Anda juga dapat mengonversi MD ke banyak format file lain termasuk beberapa yang tercantum di bawah ini.
BMP KE PDF (Gambar Bitmap)
CGM KE PDF (Format Biner Microsoft Word)
EMF KE PDF (Dokumen Word Office 2007+)
EPUB KE PDF (Format Enhanced Metafile)
GIF KE PDF (Format Pertukaran Grafis)
HTML KE PDF (Hyper Text Markup Language)
JPEG KE PDF (Joint Photographic Experts Group)
LATEX KE PDF (Teks Output LaTeX)
PCL KE PDF (Printer Command Language)
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 (Kelompok Ahli Fotografi Bersama)
PDF KE PDF/A (Format Dokumen Portabel)
PDF KE PNG (Grafik Jaringan Portabel)
PDF KE PPTX (Microsoft PowerPoint)
PDF KE SVG (Grafik Vektor Skalabel)
PDF KE TEX (Sistem Grafik Komputer)
PDF KE TIFF (Format Gambar Berlabel)
PDF KE WORD (Format Biner Microsoft Word)
PDF KE XLSX (File Spreadsheet Format XML Terbuka Microsoft Excel)
PDF KE XPS (Spesifikasi Kertas XML)
PNG KE PDF (Grafik Jaringan Portabel)
PS KE PDF (PostScript)
SVG KE PDF (Grafik Vektor Skalabel)
TEKS KE PDF (Dokumen Teks)
TIFF KE PDF (Format Gambar Berlabel)
XPS KE PDF (Spesifikasi Kertas XML)