Add logic for PDF