I am performing a server-side redirect from my entry page to a PDF output summary to maintain view state (redirect = false):
ref = new PageReference('/apex/outputPDF?id=' + accountId); return ref;
I would like to use Chrome's built-in PDF reader so it opens a preview in Chrome rather than automatically downloading to a PDF. FWIW, Checking the box in Chrome settings to "Open PDF files in the default PDF viewer application" results in an automatic download without a preview.
The problem I am running into is that, when using the built-in reader, the only 'save as type' option is "Chrome HTML Document" and "All Files." And when I manually change the file extension from .htm to .pdf, the file will not open.
Viewing and saving works as expected when I open it through IE11, when I do a client-side redirect (redirect = true, which I don't want to do and flush the view state), and when I do a print to PDF (which I would prefer not to do, but is the current workaround). I should also add that using an iFrame as a workaround fixes the issue with Chrome, but is not compatible with IE, so I can't use that solution either. So I believe the issue is that I am viewing a PDF page without redirecting away from the non-PDF page and that is 'tricking' Chrome.
Is it possible to use Chrome's built-in PDF viewer, do a server-side redirect to my PDF page, and still be able to save as a PDF? Thanks!
Here is the apex:page line just in case it helps eliminate some potential issues:
<apex:page sidebar="false" showHeader="false" controller="Controller" renderAs="PDF" applyBodyTag="false" applyHtmlTag="false" standardStylesheets="false" contentType="application/pdf#outputPDF">