Javascript 将iframe中的PDF内容复制到嵌入元素

Javascript 将iframe中的PDF内容复制到嵌入元素,javascript,pdf,iframe,embed,Javascript,Pdf,Iframe,Embed,首先,我不知道这是否可行,但如果可行,那就太棒了 我需要复制iframe内容,它显示的是当前动态创建的pdf,我的意思是我在iframe的src属性中输入了一个url,这个url会返回一个类似嵌入元素的pdf文件 差不多 <iframe src="http://webservice.pdf.com/getpdf/product/1" type="application/pdf" > // this is the iframe that have the pdf file genera

首先,我不知道这是否可行,但如果可行,那就太棒了

我需要复制iframe内容,它显示的是当前动态创建的pdf,我的意思是我在iframe的src属性中输入了一个url,这个url会返回一个类似嵌入元素的pdf文件

差不多

<iframe src="http://webservice.pdf.com/getpdf/product/1" type="application/pdf" > // this is the iframe that have the pdf file generated on the fly
抄送:

<embed src="product1.pdf" type="application/pdf">
我假设可以将iframe内容转换为编码base 64或类似的内容。问题是我正在使用Internet Explorer 11,而这个浏览器正在杀死我

实现这一点的想法或其他替代方案


提前感谢

您不想直接设置嵌入src吗?在嵌入中设置src的问题是,服务将再次尝试生成pdf文件,而此服务将再次生成此pdf:\如何尝试使用javascript获取文件并将其加载到两个元素?您是指先存储,然后显示pdf文件