You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi there! great library. using it in react pdf, which requires us to use its own Svg and Path components. it would be useful to have an option to generate just the path of an svg without anything surrounding it. for reference, currently this is my workaround:
const generateQrCodePath = (content: string, size: number) => {
const htmlStr = new QRCode({ content, join: true, width: size, height: size }).svg({container: 'none'});
const parsableHtml = new DOMParser().parseFromString(htmlStr, 'text/html');
return parsableHtml.querySelector('html > body > rect > path')?.getAttribute('d') ?? '';
};
import QRCode from 'qrcode-svg';
...
// in react pdf
return (
<Svg>
<Path d={generateQrCodePath(content, size)} fill='black' />
</Svg>
);
The text was updated successfully, but these errors were encountered:
hi there! great library. using it in react pdf, which requires us to use its own
Svg
andPath
components. it would be useful to have an option to generate just the path of an svg without anything surrounding it. for reference, currently this is my workaround:The text was updated successfully, but these errors were encountered: