intbot / ng2-pdfjs-viewer

An angular component for PDFJS and ViewerJS (Supports all versions of angular)
Apache License 2.0
228 stars 113 forks source link

How do you access the PDF Document before it is rendered? #73

Open bpetty-formfast opened 4 years ago

bpetty-formfast commented 4 years ago

I have the requirement of updating some annotation fields before the page is rendered in order to prepopulate them with certain values. Using this library, is it possible?

Right now I am using the Viewer component. I assume there is no way as it is now to do that. If that is true, would the best route be to modify the viewer code directly?

codehippie1 commented 4 years ago

@bpetty-formfast You may look into the viewerjs and pdfjs files directly for this. This component is indented for viewer as is. Editing is out of scope.

A search on viewerjs yielded these line

eventBus.on('pagerendered', webViewerPageRendered);
    eventBus.on('textlayerrendered', webViewerTextLayerRendered);

Also I saw beforedraw function.

Hope this helps.