logo
search
Other PDF Issues

How to Display a Google Drive PDF in Adobe View SDK

Khadija KhanKhadija Khan Oct 23, 2026 868 views

Question details

The user wants to embed a PDF hosted on Google Drive using the Adobe View SDK and needs to know if the standard sharing URL works.

How to Display a Google Drive PDF in Adobe View SDK
Product
Adobe View SDK, Google Drive
Device & OS
not provided
Scenario
Embedding a PDF file stored in Google Drive into a web application using Adobe View SDK.
Observed behavior
A standard Google Drive sharing URL cannot be used directly as a file URL because it points to a web viewer, not the raw PDF file.
Before you start

Ensure you have your Google Drive API credentials configured and the Adobe PDF Embed API client ID ready for your web application.

Solution 1Recommended

Fetch PDF Bytes via Google Drive API

Retrieve the actual file bytes using the Google Drive API and pass them as a Promise to the Adobe View SDK.

Google Drive sharing URLs are web pages, not direct file links. Because Adobe View SDK requires direct access to the raw file data, providing a standard sharing link will result in an error or a blank viewer.

To properly display the PDF, you must use the Google Drive API to download the file contents as a byte array, and then pass that array into the Adobe Embed API's content configuration.

1
Extract the Google Drive File ID

Locate the file ID from your Google Drive sharing URL. The ID is the long string of alphanumeric characters typically located between '/d/' and '/view'.

2
Call the Google Drive API

Using your backend or frontend application, make an authenticated GET request to the Google Drive API 'files.get' endpoint with the 'alt=media' parameter to download the PDF content as an ArrayBuffer.

3
Configure the Adobe View SDK Promise

In your Adobe PDF Embed API initialization code, define a Promise that resolves to the byte array you retrieved from Google Drive.

4
Pass the Bytes to the Viewer

Assign the Promise to the 'content.promise' property in the 'previewFile' method configuration of the Adobe View SDK, allowing it to render the raw PDF data.

Fetch PDF Bytes via Google Drive API
API Setup Requirements: You will need a Google Cloud project with the Drive API enabled to fetch the file bytes, and an Adobe Developer console project for your PDF Embed API credentials.
Free Microsoft Office alternative

Need a simpler way to view and manage PDFs? Try WPS Office

While embedding PDFs via developer SDKs requires complex API coding, managing your everyday PDF documents shouldn't. WPS Office provides a comprehensive, lightweight suite to read, edit, and convert PDFs alongside Word, Excel, and PowerPoint files—completely free.

  1. 1. Download WPS Office: Visit the official WPS website and click the download button for your operating system.
  2. 2. Install the Application: Run the downloaded installer and follow the on-screen instructions to complete the setup.
  3. 3. Open your PDFs: Set WPS Office as your default PDF reader to easily open, view, and manage your documents.
Free and lightweight desktop and mobile applicationFull compatibility with Microsoft Office formats and standard PDFsBuilt-in PDF reader and editor without complex configurationsSeamless synchronization across devices
microsoft office alternative - wps office

Frequently Asked Questions

Can I use a Google Drive direct download link in Adobe View SDK?

Direct download links from Google Drive often require authentication or issue a redirect, which causes CORS (Cross-Origin Resource Sharing) errors or fails to load in the SDK. Fetching the file as a byte array via the Google Drive API is the reliable and recommended approach.

Why does my Google Drive PDF link show a blank page in Adobe PDF Embed?

The standard sharing link loads an HTML web page containing the Google Drive viewer, not the actual PDF file itself. The Adobe PDF Embed API expects raw PDF file data or a direct URL terminating in a .pdf file, resulting in a blank page or rendering error when given a web page.

Do I need a Google Cloud account to use the Drive API for fetching PDFs?

Yes, to programmatically fetch file bytes using the Google Drive API, you must set up a project in the Google Cloud Console, enable the Drive API, and generate the necessary API keys or OAuth credentials to authenticate your application's requests.