我有ReactNative应用。我可以将应用程序的主屏幕/视图保存为PDF或任何其他可打印文件格式吗?
@@ React Bala,
使用react-native-view-shot组件。
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)
);
您获得了图像URI
之后
使用此组件将图像转换为pdf ...