Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer image asking for src.width and height #822

Open
alexaung opened this issue Jun 1, 2018 · 0 comments
Open

buffer image asking for src.width and height #822

alexaung opened this issue Jun 1, 2018 · 0 comments

Comments

@alexaung
Copy link

alexaung commented Jun 1, 2018

I try to add buffed image that return from api but I got the following error.

const generateChart = (y: number) => {
        http.get(`http://localhost:8000/invoices/${39}/chart`, function (error: string, response: any, body: any) {
            doc.image(body, dpi(18), dpi(y + 6), { width: 100, height: 100 });
        });
    }

TypeError: Cannot read property 'width' of undefined
at PDFDocument.image (C:\My App\ReactNative\kirin.migrate\node_modules\pdfkit\js\mixins\images.js:27:16)
at ClientRequest. (C:\My App\ReactNative\kirin.migrate\pdf.ts:95:17)
at ClientRequest.g (events.js:292:16)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:473:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
at Socket.socketOnData (_http_client.js:362:20)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant