My problem is i'm trying to save pdf file with 'on-fly-rendering' and utf8 font not working. But when displaying same pdf in render works fine.
Create pdf:
Font.register({
family: "Roboto",
src:
"https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-light-webfont.ttf"
});
const styles = StyleSheet.create({
page: {
flexDirection: 'row',
backgroundColor: '#E4E4E4',
fontFamily: "Roboto",
},
section: {
margin: 10,
padding: 10,
flexGrow: 1
}
});
Showing and saving pdf:
<PDFViewer>
<MyDocument data={data} />
</PDFViewer>
<PDFDownloadLink document={<MyDocument data={data}/>} fileName="lista_składników.pdf">
{({ blob, url, loading, error }) => (loading ? 'Loading document...' : 'zapisz pdf')}
</PDFDownloadLink>

