欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

iframe render pdf 更改工具栏,使文章填满,不显示后面的灰色部分

最编程 2024-04-30 09:49:18
...

1、不显示iframe工具栏,打印下载那些功能

                  <iframe 
                         :src="dataurl + 'toolbar=0'" 
                         width="100%"
                         height="100%"
                         frameborder="0">
                              <head>
                                   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
                              </head>
                         </iframe>

重点代码是: toolbar = 0

2、iframe 让文章占满 不显示后面的灰色背景

           <iframe 
                         :src="dataurl + '#view=FitH,top" 
                         width="100%"
                         height="100%"
                         frameborder="0">
                              <head>
                                   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
                              </head>
                         </iframe>

 重点代码是#view=FitH,top

3、如果要实现iframe 更改toolbar 和  文章占满 不显示后面的灰色

                <iframe 
                         :src="dataurl + '#view=FitH,top&toolbar=0'" 
                         width="100%"
                         height="100%""
                         frameborder="0">
                              <head>
                                   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
                              </head>
                         </iframe> 

其中的dataurl 是文件的路径