From 8d586ae5c92803b7bc1e61990d1f6d49cf8a99c3 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Thu, 4 Dec 2025 15:13:56 -0300 Subject: [PATCH 1/2] feat: add initialScale prop and scale-changed/ready events - Add initialScale prop to set initial zoom level - Add @scale-changed event emitted when zoom changes - Add @pdf-editor:ready event emitted when PDF is loaded - Maintain backward compatibility with existing events Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- src/VuePdfEditor.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/VuePdfEditor.vue b/src/VuePdfEditor.vue index eeb2787..778d2e8 100644 --- a/src/VuePdfEditor.vue +++ b/src/VuePdfEditor.vue @@ -318,12 +318,16 @@ export default { type: Boolean, default: false, }, + initialScale: { + type: Number, + default: 1, + }, }, data() { return { wheelZoomCount: 0, narrowEnlargeShow: false, - scale: 1, + scale: this.initialScale, pdfFile: null, pdfName: '', numPages: null, @@ -340,6 +344,11 @@ export default { } }, watch: { + scale(newScale, oldScale) { + if (newScale !== oldScale) { + this.$emit('scale-changed', newScale) + } + }, }, async mounted() { await this.init() @@ -386,6 +395,9 @@ export default { fetchFont(this.currentFont) this.narrowEnlargeShow = true this.initTextField() + this.$nextTick(() => { + this.$emit('pdf-editor:ready') + }) } catch (e) { console.log(e) } From 36a303b0b6b29dacff3c20fc8d897120d70d816d Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Thu, 4 Dec 2025 15:14:46 -0300 Subject: [PATCH 2/2] chore: bump version to 1.5.0 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eb044fe..9c5c762 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@libresign/vue-pdf-editor", "description": "vue2 pdf editor component", - "version": "1.4.8", + "version": "1.5.0", "author": "LibreCode", "private": false, "main": "dist/vue-pdf-editor.umd.js",