Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_printHTMLLandscapeAsync = async () => {
return this._printHTMLAsync(Print.Orientation.landscape);
}
_printHTMLLandscapeAsync = async () => {
return this._printHTMLAsync(Print.Orientation.landscape);
};
_printHTMLAsync = async (orientation = Print.Orientation.portrait) => {
const { selectedPrinter } = this.state;
try {
await Print.printAsync({
html: 'Dear Friend! <b>Happy</b> Birthday, enjoy your day! 🎈',
printerUrl: selectedPrinter && selectedPrinter.url,
orientation,
});
} catch (e) {
Alert.alert('Something went wrong: ', e.message);
}
};
_printHTMLAsync = async (orientation: string = Print.Orientation.portrait) => {
const { selectedPrinter } = this.state;
try {
await Print.printAsync({
html: 'Dear Friend! <b>Happy</b> Birthday, enjoy your day! 🎈',
printerUrl: selectedPrinter && selectedPrinter.url,
orientation,
});
} catch (e) {
Alert.alert('Something went wrong: ', e.message);
}
}