Skip to content
프로젝트

소개

순수 JavaScript로 클라이언트와 서버 측에서 PDF 인쇄

기타 프로젝트

이 수치를 측정하는 방법

What you can do

  • text alignment (left, right, centered, justified)
  • numbered and bulleted lists
  • auto/fixed/star-sized widths
  • column spans and row spans

측정된 스타 증가

in 24h
+1
in 7 days
+4
in 15 days
+9
in 1 month
+11

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

pdfmake Node.js CI GitHub npm

PDF document generation library for Node.js and browsers, written in pure JavaScript.

Check out the playground and examples.

Features

  • line wrapping
  • text alignment (left, right, centered, justified)
  • numbered and bulleted lists
  • tables and columns:
    • auto/fixed/star-sized widths
    • column spans and row spans
    • headers automatically repeated after a page break
    • snaking columns (newspaper-style layout where content flows from column to column)
  • images, SVG and vector graphics
  • QR codes
  • convenient styling and style inheritance
  • page headers and footers:
    • static or dynamic content
    • access to current page number and page count
  • background layer
  • watermarks
  • page dimensions and orientations
  • margins
  • document sections
  • custom page breaks
  • font embedding
  • support for complex, multi-level (nested) structures
  • table of contents
  • document outlines (bookmarks)
  • external links and internal navigation
  • file attachments
  • encryption, password protection and document permissions
  • PDF/A support
  • helper methods for opening/printing/downloading the generated PDF
  • PDF metadata (e.g. author, subject)

Installation

Install with npm:

npm install pdfmake

Quick start

Node.js

Save the following as example.js:

const pdfmake = require('pdfmake');
const Roboto = require('pdfmake/fonts/Roboto');

pdfmake.addFonts(Roboto);

const docDefinition = {
	content: ['Hello from pdfmake!']
};

pdfmake.createPdf(docDefinition).write('document.pdf').catch(console.error);

Run node example.js to create document.pdf in the current directory.

Browser

Save the following as index.html next to your node_modules directory and open it in a browser.

<!doctype html>
<meta charset="utf-8">
<script src="node_modules/pdfmake/build/pdfmake.min.js"></script>
<script src="node_modules/pdfmake/build/vfs_fonts.js"></script>

<button onclick="pdfMake.createPdf(docDefinition).download('document.pdf').catch(console.error)">Download PDF</button>
<script>
	const docDefinition = {
		content: ['Hello from pdfmake!']
	};
</script>

Documentation

See the documentation for usage and API details.

Documentation improvements are welcome in the documentation repository.

Building from source

git clone https://github.com/bpampuch/pdfmake.git
cd pdfmake
npm install
npm run build

License

MIT

Authors

pdfmake is based on PDFKit.

Thanks to all contributors.

관련 프로젝트 살펴보기

불러오는 중…