搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

此討論串已經關閉並封存。 如果您有需要幫助,請新增一個新問題

How to print tiff image using javascript

  • 無回覆
  • 1 有這個問題
  • 2 次檢視
more options

Please continue with revised /questions/1065015 ~J99


Hi, I am using html button print tiff image. When I click on "Print" button new window gets opened. Below is the code

       var printThis = ""
       win = window.open();
       self.focus();
       win.document.open();
       win.document.write('<style>body { font-family: Verdana; font-size: 10pt; }</style>');
        win.document.html(printThis);
        win.document.write('');
       win.document.close();
       win.print();
       win.close();

this code do not show any image on new window. If I replace "printThis" as below

         var printThis = '<embed id="pre" access="4" src="' + imgName + '" type="image/tiff" width="100%" />';

It will show me image but, If I print the page then it will do not print anything.

I am using AlternaTIFF to show tiff images. please suggest me solution for this. I am not getting answer on this.

Please continue with revised [/questions/1065015] ~J99 ----- Hi, I am using html button print tiff image. When I click on "Print" button new window gets opened. Below is the code var printThis = "<img src='image.tiff' width='100%'>" win = window.open(); self.focus(); win.document.open(); win.document.write('<html><head><style>body { font-family: Verdana; font-size: 10pt; }</style></head><body>'); win.document.html(printThis); win.document.write('</body></html>'); win.document.close(); win.print(); win.close(); this code do not show any image on new window. If I replace "printThis" as below var printThis = '<embed id="pre" access="4" src="' + imgName + '" type="image/tiff" width="100%" />'; It will show me image but, If I print the page then it will do not print anything. I am using AlternaTIFF to show tiff images. please suggest me solution for this. I am not getting answer on this.

由 John99 於 修改