Open ckothari opened 6 years ago
Yes. you can use an event handler on catalog writing (for a new document. for modification scenarios, modify the catalog objects directly). like in this code:
pdfWriter.getEvents().on('OnCatalogWrite',function(eventParams){
var catalogDictionaryContext = eventParams.catalogDictionaryContext;
catalogDictionaryContext.writeKey('PageMode');
catalogDictionaryContext.writeNameValue('FullScreen');
})
For more on how to setup viewing options for an opened PDF, look into the PDF Reference Manual, section 8.1 - View Preferences.
I thought the event onCatalogWrite
will not be triggered at most of the time.
Do you want to consider the pull request? #239 Method to enable CatalogUpdateRequired from js
nope. the onCatalogWrite will trigger when a catalog is written. it is written every time hummus is used to create a new pdf. modification scenarios it the exception, when no pages are added, cause in this case you can modify it direclty.
@chunyenHuang sorry. i saw the PR now. it's a good idea. i'll add sometimes soon. it allows you to force catalog updates in the cases when the catalog is not updated, which happens in modification schearios. it's a better alternative to writing it directly, because it hides the necessity to know about the logic of when catalog is updated or not. thanks for the reminder.
Sounds good! Thank you @marcelotavares
now in 1.0.85
Is it possible to generate/edit pdf with "Open in Full Screen mode" set: