Add margins and output to pdf.