This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function encodeSvgString(svg: string) { | |
const decoded = unescape(encodeURIComponent(svg)); | |
const b64String = btoa(decoded); | |
const imgSource = `data:image/svg+xml;base64,${b64String}`; | |
return imgSource; | |
} | |
export function svgToDataURI(svgData: string, renderWidth: number, renderHeight: number) { | |
const id = genUUID(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Document, Page, Text, View, StyleSheet, Svg, G, Rect } from '@react-pdf/renderer'; | |
const TestChart = ( | |
<Svg | |
style={{ fontFamily: "Helvetica", fontSize: "12px" }} | |
width="600" | |
height="600" | |
viewBox="0 0 600 600" | |
> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.