-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0e3e5a
commit 66e03b0
Showing
1 changed file
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
# eleventy-pdf | ||
# Eleventy PDF | ||
|
||
This repo is an example of how to have a static website that is automatically converted into a PDF using [DocRaptor](https://docraptor.com/). We're using Eleventy, but you could use any static site generator, including hand-maintained HTML files. We're using DocRaptor, which is a friendly and affordable API build on top of the [Prince PDF](https://www.princexml.com/) service, but you could use other HTML-to-PDF services, including [WeasyPrint](https://weasyprint.org/) or the [Adobe PDF Services API](https://developer.adobe.com/document-services/apis/pdf-services/). | ||
|
||
## How This Works | ||
|
||
The repo will build a standard static site — in this case, a chapter-navigable version of the Sherlock Holmes story, _A Study In Scarlet_ — with some basic CSS. | ||
|
||
In addition, it will output a single-page version of the entire book. This HTML file loads the same CSS as the main site, it just keeps everything in a single file, which is needed so DocRaptor can add page numbers. | ||
|
||
We then have a node script that will load the contents of the single-page version, inline all the CSS and images, and then submit the resulting HTML to the DocRaptor API, which returns a PDF that we save to the `dist` directory. | ||
|
||
For more information, check out [`build-pdf.mjs`](build-pdf.mjs) and this blog post (coming soon). |