还记得之前有人发过的国家标准网么?

http://openstd.samr.gov.cn/bzgk/gb/index
这个网站升级了,好像是外包到一个gb688.cn的网站上去了,不再使用PDFViewerApplication那个组件来进行浏览和下载。它的预览也采用了图像瓦片切割混排的方式,而且页面似乎还是个静态的。挺好玩儿的思路。不过,这个额对于加密来说似乎有些徒劳了。一个html2canve就渲染出来了。

1 个赞

gb688都好几年了,就是必须加载完全文才能下载了,没啥大影响。

gb688 是旧的域名,openstd 是在启动了“国家标准全文公开”项目后的标准 hostname。非采标的国家强制性标准,大多采用 html 硬编码方式排版,用此前的脚本还是可以下载到含可选择可编辑文本的 PDF 文件。这个形式应该是有一阵子了。

某些标准,官方提供下载按钮的话,是以 FileOpen 系统加密的 PDF(如果最近没有更新的话)。

gb688.cn 有些问题,我已经反馈给相关部门了.

1 个赞

之前是可以绕过这个下载到原始的pdf的。可惜了。那照楼上几位这么说,现在这个相当于退回到原来的方案啦?
之前我是用这个来下载的。

javascript: window.PDFViewerApplication.pdfDocument.saveDocument().then((e) => { window.PDFViewerApplication.downloadManager.downloadData(e, document.title.replace("在线预览|",""), "application/pdf"); })

这个可以的: GitHub - chengdong0421/GB_tampermonkey

同样是在之前帖子答案里的:

最近又再查国标,所以自己写了一个下载为网页的脚本,看谁需要可以拿去。bookmarklet形式,把下面的链接拖拽到书签栏即可,打开浏览页面,点击书签,先自动滚动到结尾,然后下载文件到download的指定目录。如果有问题,可以回复我。(发现小众论坛不能发bookmarklet的链接,只好贴代码了。代码是转成了base64,主要是为了缩成一行号粘贴,有兴趣可以自己看代码,不过挺丑的)
[下载为多文件网页]
javascript:eval(atob("Ly8g5pys6ISa5pys55So5LqO5Zyo6aKE6KeI5YWo5paH55qE5pe25YCZ77yM5bCG5paH5Lu25L+d55WZ5Yiw5pys5Zyw5L+d5a2YDQovLyDnoJTnqbbkvb/nlKjvvIzor7fli7/nlKjkuo7ku7vkvZXllYbkuJrnlKjpgJTjgIINCmZ1bmN0aW9uIGRvd25sb2FkKGNvbnRlbn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vbGxIZWlnaHQtZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmNsaWVudEhlaWdodDxvLnNjcm9sbFRvcCl7Y2xlYXJJbnRlcnZhbCh0aW1tZXIpO2dldEdCKCl9ZWxzZSBvLnNjcm9sbFRvcCs9c2NyZWVuLmhlaWdodDs7fSwzMDApICA="))

不是有直接的下载按钮么,就是下载的东西带水印。

针对那些不提供下载的啊,并不是所有的都支持下载。水印这个是没办法的,你买正版的电子版也是有水印的。

请问这个现在还能用吗?我试了试下载为单文件网页的小书签,能够自动滚动到结尾,但下载的文件打开是一片空白