React-pdf: Barcode throwing error

Created on 16 Dec 2018  路  6Comments  路  Source: diegomura/react-pdf

Hi, I want to show a barcode in the pdf document.
I used the component from "react-barcode"

But this component renders a svg element in the background, and I suppose only View, Text components are available within react-pdf, so it's throwing an error.

Is there a way to show it?

Most helpful comment

I tried to use the current beta version (2.0.0-beta.5) from npmjs but I couldn't get it to work.
Could you please provide an example for using react-pdf in combination with react-barcode?

All 6 comments

Hey.
The only way right now would be getting the svg as a jpeg or png image. Unfortunately svg are not supported right now (#29) but I plan to work on this soon!

@moparlakci Did you figure out how to do this? I'm trying to do the exact same thing. Can't figure out how to get a jpeg or png from 'react-barcode'.

Is this fixed ?

SVGs are supported on 2.0. It's currently on npm as a beta version. Feel free to try rendering barcodes!

I tried to use the current beta version (2.0.0-beta.5) from npmjs but I couldn't get it to work.
Could you please provide an example for using react-pdf in combination with react-barcode?

is there a sample with react-barcode?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kishaningithub picture kishaningithub  路  4Comments

pavle-lekic-htec picture pavle-lekic-htec  路  4Comments

idrisadetunmbi picture idrisadetunmbi  路  3Comments

DuncanMacWeb picture DuncanMacWeb  路  4Comments

emt1803 picture emt1803  路  3Comments