Fix pdf generation
Make remote directory configurable
Merge pull request #687 from andralex/fixpdf

Fix pdf generation