Can Java Force a PDF to Open in Adobe Acrobat Instead of Chrome?
Question details
The developer wants a Java- or Oracle-generated PDF to open automatically in Adobe Acrobat DC rather than Chrome.

- Product
- Java-generated PDF, Google Chrome, and Adobe Acrobat DC
- Device & OS
- not provided
- Scenario
- A Java application delivers a PDF to a user, and the developer wants Acrobat to be the viewer.
- Observed behavior
- The PDF opens in Chrome instead of Adobe Acrobat DC.
Check whether the Java application serves the PDF through a browser and whether Adobe Acrobat DC is installed on the user's computer. Access to Chrome and operating system settings may be needed to change how the user opens the file.
Deliver the PDF as a Download from Java
Use PDF response headers to encourage a download instead of opening the file inline in Chrome.
A Java server can suggest how a PDF is delivered, but it cannot select Adobe Acrobat as the application on the user's computer.
In the Java HTTP response that sends the file, set Content-Type to application/pdf, for example with response.setContentType("application/pdf").
Set the response header Content-Disposition to attachment; filename="document.pdf", for example with response.setHeader("Content-Disposition", "attachment; filename=\"document.pdf\"").
Write the PDF bytes to the response output stream, then open the download link in Chrome and check that the file downloads.

Set Chrome to Download PDFs Instead of Opening Them
Use this option when the user controls Chrome and wants PDFs downloaded for opening in a desktop app.
Make Adobe Acrobat the Default PDF App
Configure the user's computer to open downloaded PDF files in Acrobat by default.
Open Downloaded PDFs with WPS Office
WPS Office is a free, lightweight alternative for viewing downloaded PDFs and working with office documents in a familiar interface. It supports common Microsoft Office formats for easier migration, but it cannot force a remote user's browser or computer to launch a particular PDF app.

Frequently Asked Questions
Can a Java HTTP response force a PDF to open in Acrobat?
No. Java can send the PDF with Content-Type and Content-Disposition headers, but the browser, operating system, and user's settings decide which application opens it.
What is the difference between inline and attachment for a PDF?
Content-Disposition: inline suggests displaying the PDF in the browser, while Content-Disposition: attachment suggests downloading it. Neither setting selects Adobe Acrobat.
Why does a PDF still open in Chrome after I set Acrobat as the default?
Chrome can use its built-in viewer for PDFs opened in the browser. To download them instead, check Chrome Settings > Privacy and security > Site settings > Additional content settings > PDF documents.
Will downloading a PDF automatically launch Acrobat?
Not necessarily. The PDF may remain in the Downloads list until the user opens it. If Acrobat is the default PDF app, opening the downloaded file from the computer should launch it in Acrobat.




