我正在尝试在 Icenium 中使用 JsPdf 中的图像,它在控制台中向我显示以下错误,我被卡住了。
Unsafe JavaScript attempt to access frame with URL data:application/pdf;base64,JVBERi0xLjMKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJ… NpemUgOAovUm9vdCA3IDAgUgovSW5mbyA2IDAgUgo+PgpzdGFydHhyZWYKNjk5CiUlRU9GCg== from frame with URL http://app.icenium.com/Mist/Workspace/pdf/Simulator?targetUrl=http%3A%2F%2F… Style=Default&allowedOrientation=Portrait%3BLandscape&fullResolution=false. The frame requesting access has a protocol of 'http', the frame being accessed has a protocol of ''. Protocols must match.
以下是我的js文件:
function demo1() {
var imgData ='data:image/jpeg;base64,/9j/.....';
//You'll need to make your image into a Data URL
// Use http://dataurl.net/#dataurlmaker
var doc = new jsPDF();
doc.setFontSize(40);
doc.text(35, 25, "Octonyan loves jsPDF");
doc.addImage(imgData, 'JPEG', 15, 40, 180, 180);
doc.output('datauri');
}
您能否告诉我如何进行此操作或任何其他可以在 Icenium 中以 pdf 格式获取图像的方式。感谢您的帮助。