Giter Site home page Giter Site logo

Comments (9)

chenghongyao avatar chenghongyao commented on July 1, 2024

建个文件夹bookviewer,再把webviewer放进去,然后使用bookviewer的http路径。

现在不自带http服务器了,得自己搭个服务,比如用hfs软件。

另外现在还是半成品,不建议使用。

from obsidian-bookmaster-plugin.

justemu avatar justemu commented on July 1, 2024

非常谢谢提示。我自建了http服务器,然后把[2.4]版本的webviewert添加到wwwroot下的一级子目录中去了。结果还是有错误如下。
image

但是使用: 81.68.152.226 则完全没问题。一定是我的webviewer文件夹的文件有版本兼容或配置的问题。能不能麻烦把81.68.152.226上的webviewer打个包放出来?


btw: 【2.4】已经做的很棒了。然而【2.4】的书库中,原pdf文件的目录结构一旦发生移动,以前做的笔记标注,就没办法用了。而【3.0】的标注文件都在统一的文件夹中。如果原始的pdf文件的目录结构发生移动,只需要在引用文件中修改相应的pathname属性就行了。我很喜欢【3.0】中的这种引用以来结构。相对来讲,更容易维护。这是很棒的设计。因此,我切换到了【3.0】。

from obsidian-bookmaster-plugin.

chenghongyao avatar chenghongyao commented on July 1, 2024

如果你是自己编译的,你可以在node_modules/@pdftron/webviewer/public找到对应的两个文件夹,复制过去应该就没问题。


使用id就是为了解决这个文件移动的问题,后面会加手动重定位和自动重定位。


再一次,3.0可能还会有很多改动(字段,链接格式等),玩一下就行,暂时不要使用。

from obsidian-bookmaster-plugin.

justemu avatar justemu commented on July 1, 2024

如果你是自己编译的,你可以在node_modules/@pdftron/webviewer/public找到对应的两个文件夹,复制过去应该就没问题。


使用id就是为了解决这个文件移动的问题,后面会加手动重定位和自动重定位。


再一次,3.0可能还会有很多改动(字段,链接格式等),玩一下就行,暂时不要使用。

我把自己编译的@PDFTron下面public的core和ui两个文件夹复制过去之后,就遇到了最开始提到的那个版本错误提示,然后无法显示pdf内容。
IMG_20220521_225127.jpg
worker的版本和API的版本不一致。不知道是怎么搞出来的问题。但是用你在线地址的那套文件就完全正常。

from obsidian-bookmaster-plugin.

chenghongyao avatar chenghongyao commented on July 1, 2024

这就奇怪了,这是 pdfjs 的版本。

webviewer 还是和0.2.4一样的,不过你可以试下更新 config.js 试试。

from obsidian-bookmaster-plugin.

justemu avatar justemu commented on July 1, 2024

这就奇怪了,这是 pdfjs 的版本。

webviewer 还是和0.2.4一样的,不过你可以试下更新 config.js 试试。

我已经通过浏览器的开发者工具,抓取了http://81.68.152.226:8863/webviewer/config.js。替换过去。同时还设置了configorigin.txt。然而分析了打开pdf文件时调用的文件是否一致?
结果还真的不太一致。
这是我编译的的pulbic文件夹中拷贝过来的版本core/pdf/lean
image

这个是0.2.4中的core/pdf/lean 。同时也是http://81.68.152.226:8863/上面的版本。
image

从文件的大小就能看出不是同一个版本。
于是我强行将0.2.4版本的webviewer包覆盖在我编译出来的public内的文件上。结果还是报错……


我觉得问题可能出在编译环境的组件引用的版本的不一致上。我的编译环境,可能调用了更新版本pdfjs组件。因此API和脚本中worker调用的版本不匹配了。导致打不开文件。

因此,只能彻底放弃我这边编译环境中public下的版本。改用0.2.4的webviewer文件,并替换config.js... 结果还是不行,多了DevTools 无法加载来源映射
image
原来,0.2.4的webviewer文件夹中是少了.map文件的。如下图
image
那么能不能用我编译环境中的public文件夹下面的 ui的内容进行替换呢?仔细一看,其他文件的大小都变得更大了。一看就是另外一个更新的版本,肯定不能替换。……
image


我只好放弃魔改了。我的public中的组件版本号更新,因此无法调用。而0.2.4放出来的webviewer版本号是匹配的,但是缺了map文件,也还是不行。还是厚着脸皮回来等chenghongyao大大放出http://81.68.152.226:8863/上面对应的webviewer文件夹。

from obsidian-bookmaster-plugin.

chenghongyao avatar chenghongyao commented on July 1, 2024

缺 map 文件不是问题,我这也没有,有警告不影响。

这张图提示了 origin 错误。忘了说需要修改 configorigin.txt,不过你说你改了,那可能是 ob 使用了缓存的文件,你可以在控制台看下。

你给我发个邮件吧,[email protected]。我打包发给你,不过我这里用的就是和0.2.4用的同一个版本,自动同步到服务器上的。另外有可能是编译版本出了问题,我可以把我的编译结果发给你试下。

from obsidian-bookmaster-plugin.

justemu avatar justemu commented on July 1, 2024

谢谢chenghongyao大大。 [email protected] 我给你发邮件了。

from obsidian-bookmaster-plugin.

justemu avatar justemu commented on July 1, 2024

邮件收到。谢谢大大。
替换webviewer文件夹,同时清空浏览器的所有cache后。正常了~

image

from obsidian-bookmaster-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.