See the attached demo project, which throws the following exception:
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at #=zRfa24k6qRV51vWOnVLP8VICdg7c7CNQNesY…...pdfDocument = new Document("path/to/your/document.pdf"); // Create...optimized document pdfDocument.save("path/to/your/optimized_document.pdf");...