The Catalog Write Events is not fired if there is no changes on pdf. But the PdfWriter calls IsCatalogUpdateRequiredForModifiedFile from extender and we can force catalog update if we need.
I'm using these event to create Metadata entry in pdf catalog instead of recreate entire object.
The Catalog Write Events is not fired if there is no changes on pdf. But the PdfWriter calls IsCatalogUpdateRequiredForModifiedFile from extender and we can force catalog update if we need.
I'm using these event to create Metadata entry in pdf catalog instead of recreate entire object.
Follows the usage example:
const objectId = objectsContext.startNewIndirectObject(); pdfWriter.requireCatalogUpdate(); pdfWriter.getEvents().on('OnCatalogWrite',function(dictionaryContext){ dictionaryContext.catalogDictionaryContext.writeKey('Metadata'); dictionaryContext.catalogDictionaryContext.writeObjectReferenceValue(objectId); });