i-pdf
v1.0.2
Published
A Vue.js library for easy PDF generation, printing, and downloading.
Downloads
4
Readme
i-pdf
A Vue.js library for easy PDF generation, printing, and downloading.
Features
- Generate PDFs from Vue components
- Customizable PDF options (margins, font size, orientation, etc.)
- Support for downloading and printing PDFs
- Automatic pagination
- Responsive design support
Usage
Basic Example
<script setup lang="ts">
import { ref } from 'vue'
import { usePdfExport } from 'i-pdf'
const { handleExportPdf, loading, pdfSection } = usePdfExport()
const exportPdf = async () => {
await handleExportPdf({
fileName: 'my-document',
download: true, // Whether to trigger file download
print: false, // Whether to open print dialog
margins: [10, 10, 10, 10], // Margins for PDF
fontSize: 16, // Font size for PDF
})
}
</script>
<template>
<div>
<button
@click="exportPdf"
:disabled="loading">
Export PDF
</button>
<div ref="pdfSection">
<!-- Your content to be exported as PDF goes here -->
</div>
</div>
</template>