https://github.com/rla/infdot-doc
A personal project to evaluate PDFKit by turning a subset of Markdown into PDF.
https://github.com/rla/infdot-doc
markdown nodejs pdf pdf-generation pdfkit
Last synced: 3 months ago
JSON representation
A personal project to evaluate PDFKit by turning a subset of Markdown into PDF.
- Host: GitHub
- URL: https://github.com/rla/infdot-doc
- Owner: rla
- License: mit
- Created: 2017-04-28T22:23:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-28T23:21:57.000Z (over 8 years ago)
- Last Synced: 2025-01-16T10:58:36.551Z (12 months ago)
- Topics: markdown, nodejs, pdf, pdf-generation, pdfkit
- Language: JavaScript
- Size: 265 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# infdot-doc
A personal project to evaluate [PDFKit][pdfkit]. It contains a
very small Markdown subset to enter headings, paragraph blocks,
bulleted lists and images. Document options are configured with
HTML comments.
[pdfkit]:http://pdfkit.org/
## Usage
```
infdot-doc -i doc.md -o doc.pdf
```
## Example
* Input file: [example/example.md][input].
* Output file: [example/output.pdf][output].
[input]:https://raw.githubusercontent.com/rla/infdot-doc/master/example/example.md
[output]:https://raw.githubusercontent.com/rla/infdot-doc/master/example/example.pdf
## Installation
```
npm install git+https://github.com/rla/infdot-doc.git -g
```
## Markdown subset
Paragraphs are blocks continuous text. Line ends do not matter.
Headings:
```
# Heading level 1
## Heading level 2
```
Bulleted list (single level):
```
* Item 1
* Item 2
* Item 3
```
Image (scaled to full width):
```

```
Description does not appear anywhere but is useful for writing.
Forced page break:
```
---
```
### Document settings
Document setting are specified using the HTML comment syntax:
```
```
Available options are:
* Size - page [size][sizes] (default A4);
* FontSize - font size in units (default 12);
* TitleFontSize - heading font size (default 25);
* Author - document author name;
* Header - text displayed in the header.
* MarginTop - page top margin (default 98);
* MarginLeft - page left margin (default 72);
* MarginBottom - page bottom margin (default 72);
* MarginRight - page right margin (default 72).
[sizes]:https://github.com/devongovett/pdfkit/blob/b13423bf0a391ed1c33a2e277bc06c00cabd6bf9/lib/page.coffee#L72
## License
If you would like to use some code from here then do so under the terms of the MIT license.