Changed PdfGenerator to PdfDocument.