生成二维码并将二维码附到pdf文件上,扫描二维码完成跳转
生活随笔
收集整理的這篇文章主要介紹了
生成二维码并将二维码附到pdf文件上,扫描二维码完成跳转
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
- 依托e-iceblue工具完成
官網:https://www.e-iceblue.cn/tutorials.html
本文參考:https://www.e-iceblue.cn/pdf_java_barcode/add-qrcode-in-pdf-using-java.html
注意:e-iceblue分為收費版本以及免費版本,(jar包版本)。本人已知3.1.1是免費版本
<!-- https://mvnrepository.com/artifact/e-iceblue/spire.office.free --><dependency><groupId>e-iceblue</groupId><artifactId>spire.office.free</artifactId><version>3.1.1</version></dependency>另,3.9.0好像也是免費版本
- 引入依賴包
只引入上面這個包,還不行,pom會報錯。還需在pom中引入如下內容:
<repositories><repository><id>com.e-iceblue</id><url>http://repo.e-iceblue.cn/repository/maven-public/</url></repository></repositories>如圖:
- 編碼
注意,API注釋文檔可參考:
https://www.e-iceblue.cn/api_reference/spire_pdf_for_java_api_reference.html
- 運行結果
打開
使用手機掃碼:
- 如上,成功!,項目中可根據實際情況結合API調整代碼。
總結
以上是生活随笔為你收集整理的生成二维码并将二维码附到pdf文件上,扫描二维码完成跳转的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ajax实现翻书效果,jquery实现的
- 下一篇: 微信小程序_石头剪刀布