box / box/box-content-preview

Box Preview use pdf library and pdf worker they get loaded on demand

Open
#953 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
120
Forks
137
Avg merge
12h 36m
Merged PRs (30d)
17

Description

I'm using **Preview.js** version 1.40.0 (https://cdn01.boxcdn.net/platform/preview/1.40.0/en-US/preview.js).

**Preview.js** loads third-party docs pdf.min.js, pdf.worker.min.js and pdf_viewer from cdn, the link to these JS files are generated according to version inside the library.

I want to check if PDF file is previewable before uploading it to the box, using pdf.js library i can detect wether file is corrupted or protected ( in other word not previewable ).

Does the **Preview.js API** provides the link to **pdf.js** library? or the version(1.17.0) used to generate the link?
for example: 'https://cdn01.boxcdn.net/platform/preview/third-party/doc/1.17.0/pdf.worker.min.js'

i want to use the same link that box preview library uses to reduce HTTP and to prevent loading the same library twice.

Thanks in advance.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the Preview.js 1.40.0 API and the generated CDN paths for pdf.min.js, pdf.worker.min.js, and pdf_viewer. Determine whether the PDF.js URL or version is exposed for reuse, and document the supported answer or integration path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.