js将PDF转为base64格式,并在将base64格式PDF回显在页面中
js将PDF转为base64格式
"en"> "UTF-8"> "X-UA-Compatible" content="IE=edge"> "viewport" content="width=device-width, initial-scale=1.0">Document "file" onchange=‘handelChange(this)‘>
base64格式PDF回显在页面中
pdf转为base64,并回显for="i in numPages" :key="i" :src="src" :page="i" ref="myPdfComponent">
******注:
*****base64为去掉开头格式的base64 ,如‘JVBERi0xLjMNJeLjz9MNCjcgMCBvICAgICAgICAgICAgICAgICAgDQoyMSAwIG9.........................................(此处省略)’,
*****不包含 ‘data:application/........................(此处省略)‘
参考 https://blog.csdn.net/yuanmengdage/article/details/111871993
原文:https://www.cnblogs.com/-roc/p/14750732.html