Releases: gspasov/svelte-pdf-simple
Releases · gspasov/svelte-pdf-simple
Release v2.0.0
This release introduces BREAKING CHANGES.
- Removing
next
/prev
functions/events forgoToPage
andpage_changed
. Now uses can move to any page not just forwards and backwards one page at a time. - Added rotation api to allows users to rotate PDF. + landscape and upside-down PDFs were not displayed correctly
- Added better types for props, slots and events
- Styles for canvas can now be passed directly
- Unified error type
- Fixed some bugs
More information on what it brings could be found in this PR - #3
Release v1.0.7
Features added
PdfViewer
now exportsresize
function for custom resizing of the PDF after it's been fully loaded. Really useful for setting up zoom functionality.
Release v1.0.6
Breaking Changes
pdfUrl
is now changed forurl
.pdfBin
is now changed fordata
.loaded
is now changed forload_success
.
Features added
- New
load_failure
dispatch event. Used to notify if PDF was failed to load. - New
password_required
dispatch event. Used to notify if the PDF is password protected. - New
incorrect_password
dispatch event. Used to notify that the provided password to unlock the PDF is incorrect. - Exports new function
openWithPassword/1
. Used to try to open a locked PDF with a provided password. Usually to be used in conjunction withpassword_required
slot. - New
password_required
slot. Used to display HTML for when the PDF is password protected. Ideal place to holdinput
for provided necessary password.
New props
url
for loading PDF frompath
orurl
.data
for loading binary/Base64 encoded PDF.password
for providing password for locked PDF.httpHeaders
for providing headers when accessing a pdf from Url that requires auth credentials.additionalProperties
for all other properties for initializing apdfjs
Document.
Misc
- Proper setup of types for
pdfjs
. - Proper setup of SvelteKit to handle the project as library. With these changes we no longer need an example svelte project for demo.
- Improved overall logic.
Release v1.0.5
Switching to svelte-kit for building the package.
This way types are build automatically by Svelte and there is no need for manual creation of .js
or .d.ts
files.
Types are now directly taken from pdfjs-dist
which are up to date.
For example now annotations are properly typed as Record<string, unknown>[]
Release v1.0.4
- Exposing
annotations
when pdf has forms; - Exposing
textContents
of pdf; - Created proper types for dispatch functions (
next
,prev
,loaded
); - Added capability of using base64 encoded pdfs
Breaking changes
- Prop
pdf
can now be eitherpdfUrl
when using pdfs from path or url, orpdfBin
when using base64 encoded pdfs.
Release v1.0.3 ( Official first release )
Official first release of svelte-pdf-simple