Reactjs react中是否有任何高效的pdf库可以从api获取base64内容并以pdf格式显示输出?
我在React中使用了一个名为React pdf的库,其中包含一个组件文档。文档组件包含一个名为file的属性(其输入类型为string)。如何将作为base64内容的响应(来自redux的道具)从api传递到文档的file属性?。那么,是否有任何库从api接受我的base64内容并以pdf文档显示输出 以下是示例代码:Reactjs react中是否有任何高效的pdf库可以从api获取base64内容并以pdf格式显示输出?,reactjs,react-redux,react-pdf,Reactjs,React Redux,React Pdf,我在React中使用了一个名为React pdf的库,其中包含一个组件文档。文档组件包含一个名为file的属性(其输入类型为string)。如何将作为base64内容的响应(来自redux的道具)从api传递到文档的file属性?。那么,是否有任何库从api接受我的base64内容并以pdf文档显示输出 以下是示例代码: import { connect } from 'react-redux'; import { Document } from 'react-pdf'; import { p
import { connect } from 'react-redux';
import { Document } from 'react-pdf';
import { pdfData } from '../Store/ActionCreators'
class Billing extends React.Component {
componentDidMount() {
this.props.pdfData(mobile);
}
render() {
const { base64 } = this.props;
return (
<Document file=''>
</Document>
)
}
}
const mapStateToProps = state => ({
base64: state.login.data
})
export default connect(mapStateToProps, { pdfData })(Billing);
从'react redux'导入{connect};
从'react pdf'导入{Document};
从“../Store/ActionCreators”导入{pdfData}
类。组件{
componentDidMount(){
this.props.pdfData(移动);
}
render(){
const{base64}=this.props;
返回(
)
}
}
常量mapStateToProps=状态=>({
base64:state.login.data
})
导出默认连接(MapStateTops,{pdfData})(计费);
若我将base64传递给文件,那个么它会将其视为字符串并作为base64输出
有没有相关的解决方案来有效地解决这个问题