Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript PDF打印对话框获取空白页_Javascript_Angular_Typescript_Pdf_Printing - Fatal编程技术网

Javascript PDF打印对话框获取空白页

Javascript PDF打印对话框获取空白页,javascript,angular,typescript,pdf,printing,Javascript,Angular,Typescript,Pdf,Printing,我正在尝试使用window.print()在浏览器上打印以前的流式PDF文档 文档已加载,但当我绑定到使用windows.print()打印时(ctrl+p),预览时会出现空白页 我试着穿上iframe和嵌入或者改变样式、大小。。。但每次我都会看到空白页。 getPDF(pdfID:string){ var winparams='dependent=yes,locationbar=no,scrollbars=yes,menubar=yes',> var printWindow=window.o

我正在尝试使用window.print()在浏览器上打印以前的流式PDF文档

文档已加载,但当我绑定到使用windows.print()打印时(ctrl+p),预览时会出现空白页

我试着穿上iframe嵌入或者改变样式、大小。。。但每次我都会看到空白页。

getPDF(pdfID:string){
var winparams='dependent=yes,locationbar=no,scrollbars=yes,menubar=yes',>
var printWindow=window.open(“,”,winparams);
var-htmlop;
此.rs.grps(reportId).订阅(
(回应)=>{
this.pdfSrc=“数据:应用程序/pdf;base64”+响应;
调试器;
设置超时(()=>{
htmlPop='';
printWindow.document.write(htmlPop);
//window.print();
}, 1000);
}
);
设置超时(()=>{
printWindow.print();
printWindow.close();
}, 5000);   }
getPDF(pdfID: string) {   
 var winparams = 'dependent=yes,locationbar=no,scrollbars=yes,menubar=yes,' > 


 var printWindow = window.open("", "", winparams);
 var htmlPop;
 this.rs.grps(reportId).subscribe(
   (response) => {
     this.pdfSrc = "data:application/pdf;base64," + response;
     debugger;
     setTimeout(() => {
       htmlPop = '<embed style="display:block !important" width=100% height=100%'
         + ' type="application/pdf"'
         + ' src="'
         + this.pdfSrc
         + '"></embed>';


       printWindow.document.write(htmlPop);
      //window.print(); 
     }, 1000);

   }
 );
 setTimeout(() => {
   printWindow.print();
   printWindow.close();

 }, 5000);   }