I have ReactNative app. Could I save app's main screen/view in PDF or in any other printable file format?
1 Answer
@React Bala,
Use react-native-view-shot component.
https://github.com/gre/react-native-view-shot
import RNViewShot from "react-native-view-shot";
RNViewShot.takeSnapshot(viewRef, {
format: "jpeg",
quality: 0.8
})
.then(
uri => console.log("Image saved to", uri),
error => console.error("Oops, snapshot failed", error)
);
You got image URI
After
use this component for convert image to pdf...
1 Comment
React Bala
Thank you but error is displaying(Im using android tab) [Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNativeHtmlToPdf.default.convert')]