RelaxedJS/ReLaXed

Better PDF tooling support.

Open

#112 opened on Sep 3, 2018

View on GitHub
 (0 comments) (3 reactions) (0 assignees)JavaScript (11,805 stars) (466 forks)batch import
enhancementhelp wanted

Description

I have been working on a separate project that wraps the puppeteers PDF system to add missing functionality, including custom headers/footers and pages. I just pushed an early build of it here.

I created this as a separate project as I have seen requests for a ReLaXed API to generate PDFs from existing HTML documents. Because those would not need all the additional features of ReLaXed having a separate project (package) for that was ideal.

I have not implemented a way to build the document from an entire HTML string (or file) yet, but I do have an idea in mind of how to do it. Additionally, I think I have a solution for dealing with page-breaks with this system.

This system creates a document, currently, by creating separate pages, then in each page you add body content, header/footer content, etc. All these elements have overflow: hidden so if your content goes beyond the size limits it is simply hidden. When the fromHTML is done it will automatically overflow into a new page.

The lib/Document.spec.js test file (which it currently is not run as) will output an example pdf.

I currently have very little documentation or code commenting done so understanding the system will require a bit of work.

Contributor guide