react-native-pdf-to-image
Version:
A react native plugin to convert PDF pages to images
35 lines (34 loc) • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.convert = convert;
exports.convertB64 = convertB64;
exports.default = void 0;
exports.printPDF = printPDF;
var _reactNative = require("react-native");
const LINKING_ERROR = `The package 'react-native-pdf-to-image' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
ios: "- You have run 'pod install'\n",
default: ''
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
const PdfToImage = _reactNative.NativeModules.PdfToImage ? _reactNative.NativeModules.PdfToImage : new Proxy({}, {
get() {
throw new Error(LINKING_ERROR);
}
});
function convert(uri) {
return PdfToImage.convert(uri);
}
function convertB64(base64Str, dpi) {
return PdfToImage.convertB64(base64Str, dpi);
}
function printPDF(ip, port, base64Str) {
return PdfToImage.printPDF(ip, port, base64Str);
}
var _default = {
convert,
convertB64,
printPDF
};
exports.default = _default;
//# sourceMappingURL=index.js.map