Skip to content

Commit bb65b6a

Browse files
authored
Merge pull request #153 from LibreSign/chore/make-possible-use-src-or-object
chore: make possible use src or object
2 parents 9e43ad0 + e818b6a commit bb65b6a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/VuePdfEditor.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ export default {
282282
type: String,
283283
default: '',
284284
},
285+
initFile: {
286+
type: [File, Blob, ArrayBuffer],
287+
default: null,
288+
},
285289
initFileName: {
286290
type: String,
287291
default: '',
@@ -371,12 +375,13 @@ export default {
371375
this.scale = parseFloat((this.scale - 0.1).toFixed(1))
372376
},
373377
async init() {
374-
if (!this.initFileSrc) {
378+
const file = this.initFile || this.initFileSrc
379+
if (!file) {
375380
console.log('init file is not exist')
376381
return
377382
}
378383
try {
379-
await this.addPDF(this.initFileSrc)
384+
await this.addPDF(file)
380385
this.selectedPageIndex = 0
381386
fetchFont(this.currentFont)
382387
this.narrowEnlargeShow = true

0 commit comments

Comments
 (0)