I am trying to send pdf of my entire view to mail or to message. I used react native html to pdf. but now pdf file saving in this path = "/data/user/0/com.medicare/cache/test2371693044570821246.pdf". but when Open that cache folder its empty. and when I share "file" to mail or message using share. then its just sharing [object object] <= like this. please help me.tel me the solution for this. or please tell me another library or another way by using which I am able to send my entire View in pdf format to mail or message.
here is my code
export default class Example extends Component {
createPDF = async () => {
let options = {
html: "<h1>PDF TEST</h1>",
fileName: "test",
};
let file = await RNHTMLtoPDF.convert(options);
alert(file);
console.log(file);
Share.share({
title: "This is my report ",
message: `${file}`,
subject: "Report",
});
console.log("hoo");
};
render() {
return (
<View>
<TouchableHighlight onPress={this.createPDF}>
<Text>Create PDF</Text>
</TouchableHighlight>
</View>
);
}
}