diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index ecba4d8..c0ac526 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -31,7 +31,7 @@ const config = { { text: "Learn PDF.js", items: [ - { text: "Learned Knowledge", link: "/learned-knowledge" }, + { text: "Learned Knowledge", link: "/learned-knowledge/" }, { text: "Architecture", link: "/architecture" }, { text: "Common Pitfalls", link: "/pitfalls" }, ], diff --git a/docs/learned-knowledge.md b/docs/learned-knowledge/app-options.md similarity index 78% rename from docs/learned-knowledge.md rename to docs/learned-knowledge/app-options.md index 26c2fb9..206fc94 100644 --- a/docs/learned-knowledge.md +++ b/docs/learned-knowledge/app-options.md @@ -1,8 +1,4 @@ -# Acknowledge - -> This is all I learned from the PDF.js. It may not be accurate, but I hope it can help you to understand the PDF.js better. - -## AppOptions +# AppOptions There are dozens of times options in PDF.js, and they all belong to four kinds for now. You may wonder why there are so many options, and what they mean at the first time. This document will help you to understand them. diff --git a/docs/learned-knowledge/application.md b/docs/learned-knowledge/application.md new file mode 100644 index 0000000..3fb37c1 --- /dev/null +++ b/docs/learned-knowledge/application.md @@ -0,0 +1,4 @@ +# PDFViewerApplication + +The global `PDFViewerApplication` object is the entry of the default viewer of PDF.js, it glues all the modules +together, and provides the API for the user. diff --git a/docs/learned-knowledge/index.md b/docs/learned-knowledge/index.md new file mode 100644 index 0000000..d72f36a --- /dev/null +++ b/docs/learned-knowledge/index.md @@ -0,0 +1,29 @@ +# Acknowledge + +> There are critical comments about the PDF.js project, they say it should be easier to integrate the default +> viewer. I understand them somehow as a developer who want to show a PDF quickly, but knowing the primary goal +> of an OSS project can help us to understand the trade-off decisions made by the maintainers. +> +> All these are what I learned from the PDF.js project. It may not be accurate, but I hope it can help you to understand the PDF.js better. + +## Table of Contents + +### Background Introduction + +[PDF.js](https://github.com/mozilla/pdf.js) is an OSS project supported by Mozilla and developed using HTML5, +It's goal is to create a general-purpose, web standards-based platform for rendering PDFs in the **Firefox browser**. Many people find out that it's hard to integrate it into project, it's [somehow intentionally](#issues-talked-about-why-it-s-hard-to-integrate). + +It's not developed as a component or library you can easily integrate like most npm packages, because it's +primary goal is to be used easily in **Firefox browser**, the goal doesn't match most developers expectations. +It's the trade-off decision made by the maintainers, we should respect it. + +### Issues talked about why it's not easy to integrate + +- [Issue 5609](https://github.com/mozilla/pdf.js/issues/5609#issuecomment-68530552) +- [Issue 9210](https://github.com/mozilla/pdf.js/issues/9210#issuecomment-347834276) +- [Issue 7203](https://github.com/mozilla/pdf.js/issues/7203#issuecomment-210510569) + +## The Terms + +- [AppOptions](./app-options) +- [PDFViewerApplication](./application)