SimplePDF / simplepdf-embed

PDF editor in the browser – add text, checkboxes, pictures, signatures to PDF files. Merge, rotate PDF pages – iframe, script and React component
https://simplepdf.com/embed
MIT License
245 stars 27 forks source link

feat: auto-open & iframe communications #10

Closed bendersej closed 1 week ago

bendersej commented 1 week ago

Background

This PR introduces the ability to enable and disable the auto-open: attaching listeners to anchors element.

Up until now this mechanism was handled automatically and not configurable. This is a requirement for the upcoming feature on the Chrome extension to automatically open PDF documents on a given tab

Additionally, the way documents are loaded is improved: instead of proxying the specified document to the server to bypass possible CORS, we attempt to fetch the document locally, and only use the CORS proxy as a fallback.

On top of drastically speeding up loading documents, this also paves the way for programmatically interacting with the editor.

Changes