Capture output/errors in makePDF