How to Display a Google Drive PDF in Adobe View SDK
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.

- 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.
Ensure you have your Google Drive API credentials configured and the Adobe PDF Embed API client ID ready for your web application.
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.
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'.
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.
In your Adobe PDF Embed API initialization code, define a Promise that resolves to the byte array you retrieved from Google Drive.
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.

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. Download WPS Office: Visit the official WPS website and click the download button for your operating system.
- 2. Install the Application: Run the downloaded installer and follow the on-screen instructions to complete the setup.
- 3. Open your PDFs: Set WPS Office as your default PDF reader to easily open, view, and manage your documents.

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.




