@open-file-viewer/core 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/dist/index.cjs +350 -108
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +350 -108
- package/dist/index.js.map +1 -1
- package/dist/style.css +60 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,6 +123,14 @@ pdfPlugin({
|
|
|
123
123
|
This keeps compatibility at the cost of holding one extra copy of the PDF in memory, so use it only
|
|
124
124
|
for affected environments.
|
|
125
125
|
|
|
126
|
+
For 360 Secure Browser, 360 Extreme Browser, and older Chromium kernels, `pdfPlugin()` defaults to
|
|
127
|
+
`compatibilityMode: "auto"`. It installs the `Promise.withResolvers` compatibility shim when needed
|
|
128
|
+
and selects the matching PDF.js legacy worker. If an enterprise browser hides its 360 user-agent
|
|
129
|
+
marker, force the compatibility path with `pdfPlugin({ compatibilityMode: "legacy" })`. When
|
|
130
|
+
self-hosting that worker, point `workerSrc` to the same-version
|
|
131
|
+
`pdfjs-dist/legacy/build/pdf.worker.min.mjs`. Use `compatibilityMode: "modern"` only when targeting
|
|
132
|
+
modern Chrome or Edge exclusively.
|
|
133
|
+
|
|
126
134
|
## High-Fidelity Office Conversion
|
|
127
135
|
|
|
128
136
|
Browser-side Office renderers cannot perfectly reproduce Word/WPS layout for files with anchored
|
|
@@ -251,7 +259,7 @@ Use `toolbar.render(ctx)` when you need to replace the toolbar completely. The c
|
|
|
251
259
|
|
|
252
260
|
## Locale and Fallback Text
|
|
253
261
|
|
|
254
|
-
|
|
262
|
+
Built-in states, fallback panels, toolbar labels, and plugin messages default to English. Set `locale: "zh-CN"` for Simplified Chinese, or override individual PDF, image, text, Office, and custom-plugin strings with `messages`:
|
|
255
263
|
|
|
256
264
|
```ts
|
|
257
265
|
createViewer({
|
|
@@ -260,12 +268,16 @@ createViewer({
|
|
|
260
268
|
locale: "zh-CN",
|
|
261
269
|
messages: {
|
|
262
270
|
unsupportedTitle: "No inline preview available",
|
|
263
|
-
downloadFile: "Download original file"
|
|
271
|
+
downloadFile: "Download original file",
|
|
272
|
+
pdfPreviewFailedTitle: "Unable to open report",
|
|
273
|
+
imageDownload: "Save original image"
|
|
264
274
|
},
|
|
265
275
|
plugins
|
|
266
276
|
});
|
|
267
277
|
```
|
|
268
278
|
|
|
279
|
+
The PDF viewer includes a synchronized page navigator with previous/next buttons and a numeric page input. Enter a page number and press Enter to jump directly to it.
|
|
280
|
+
|
|
269
281
|
## License
|
|
270
282
|
|
|
271
283
|
MIT
|