找回密码
 快速注册
搜索
查看: 43|回复: 3

pdf.js图层

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2023-5-26 01:38 |阅读模式
在PDF.js中
例如这个pdf
展开$\text{Sidebar}\led\text{Thumbnail}\\\text{Outline}\\\text{Attachment}\\\text{Layers}\endled$
选择Additional layers
取消勾选Watermark
水印就去除了
Screenshot 2023-05-25 at 18-39-47 1468563361EText(Ch-7 M-1.pdf.png Screenshot 2023-05-25 at 18-39-57 1468563361EText(Ch-7 M-1.pdf.png

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2023-5-26 01:46
点击Print$\gg$Save to PDF可保存无水印的PDF
$type original.pdf (534.98 KB, 下载次数: 2) 原PDF尺寸535KB
$type no watermark.pdf (106.53 KB, 下载次数: 1) 保存的PDF尺寸107KB

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2023-5-26 19:01
pdf.js页面中不想要的部分用白色矩形填充覆盖:
(置高度h的白色矩形于页面下部)覆盖页码:
(置高度w的白色矩形于页面右部)覆盖分值:
  1. Array.prototype.forEach.call(document.getElementsByClassName('textLayer'),a=>a.remove());
  2. Array.prototype.forEach.call(document.getElementsByTagName('canvas'),canvas=>{
  3. ctx=canvas.getContext("2d");
  4. ctx.fillStyle = "white";h=100;
  5. ctx.fillRect(0, 1179-h, 834,h);
  6. w=86;
  7. ctx.fillRect(834-w, 0, 834,1179);
  8. });
复制代码

这样改动后只是显示的不一样, 但无法保存更改
去掉textLayer后右键canvas可以copy image

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2023-5-26 19:17
hbghlyj 发表于 2023-5-26 12:01
这样改动后只是显示的不一样, 但无法保存更改

甚至:页面缩放就会丢失以上更改(恢复原状).
应该是重新渲染了.

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 16:04

Powered by Discuz!

× 快速回复 返回顶部 返回列表