Fixed PDF generation
Use longest keyword always