Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
`,
fileName: 'paperWallet',
base64: true,
fonts: ['iota-wallet-shared-modules/custom-fonts/Inconsolata-Bold.ttf'],
};
try {
this.props.navigator.toggleNavBar({
to: 'shown',
});
if (isAndroid) {
await RNPrint.printhtml(options.html);
} else {
const results = await RNHTMLtoPDF.convert(options);
await RNPrint.print(results.filePath);
}
} catch (err) {
console.error(err);
}
}
componentDidMount() {
var options = {
html: '<h1>PDF TEST</h1>',
fileName: 'test'
};
RNHTMLtoPDF.convert(options).then((result) => {
RNMail.mail({
subject: '',
recipients: [''],
body: '',
attachmentPath: result,
attachmentType: 'pdf',
}, (error, event) => {
if(error) {
AlertIOS.alert('Error', 'Could not send mail. Please send a mail to support@example.com');
}
});
});
},