diff --git a/.prettierrc b/.prettierrc
index 3455ffe60..49e6b8e7e 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -9,10 +9,17 @@
"overrides": [
{
- files: ["tsconfig.json"],
- options: {
- parser: "json",
- },
+ "files": ["tsconfig.json", ".prettierrc"],
+ "options": {
+ "parser": "json"
+ }
},
+ {
+ "files": ["**/*.html"],
+ "options": {
+ "parser": "html",
+ "printWidth": 160
+ }
+ }
]
}
diff --git a/examples/components/pageviewer.html b/examples/components/pageviewer.html
index 267f8cc29..76f7e3684 100644
--- a/examples/components/pageviewer.html
+++ b/examples/components/pageviewer.html
@@ -1,4 +1,4 @@
-
+
-
-
-
-
- PDF.js page viewer using built components
+
+
+
+
+ PDF.js page viewer using built components
-
+
-
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
diff --git a/examples/components/simpleviewer.html b/examples/components/simpleviewer.html
index e6493263d..8504062d5 100644
--- a/examples/components/simpleviewer.html
+++ b/examples/components/simpleviewer.html
@@ -1,4 +1,4 @@
-
+
-
-
-
-
- PDF.js viewer using built components
+
+
+
+
+ PDF.js viewer using built components
-
+
-
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
diff --git a/examples/components/singlepageviewer.html b/examples/components/singlepageviewer.html
index 3636dbe77..3e71aad80 100644
--- a/examples/components/singlepageviewer.html
+++ b/examples/components/singlepageviewer.html
@@ -1,4 +1,4 @@
-
+
-
-
-
-
- PDF.js Single Page Viewer using built components
+
+
+
+
+ PDF.js Single Page Viewer using built components
-
+
-
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
diff --git a/examples/image_decoders/jpeg_viewer.html b/examples/image_decoders/jpeg_viewer.html
index 87f757bd6..a120efedd 100644
--- a/examples/image_decoders/jpeg_viewer.html
+++ b/examples/image_decoders/jpeg_viewer.html
@@ -1,4 +1,4 @@
-
+
-
-
-
-
- PDF.js standalone JpegImage parser
+
+
+
+
+ PDF.js standalone JpegImage parser
-
+
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/examples/learning/helloworld.html b/examples/learning/helloworld.html
index 6a74298f8..028fb015f 100644
--- a/examples/learning/helloworld.html
+++ b/examples/learning/helloworld.html
@@ -1,76 +1,71 @@
-
+
-
-
- 'Hello, world!' example
-
-
+
+
+ 'Hello, world!' example
+
+
+ 'Hello, world!' example
-'Hello, world!' example
+
-
+
-
+
- //
- // Render PDF page into canvas context
- //
- const renderContext = {
- canvasContext: context,
- transform,
- viewport,
- };
- page.render(renderContext);
-
-
-
-JavaScript code:
-
-
-
+
+ JavaScript code:
+
+
+
diff --git a/examples/learning/helloworld64.html b/examples/learning/helloworld64.html
index ed98e189f..5b833a2db 100644
--- a/examples/learning/helloworld64.html
+++ b/examples/learning/helloworld64.html
@@ -1,81 +1,77 @@
-
+
-
-
- 'Hello, world!' base64 example
-
-
+
+
+ 'Hello, world!' base64 example
+
+
+ 'Hello, world!' example
-'Hello, world!' example
+
-
+
-
+
- // Render PDF page into canvas context.
- var renderContext = {
- canvasContext: context,
- transform,
- viewport,
- };
- page.render(renderContext);
-
-
-
-JavaScript code:
-
-
-
+
+ JavaScript code:
+
+
+
diff --git a/examples/learning/prevnext.html b/examples/learning/prevnext.html
index e1043bf1e..5249d32aa 100644
--- a/examples/learning/prevnext.html
+++ b/examples/learning/prevnext.html
@@ -1,139 +1,134 @@
-
+
-
-
- Previous/Next example
-
-
+
+
+ Previous/Next example
+
+
+ 'Previous/Next' example
-'Previous/Next' example
+
+ Previous
+ Next
+
+ Page: /
+
-
- Previous
- Next
-
- Page: /
-
+
+
+
-
-
-
+
-
+
-
-
+ // Initial/first page rendering
+ renderPage(pageNum);
+
+
diff --git a/examples/mobile-viewer/viewer.html b/examples/mobile-viewer/viewer.html
index 6bd8b5406..1812db948 100644
--- a/examples/mobile-viewer/viewer.html
+++ b/examples/mobile-viewer/viewer.html
@@ -1,4 +1,4 @@
-
+
-
-
+
+
PDF.js viewer
-
-
+
+
@@ -46,12 +46,12 @@ limitations under the License.
-
+
-
+
diff --git a/examples/text-only/index.html b/examples/text-only/index.html
index 2acbd553e..410307cc8 100644
--- a/examples/text-only/index.html
+++ b/examples/text-only/index.html
@@ -1,14 +1,13 @@
-
+
-
-
+
+
Text-only PDF.js example
-
-
- Text-only PDF.js example
-
-
-
+
+
+ Text-only PDF.js example
+
+
diff --git a/examples/webpack/index.html b/examples/webpack/index.html
index ed25387f2..a9ba7bd12 100644
--- a/examples/webpack/index.html
+++ b/examples/webpack/index.html
@@ -1,11 +1,11 @@
-
+
-
-
- webpack example
-
-
-
-
-
+
+
+ webpack example
+
+
+
+
+
diff --git a/extensions/chromium/options/options.html b/extensions/chromium/options/options.html
index bd18c2456..e83db6c62 100644
--- a/extensions/chromium/options/options.html
+++ b/extensions/chromium/options/options.html
@@ -15,171 +15,171 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-PDF.js viewer options
-
-
-
-
-Restore default settings
+
+
+ PDF.js viewer options
+
+
+
+
+ Restore default settings
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
- Use system theme
- Light theme
- Dark theme
-
-
-
-
+
+
+
+
+
+ Use system theme
+ Light theme
+ Dark theme
+
+
+
+
-
-
-
-
-
- Default
- Show previous position
- Show initial position
-
-
-
-
+
+
+
+
+
+ Default
+ Show previous position
+ Show initial position
+
+
+
+
-
-
-
-
-
- Automatic Zoom
- Actual Size
- Page Fit
- Page Width
-
- 50%
- 75%
- 100%
- 125%
- 150%
- 200%
- 300%
- 400%
-
-
-
-
+
+
+
+
+
+ Automatic Zoom
+ Actual Size
+ Page Fit
+ Page Width
+
+ 50%
+ 75%
+ 100%
+ 125%
+ 150%
+ 200%
+ 300%
+ 400%
+
+
+
+
-
+
-
-
-
-
-
- Text selection tool
- Hand tool
-
-
-
-
+
+
+
+
+
+ Text selection tool
+ Hand tool
+
+
+
+
-
-
-
-
-
- Disable text selection
- Enable text selection
-
-
-
-
+
+
+
+
+
+ Disable text selection
+ Enable text selection
+
+
+
+
-
-
-
-
-
- Default
- Current window/tab
- New window/tab
- Parent window/tab
- Top window/tab
-
-
-
-
+
+
+
+
+
+ Default
+ Current window/tab
+ New window/tab
+ Parent window/tab
+ Top window/tab
+
+
+
+
-
-
-
-
-
- Default
- Page scrolling
- Vertical scrolling
- Horizontal scrolling
- Wrapped scrolling
-
-
-
-
+
+
+
+
+
+ Default
+ Page scrolling
+ Vertical scrolling
+ Horizontal scrolling
+ Wrapped scrolling
+
+
+
+
-
-
-
-
-
- Default
- No spreads
- Odd spreads
- Even spreads
-
-
-
-
+
+
+
+
+
+ Default
+ No spreads
+ Odd spreads
+ Even spreads
+
+
+
+
-
-
+
+
diff --git a/external/builder/builder.mjs b/external/builder/builder.mjs
index 929a9cf87..b81ee107d 100644
--- a/external/builder/builder.mjs
+++ b/external/builder/builder.mjs
@@ -151,7 +151,7 @@ function preprocess(inFilename, outFilename, defines) {
let state = STATE_NONE;
const stack = [];
const control =
- /^(?:\/\/|\s*\/\*|)?$)?/;
+ /^(?:\/\/|\s*\/\*|\s*)?$)?/;
while ((line = readLine()) !== null) {
++lineNumber;
@@ -213,7 +213,7 @@ function preprocess(inFilename, outFilename, defines) {
) {
writeLine(
line
- .replaceAll(/^\/\/|^$/g, "")
);
diff --git a/gulpfile.mjs b/gulpfile.mjs
index 196f5f214..9717a334a 100644
--- a/gulpfile.mjs
+++ b/gulpfile.mjs
@@ -2023,7 +2023,7 @@ gulp.task(
gulp.task("lint", function (done) {
console.log();
- console.log("### Linting JS/CSS/JSON/SVG files");
+ console.log("### Linting JS/CSS/JSON/SVG/HTML files");
// Ensure that we lint the Firefox specific *.jsm files too.
const esLintOptions = [
@@ -2047,9 +2047,10 @@ gulp.task("lint", function (done) {
const prettierOptions = [
"node_modules/prettier/bin/prettier.cjs",
"**/*.json",
+ "**/*.html",
];
if (process.argv.includes("--fix")) {
- prettierOptions.push("--log-level", "silent", "--write");
+ prettierOptions.push("--log-level", "error", "--write");
} else {
prettierOptions.push("--log-level", "warn", "--check");
}
diff --git a/test/font/font_test.html b/test/font/font_test.html
index c8b09b700..4b8d5abcd 100644
--- a/test/font/font_test.html
+++ b/test/font/font_test.html
@@ -1,25 +1,24 @@
-
+
-
- PDF.js font tests
+
+ PDF.js font tests
-
+
-
-
+
+
-
-
-
-
-
+
+
+
+
diff --git a/test/resources/reftest-analyzer.html b/test/resources/reftest-analyzer.html
index 00f9eaa0d..2dcc77421 100644
--- a/test/resources/reftest-analyzer.html
+++ b/test/resources/reftest-analyzer.html
@@ -1,4 +1,4 @@
-
+
-
- Reftest analyzer
-
-
-
-
-
-
-
Reftest analyzer
-
- Paste your log into this textarea:
-
-
-
-
- ...or load it from a file:
-
-
-
- Loading log...
-
-
-
-
-
-
- Pixel at:
-
-
-
- Test:
-
-
-
-
- Reference:
-
-
-
-
-
-
-
?
-
-
Move the mouse over the reftest image on the right to show
- magnified pixels on the left. The color information above is for
- the pixel centered in the magnified view.
-
The test is shown in the upper triangle of each pixel and
- the reference is shown in the lower triangle.
+
+
Reftest analyzer
+
+
+
+
+
+
+
Reftest analyzer
+
+ Paste your log into this textarea:
+
+
+
+
+ ...or load it from a file:
+
+
+
+
Loading log...
+
+
+
+
+
+
+ Pixel at:
+
+
+
+ Test:
+
+
+
+
+ Reference:
+
+
+
+
+
+
+
+ ?
+
+
+ Move the mouse over the reftest image on the right to show magnified pixels on the left. The color information above is for the pixel centered
+ in the magnified view.
+
+
The test is shown in the upper triangle of each pixel and the reference is shown in the lower triangle.
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
diff --git a/test/test_slave.html b/test/test_slave.html
index 8d202ce37..b8eb0beea 100644
--- a/test/test_slave.html
+++ b/test/test_slave.html
@@ -1,4 +1,4 @@
-
+
-
-
+
+
PDF.js viewer
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
-
+
-
-
-
-
+
+
+
-
+
@@ -119,16 +117,21 @@ See https://github.com/adobe-type-tools/cmap-resources
-
+
-
-
+
+
+
+
+
+
-
-
-
+
+
+
+
diff --git a/web/viewer-snippet-chrome-extension.html b/web/viewer-snippet-chrome-extension.html
index 5c8b404c8..3187cd495 100644
--- a/web/viewer-snippet-chrome-extension.html
+++ b/web/viewer-snippet-chrome-extension.html
@@ -1,4 +1,4 @@
-
-
+
+
diff --git a/web/viewer-snippet-chrome-overlays.html b/web/viewer-snippet-chrome-overlays.html
index 1089963d1..fff0eb2f3 100644
--- a/web/viewer-snippet-chrome-overlays.html
+++ b/web/viewer-snippet-chrome-overlays.html
@@ -4,7 +4,9 @@
users with recognizing which checkbox they have to click when they
visit chrome://extensions.
-->
-
- Click on
- "Allow access to file URLs "
- at
+ word-break: break-all;
+ "
+ >
+ Click on "Allow access to file URLs " at
chrome://extensions
-
+
to view this PDF file.
diff --git a/web/viewer-snippet.html b/web/viewer-snippet.html
index 3baf94773..15d0d71a4 100644
--- a/web/viewer-snippet.html
+++ b/web/viewer-snippet.html
@@ -1,3 +1,3 @@
-
+
diff --git a/web/viewer.html b/web/viewer.html
index 1ee1a4c4e..e56f02441 100644
--- a/web/viewer.html
+++ b/web/viewer.html
@@ -1,4 +1,4 @@
-
+
-
-
-
-
-
+
+
+
+
+
PDF.js viewer
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
@@ -105,17 +105,53 @@ See https://github.com/adobe-type-tools/cmap-resources
-
+
+
@@ -677,8 +984,12 @@ See https://github.com/adobe-type-tools/cmap-resources
-
-
+
+
+
+
+
+
@@ -696,7 +1007,9 @@ See https://github.com/adobe-type-tools/cmap-resources
-
+
+
+
@@ -708,13 +1021,37 @@ See https://github.com/adobe-type-tools/cmap-resources
-
-
-
+
+
+
-
+
@@ -760,58 +1109,68 @@ See https://github.com/adobe-type-tools/cmap-resources
-
+
+
+
-
-
+
+
+
+
+
+
-
+
-
-
+
@@ -841,9 +1201,10 @@ See https://github.com/adobe-type-tools/cmap-resources
-
-
-
+
+
+
+