Forgot password?
 Create new account
View 153|Reply 3

pdf.js图层

[Copy link]

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

hbghlyj Posted at 2023-5-26 01:38:27 |Read mode
在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

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

 Author| hbghlyj Posted at 2023-5-26 01:46:30
点击Print$\gg$Save to PDF可保存无水印的PDF
$type original.pdf (534.98 KB, Downloads: 32) 原PDF尺寸535KB
$type no watermark.pdf (106.53 KB, Downloads: 31) 保存的PDF尺寸107KB

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

 Author| hbghlyj Posted at 2023-5-26 19:01:31
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. });
Copy the Code

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

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

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

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

手机版Mobile version|Leisure Math Forum

2025-4-20 22:04 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list