fixing rules to create PDF and DOCX files