arkokoley/pdfvuer

VuePdf.createLoadingTask is not a function on 1.9.1

mesqueeb opened this issue · 3 comments

I previously had this logic:

import VuePdf from "pdfvuer"

// ...

async calculatePdfPageNumber() {
            const { resources } = this
            const [resource] = resources
            if (!resource || resource?.type !== "pdf" || !resource.url) return
            const pdfdata = await VuePdf.createLoadingTask(resource.url)
            this.pageCount = pdfdata.numPages
        },

But now that "main" is a Vue file, I'm not able to import this function VuePdf.createLoadingTask.
Any advice on how to best approach this?

I advise you point "main" towards a file like so:

export { VuePdf, createLoadingTask }

that way we can import either the helper function or the Vue Component:

import { VuePdf } from 'pdfvuer'

If you want I can make a PR that does this. It would be breaking though : S

Can you try v1.9.2. This should still work.

@arkokoley fixed for me on 1.9.2!