PDF support more stable now

* Lays out cards with possiblity of margin, gap, and trim
* Some new directory and file validation
* Added a logger