only create PDF dir when writing the file