We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Force PDF to Open in System Viewer in Chrome

When a PDF document is opened in Chrome, it may open using the Chrome PDF Viewer but it doesn’t always render correctly. If you open the PDF in the System Viewer it renders correctly. Is there a way to programmatically force Chrome to always open the PDF in the System Viewer? I know there is a setting in Chrome a user can set to do open in the System Viewer, but I prefer not rely on the user to change it I prefer to do it programmatically. Below is my code.

            'Save the document
            Dim converter As Aspose.Pdf.Facades.PdfConverter = New Aspose.Pdf.Facades.PdfConverter
            Dim pdfSettings As New Aspose.Pdf.Devices.TiffSettings
            Dim pdfResolution As New Aspose.Pdf.Devices.Resolution(200)
            pdfSettings.Compression = Aspose.Pdf.Devices.CompressionType.CCITT4
            pdfSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Format1bpp

            converter.BindPdf(savePDFPath & savePDFName)
            converter.Resolution = pdfResolution
            If isPageLandscape = True Then
                converter.SaveAsTIFF(savePDFPath & saveTIFName, 2200, 1700, pdfSettings)
                converter.SaveAsTIFF(savePDFPath & saveTIFName, 1700, 2200, pdfSettings)
            End If
            pdfSettings = Nothing
            converter = Nothing

            Dim pdfDocument As Aspose.Pdf.Document = New Aspose.Pdf.Document(savePDFPath & savePDFName)
            Kill(savePDFPath & savePDFName)
            Dim pdfSaveOptions As Aspose.Pdf.SaveOptions = New Aspose.Pdf.PdfSaveOptions

            pdfDocument.Save(Response, clientPDFName, Aspose.Pdf.ContentDisposition.Attachment, pdfSaveOptions)

There is no way to set Chrome browser settings to open PDF in the default viewer application. Aspose.Pdf API works to customize PDF documents, and this task is not relevant to Aspose.Pdf API. Please let us know in case of any confusion or questions.

Best Regards,
Imran Rafique