pdfjs预览插件出现公章丢失和乱码问题

 项目场景:

提示:pdfjs预览插件出现公章丢失和乱码问题

pdf版本过低

解决方案

1.网上很多说是注释以下代码

 // if (data.fieldType === 'Sig') {
    //   data.fieldValue = null;

    //   _this3.setFlags(_util.AnnotationFlag.HIDDEN);
    // }

文件在pdf,work.js

但是发现项目已注释该内容

2.后来有网友说需要升级版本 :可以使用新的 pdfjs 版本,亲自更新版本到 2.12.313

包的下载地址

1.下载地址:https://mozilla.github.io/pdf.js/getting_started/#download

2.解压放到静态资源文件夹下

优势:1)不需要向服务端请求2)加快网页速度

项目中如何提出pdf预览弹窗组件

  <iframe id="iframe" @click="callBack" :src="pdfUrl" class="iframe-pdf-page" style="width: 100%; border-width: 0px" :style="{ height: height }"></iframe>
不想要预览的操作行很丑怎么办

.toolbar{
  position:relative;
  inset-inline:0;
  z-index:9999;
  cursor:default;
  font:message-box;
  display: none;//加上
}
#viewerContainer {
  top: 0!important;//加上
}

  • 8
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Java中添加水印和公章可以使用Java的图像处理库 - ImageIO和Graphics2D。下面是一个简单的示例代码,演示如何在一张图片上添加水印和公章: ```java import java.awt.*; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; public class AddWatermark { public static void main(String[] args) throws Exception { String imagePath = "test.jpg"; String watermarkPath = "watermark.png"; String sealPath = "seal.png"; BufferedImage image = ImageIO.read(new File(imagePath)); BufferedImage watermark = ImageIO.read(new File(watermarkPath)); BufferedImage seal = ImageIO.read(new File(sealPath)); Graphics2D g = image.createGraphics(); int watermarkWidth = image.getWidth() / 3; int watermarkHeight = watermarkWidth * watermark.getHeight() / watermark.getWidth(); g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.5f)); g.drawImage(watermark, image.getWidth() - watermarkWidth, image.getHeight() - watermarkHeight, watermarkWidth, watermarkHeight, null); int sealWidth = image.getWidth() / 4; int sealHeight = sealWidth * seal.getHeight() / seal.getWidth(); g.drawImage(seal, image.getWidth() / 2 - sealWidth / 2, image.getHeight() / 2 - sealHeight / 2, sealWidth, sealHeight, null); g.dispose(); ImageIO.write(image, "jpg", new File("result.jpg")); } } ``` 这个示例代码加载了一张名为test.jpg的图片,以及两张水印和公章图片。它使用Graphics2D把水印和公章添加到原始图片上,并将结果保存到result.jpg文件中。 您也可以根据需要调整代码。希望这可以帮到您!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值