Skip to content

MartinCastroAlvarez/node-typescript-pdf-renderer

Repository files navigation

VEL

PDF rendering with Node & Typescript

wallpaper

References

Example

Rendering a book cover

sample

Rendering information about the authors

sample

Rendering the bibliography

sample

Rendering the table of contents

sample

Rendering chapters

sample

Rendering rich text

sample

Rendering images

sample

sample

Rendering code blocks

sample

Software Architecture

architecture

Software Design Patterns

Adapter is a structural design pattern that allows objects with incompatible interfaces to collaborate.

Abstract Factory is a creational design pattern that lets you produce families of related objects without specifying their concrete classes.

Facade is a structural design pattern that provides a simplified interface to a library, a framework, or any other complex set of classes.

Builder is a creational design pattern that lets you construct complex objects step by step. The pattern allows you to produce different types and representations of an object using the same construction code.

Facade is a structural design pattern that provides a simplified interface to a library, a framework, or any other complex set of classes.

Command is a behavioral design pattern that turns a request into a stand-alone object that contains all information about the request. This transformation lets you pass requests as a method arguments, delay or queue a request’s execution, and support undoable operations.

The goal of Context Object is not to pass lots of parameters to methods implicitly, as a means of by-passing strong typing and encapsulation. The goal is to store scoped data in a general, but managed way, independent of protocols and presentation technology.

Software Structure

Configuration

Path Description
persons Directory with YAML files with personal details that can be referenced.
topics Directory with YAML files with topics details that can be referenced.
config Directory with YAML files with general configuration.
books Directory with YAML files defining books.
code Directory with YAML files with code blocks that can be referenced.
i18n Directory with YAML files defining translations.

Content

Path Description
fonts This directory contains the files defining fonts.
images This directory contains the images files that can be referenced.

Application

Path Description
render.js The Node command line interface for rendering content.
builds This directory containes the results of rendering the books.
src This directory contains the Node code that implements this application.
src/command.ts Application command line interface handler.
src/enums Application constants.
src/vocabulary Application vocabulary used for scoring the quality of the text.
src/interfaces Application interfaces.
src/models Application models.
src/serializers Application serializer interfaces.
src/errors Application errors.

Products

Path Description
src/ebook e-book rendering files.
src/video Video rendering files.
src/html HTML rendering files.
src/course Course rendering files.

Instructions

Installation

yarn install

Rendering a PDF in English

yarn run build && yarn run render --title "Sample" --language "en" --format "ebook"

The PDF is available here

Rendering a PDF in Spanish

yarn run build && yarn run render --title "Sample" --language "es" --format "ebook"

The PDF is available here

Rendering a PDF in multiple languages

yarn run build && yarn run render --title "Sample" --language "en,es" --format "ebook"

The PDF is available here and here

Rendering a PDF in multiple languages

yarn run build && yarn run render --title "Start" --language "en" --format "ebook"
yarn run build && yarn run render --title "Start" --language "es" --format "ebook"

About

PDF rendering with Node & Typescript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published