Skip to content

ERR_URL_NOT_PDF β€” URL Not PDF

HTTP Status: 400 Retryable: No Automatic retry: None. The same URL will return the same non-PDF content.

What the User Sees

The URL must point to a PDF file. (ERR_URL_NOT_PDF)

What Causes This Error

The fetched URL returned content that is not a PDF. The system validates the response using three checks: the Content-Type header (must be application/pdf or application/octet-stream), the URL extension (should end in .pdf), and the PDF magic bytes (the response body must start with %PDF).

The most common cause is users providing a URL to an HTML preview page rather than a direct download link. Many file hosting services (Google Drive, Dropbox, SharePoint) show a preview/viewer page at the main share URL, with the actual file download at a different URL.

Other causes include: the file at the URL is not actually a PDF (e.g., a Word document, image, or HTML page), the URL redirected to a login page (which returns HTML), or the remote server returned an error page (HTML) instead of the file.

Resolution Steps

For Users

  1. Make sure the URL points directly to the PDF file, not to a preview page or download portal. The URL should typically end in .pdf.
  2. Right-click the download button or link on the file hosting page and select β€œCopy link address” to get the direct download URL.
  3. For Google Drive: Use the format https://drive.google.com/uc?export=download&id=FILE_ID where FILE_ID is the ID from the sharing URL.
  4. For Dropbox: Change ?dl=0 to ?dl=1 at the end of the sharing URL.
  5. For OneDrive/SharePoint: Look for a β€œDirect link” or β€œDownload” option in the sharing settings.
  6. If you cannot obtain a direct link, download the file manually and upload it directly.

For Administrators

  1. No admin action is needed β€” this is user-side URL handling.
  2. The content validation logic checks Content-Type header, URL extension, and PDF magic bytes. All three checks are in the URL fetch handler.
  3. Consider adding more helpful error messages that detect common URL patterns (Google Drive preview URLs, Dropbox web URLs) and suggest the correct direct download URL format.
  4. If the Content-Type check is too strict (e.g., some servers send application/x-pdf or binary/octet-stream), consider expanding the allowed Content-Type values.