我正嘗試在Icenium中使用JsPdf中的圖像,它在控制檯中向我顯示以下錯誤,並且卡住了。嘗試訪問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圖像的任何其他方式。 謝謝你的幫助。