Dropbox Document Preview API Reaches General Availability

Dropbox has announced that its document preview API is now available to all developers after a period of beta testing with select partners. The new endpoint renders file previews in PDF or HTML format for popular document types including PDF, Microsoft Word, PowerPoint, and Excel, making it straightforward for mobile applications to showcase file content without transferring the full file to the device.

Acompli, which combines email, calendar, file sharing, and contacts into a single mobile experience, was an early adopter of the API. The company needed a reliable way to display file previews and let users attach files to email messages, but found on-device document rendering unreliable and bandwidth-heavy for larger files.

Two API Endpoints for File Previews

Acompli's integration uses two distinct Dropbox API endpoints:

  • /thumbnails — for image files, this endpoint generates oversized (xl) thumbnails suitable for a mobile image view.
  • /previews (new) — for document types supported by the new preview API, this endpoint produces a rendered preview in PDF or HTML.

Files that don't fit either category are handled by downloading the original document.

Better Rendering, Less Custom Code

According to Acompli cofounder and VP of Engineering Kevin Henrikson, the preview API delivered noticeably better rendering quality than their previous approach. The side-by-side comparison below shows two PowerPoint presentations rendered through different methods, with the new endpoint producing cleaner and more accurate output.

Before Dropbox document previews.
After Dropbox document previews.

The /previews endpoint also reduces the engineering effort needed to support document previews, eliminating much of the custom work previously required to produce usable previews in a mobile context.

Henrikson noted that the API was easy to work with and "produced beautiful results" right out of the gate, which helped Acompli extend its file-sharing feature to include Dropbox-hosted files without adding undue complexity to its mobile clients.