Skip to content

pscott-au/bulk-pdf-workflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bulk-pdf-workflow

Starter architecture to allow bulk PDF creation from source file for invoices / mail merge etc

When there is a need to rapdily create a simple generic data loading / transform / publish application with a web interface this repo provides a set of tools that can be used as a generic starter. Ultimately the aim is to provide each architectural component across different technology sets ( Languages / frameworks etc).

Objectives

Functional Requirements

  • Input source loader:
  • Data Field Validation
  • Data Field Tranform
  • Document Template
  • Document Render

Proof of Concept Demo / Initial Assumption Validation

Before working on a complete solution I will test my assumptions about the suitability of each of the functional components.

Source Data Loader

Web page that allows XLS, CSV or Archives to be uploaded into a session.

HTML5 WYSIWYG-ish Template

Ideally would want to construct /refine or edit the location of rendered field transform constructs using a html5 canvas. Ideally this would streamline the design and maintenance process.

PDF Render from Template

A template was created by taking a staement PDF generated by Xero and modified using Adobe Illustrator.

Backend Architecture

Currently a web server backend with persistence db is considered the preferred architecture. Functional services to perform data to rendered component mapping to be generalised into a SOA integrated using a standardised REST API. This approach allows multiple platforms to be brough together.

Notes

Using ImageMagick to convert pdf to jpg .. handy for use inside web GUI layout editor.

Tech Component Links

HTML5 Canvas Draggable : Could be useful approach to adding WYSIWYG PDF layout designer. THinking that interpolated components represented as fixed size blocks that can be placed on a background JPEG capture of the PDF template.

Angular2 File Upload : allow CSV/Zip/PDF/XLS files to be dragged into a web session context

Angular CLI used as a modern web front-end framework.

Angular Schema Form is a set of AngularJS directives (and a couple of services) to generate Bootstrap 3 ready forms from a JSON Schema.

Google Blockly could be incorporated to provide admin staff with an assisted programming IDE to define or refine the business rules through a simplified browser blocks interface as used by Scratch etc.

Mautic marketing automation could provide a good use case. Personalising PDF for email etc as part of a campaign. e.g. based on customer profile email a PDF catalog including shop items as part of a campaign.

convert           \
   -verbose       \
   -density 150   \
   -trim          \
    test.pdf      \
   -quality 100   \
   -flatten       \
   -sharpen 0x1.0 \
    test.jpg

Unknowns / Current Issues etc

  • include vector graphics such as SVG as compoinents inside PDF? I suspect that need to rasterise which is less than ideal.
  • layout for print ( page size / orientation ) as part of batching

TODO / Action Plan

  • create a sample data set and be able to create a simple PDF for each row with a couple of simple interpolated variables
  • create a generic hook framework to allow processing of individual field values before rendering. NB will require workflow that pre-processes data in order
  • confirm ability to batching generated PDF's into larger printable aggregate files
  • expand component rendering to include a set of common expected functional examples: date format, address lookup/format, db query, barcode render, string case and size clipping, dynamic image render,
  • extend rendering component hooks to include persistance, bundling into workflows and provide web WYSIWYG PDF designer interface

About

Starter architecture to allow bulk PDF creation from source file for invoices / mail merge etc

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published