0

I have a web page with PDF and I need to open a print preview dialog from javascript in Chrome browser. Basically I need to do like a click on print button in Chrome's PDF viewer. PDF is displayed in embed element.

In IE I just call print method of the embed element and it works fine, but apparently in Chrome there is no such method...

<embed id="previewDoc" src="https://blog.mozilla.org/security/files/2015/05/HTTPS-FAQ.pdf" type="application/pdf" width="750px" height="750px"></embed>

Is it possible at all to do that? I found an answer to similar question https://stackoverflow.com/a/27047724/1157249, but the only suggestion it has is to embed some action into PDF itself...

Alex K
  • 187
  • 1
  • 12
  • 1
    Assuming it's the same origin, you could use an iframe... – Joe DF Jun 20 '19 at 19:01
  • 1
    Joe DF, looks like you right... So far the only workaround that I found is using iframe https://stackoverflow.com/a/20240762/1157249 – Alex K Jun 20 '19 at 19:52

0 Answers0