On Mon, Nov 13, 2017 at 9:56 AM, Amarjeet Singh <[email protected]>
wrote:

> Hi Team,
>
> when I print any file using guacamole redirected printer, it always
> download the file instead of showing print preview.
> It is written to follow the above behavior
> .
> I looked into guacamole common js where it downloads with the help of
> iframe.
>

guacamole-common-js leaves the handling of downloads open to the
implementor using the API. If you're looking at code which leverages an
iframe for download, you are looking at the web application, not
guacamole-common-js.

I tried all the possible ways to edit the code and show the PDF files in
> iframe instead of downloading directly.
> It always downloads.
> Then I tried to change the url and gave the url of the PDF file from the
> server directly. It shows in the iframe and doesn't downloads.
> I came to know that there is something with the url which always tried to
> download.
> Any suggestions to resolve and show the PDF file in the iframe?
>

My suggestion would be to not attempt to override this behavior, and allow
the PDF to always download. Displaying the PDF within the browser is
problematic, and does not work identically across all browsers. Some will
display the PDF correctly, downloading the PDF only if no viewer is
present, others will display an empty iframe/tab even though a PDF viewer
is available or built-in, and yet others will silently fail with no way for
JavaScript to detect this.

Downloading the PDF directly is the only behavior which works universally.

- Mike

Reply via email to