
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
invoice-xml-to-pdf-converter
Advanced tools
XML faturalarını HTML veya PDF'e dönüştüren, Java ve wkhtmltopdf kullanan bir araç.
XML faturalarını HTML ve PDF formatlarına dönüştüren Node.js paketi. E-Arşiv, E-Fatura ve UBL formatlarını destekler.
Bu paket çalışabilmesi için aşağıdaki yazılımların sisteminizde kurulu olması gerekir:
Java kurulumu için:
Ubuntu/Debian:
sudo apt update
sudo apt install openjdk-11-jdk
CentOS/RHEL/Fedora:
sudo dnf install java-11-openjdk-devel
# veya RHEL/CentOS için: sudo yum install java-11-openjdk-devel
Kurulumu kontrol edin:
java -version
javac -version
PDF çıktısı için wkhtmltopdf gereklidir:
npm install invoice-xml-to-pdf-converter
Kurulum sonrası gereksinimler otomatik olarak kontrol edilir.
const InvoiceConverter = require('invoice-xml-to-pdf-converter');
const fs = require('fs');
const converter = new InvoiceConverter();
async function convertInvoice() {
try {
// XML dosyasını oku
const xmlContent = fs.readFileSync('fatura.xml', 'utf8');
// HTML'ye dönüştür
const htmlContent = await converter.convertToHtml(xmlContent);
console.log('HTML çıktısı:', htmlContent);
// PDF'ye dönüştür (base64 formatında)
const pdfBase64 = await converter.convertToPdfBase64(xmlContent);
// PDF'yi dosyaya kaydet
InvoiceConverter.savePdfFromBase64(pdfBase64, 'fatura.pdf');
console.log('PDF başarıyla oluşturuldu: fatura.pdf');
} catch (error) {
console.error('Hata:', error.message);
}
}
convertInvoice();
const InvoiceConverter = require('invoice-xml-to-pdf-converter');
const converter = new InvoiceConverter();
async function convertBase64Invoice() {
try {
const xmlBase64 = 'PHhtbCB2ZXJzaW9uPSIxLjAiIC4uLg=='; // Base64 XML
// Base64 XML'i PDF'ye dönüştür
const pdfBase64 = await converter.convertToPdfBase64(xmlBase64, true);
// PDF'yi kaydet
InvoiceConverter.savePdfFromBase64(pdfBase64, 'fatura.pdf');
} catch (error) {
console.error('Hata:', error.message);
}
}
convertBase64Invoice();
Paketi global olarak kurarsanız CLI olarak da kullanabilirsiniz:
npm install -g invoice-xml-to-pdf-converter
invoice-xml-to-pdf-converter
new InvoiceConverter()Yeni bir dönüştürücü örneği oluşturur.
convertToHtml(xmlContent, isBase64Input)XML içeriğini HTML formatına dönüştürür.
Parametreler:
xmlContent (string): XML içeriğiisBase64Input (boolean, isteğe bağlı): XML'in base64 formatında olup olmadığıDöndürür: Promise - HTML içeriği
convertToPdfBase64(xmlContent, isBase64Input)XML içeriğini PDF formatına dönüştürür ve base64 string olarak döndürür.
Parametreler:
xmlContent (string): XML içeriğiisBase64Input (boolean, isteğe bağlı): XML'in base64 formatında olup olmadığıDöndürür: Promise - Base64 formatında PDF
InvoiceConverter.savePdfFromBase64(base64String, outputPath)Base64 PDF stringini dosyaya kaydeder.
Parametreler:
base64String (string): Base64 formatında PDF içeriğioutputPath (string): Çıktı dosyasının yolutry {
const pdfBase64 = await converter.convertToPdfBase64(xmlContent);
// Başarılı işlem
} catch (error) {
if (error.message.includes('Java process')) {
console.error('Java hatası: Java kurulu mu kontrol edin');
} else if (error.message.includes('PDF validation')) {
console.error('PDF oluşturma hatası: wkhtmltopdf kurulu mu kontrol edin');
} else {
console.error('Genel hata:', error.message);
}
}
MIT
git checkout -b feature/yeni-ozellik)git commit -am 'Yeni özellik eklendi')git push origin feature/yeni-ozellik)A Node.js package that converts XML invoices to HTML and PDF formats. Supports E-Archive, E-Invoice, and UBL formats.
This package requires the following software to be installed on your system:
For Java installation:
Ubuntu/Debian:
sudo apt update
sudo apt install openjdk-11-jdk
CentOS/RHEL/Fedora:
sudo dnf install java-11-openjdk-devel
# or for RHEL/CentOS: sudo yum install java-11-openjdk-devel
Verify installation:
java -version
javac -version
wkhtmltopdf is required for PDF output:
npm install invoice-xml-to-pdf-converter
Requirements are automatically checked after installation.
const InvoiceConverter = require('invoice-xml-to-pdf-converter');
const fs = require('fs');
const converter = new InvoiceConverter();
async function convertInvoice() {
try {
// Read XML file
const xmlContent = fs.readFileSync('invoice.xml', 'utf8');
// Convert to HTML
const htmlContent = await converter.convertToHtml(xmlContent);
console.log('HTML output:', htmlContent);
// Convert to PDF (base64 format)
const pdfBase64 = await converter.convertToPdfBase64(xmlContent);
// Save PDF to file
InvoiceConverter.savePdfFromBase64(pdfBase64, 'invoice.pdf');
console.log('PDF successfully created: invoice.pdf');
} catch (error) {
console.error('Error:', error.message);
}
}
convertInvoice();
const InvoiceConverter = require('invoice-xml-to-pdf-converter');
const converter = new InvoiceConverter();
async function convertBase64Invoice() {
try {
const xmlBase64 = 'PHhtbCB2ZXJzaW9uPSIxLjAiIC4uLg=='; // Base64 XML
// Convert base64 XML to PDF
const pdfBase64 = await converter.convertToPdfBase64(xmlBase64, true);
// Save PDF
InvoiceConverter.savePdfFromBase64(pdfBase64, 'invoice.pdf');
} catch (error) {
console.error('Error:', error.message);
}
}
convertBase64Invoice();
If you install the package globally, you can also use it as CLI:
npm install -g invoice-xml-to-pdf-converter
invoice-xml-to-pdf-converter
new InvoiceConverter()Creates a new converter instance.
convertToHtml(xmlContent, isBase64Input)Converts XML content to HTML format.
Parameters:
xmlContent (string): XML contentisBase64Input (boolean, optional): Whether the XML is in base64 formatReturns: Promise - HTML content
convertToPdfBase64(xmlContent, isBase64Input)Converts XML content to PDF format and returns as base64 string.
Parameters:
xmlContent (string): XML contentisBase64Input (boolean, optional): Whether the XML is in base64 formatReturns: Promise - PDF in base64 format
InvoiceConverter.savePdfFromBase64(base64String, outputPath)Saves base64 PDF string to file.
Parameters:
base64String (string): PDF content in base64 formatoutputPath (string): Output file pathtry {
const pdfBase64 = await converter.convertToPdfBase64(xmlContent);
// Successful operation
} catch (error) {
if (error.message.includes('Java process')) {
console.error('Java error: Check if Java is installed');
} else if (error.message.includes('PDF validation')) {
console.error('PDF generation error: Check if wkhtmltopdf is installed');
} else {
console.error('General error:', error.message);
}
}
MIT
git checkout -b feature/new-feature)git commit -am 'Add new feature')git push origin feature/new-feature)FAQs
XML faturalarını HTML veya PDF'e dönüştüren, Java ve wkhtmltopdf kullanan bir araç.
The npm package invoice-xml-to-pdf-converter receives a total of 3 weekly downloads. As such, invoice-xml-to-pdf-converter popularity was classified as not popular.
We found that invoice-xml-to-pdf-converter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.