Implements writing to PDF(auto display/download)