JAVA操作PDF的几个问题,高手请进。 1.通过iText怎样对PDF加密(只是普通加密,非认证加密)。 2.在JSP页面中显示PDF时,怎样禁止右键菜单(只禁止右键菜单中的“打印”选项也行)。 3.在后台或在JSP页面中怎样启用/禁用PDF的“打印”功能(打印时不弹出属性对话框)。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1,itext没用过,一般itext中对应的借口和方法,看问档2,js处理3,不太明白,不是要后台或jsp去控制阅读pdf工具的打印把... 加密打开文档之前还要做的一件事情就是加密(如果你希望该文档加密),要达到这个目的,你可以使用下面的方法:public void setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions);• strength 是下面两个常量之一: • PdfWriter.STRENGTH40BITS: 40 位 • PdfWriter.STRENGTH128BITS: 128位 (Acrobat Reader 5.0及以上版本支持) • UserPassword和ownerPassword 可以为空或零长度,这种情况下, ownerPassword 将被随机的字符串代替 • Permissions 为下列常量之一: • PdfWriter.AllowPrinting • PdfWriter.AllowModifyContents • PdfWriter.AllowCopy • PdfWriter.AllowModifyAnnotations • PdfWriter.AllowFillIn • PdfWriter.AllowScreenReaders • PdfWriter.AllowAssembly • PdfWriter.AllowDegradedPrinting writer.setEncryption(PdfWriter.STRENGTH40BITS, null, null, PdfWriter.AllowCopy);打开而无须密码,但用户不能打印、修改本文档。writer.setEncryption(PdfWriter.STRENGTH128BITS, "userpass", "ownerpass", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);将要求输入密码('userpass'),因为添加了AllowPrinting参数,你可以打印该文档而不会发生任何问题。 EJB2.0,使用自定义主键类,描述文件里面怎么配置 java工作流是什么? j2ee 服务器 各位大虾帮忙看看程序!! 暑假最新消息!! 如何在XFire中定义友好的接口参数名,在线等! 散散分 jdbcTemplate怎么进行多表查询? Date的疑问? 关于动态html表单,struts的actionform应该如何设置? tomcat 预编译设置 自己的tomcat服务器别人能登陆吗?
2,js处理
3,不太明白,不是要后台或jsp去控制阅读pdf工具的打印把...
打开文档之前还要做的一件事情就是加密(如果你希望该文档加密),要达到这个目的,你可以使用下面的方法:
public void setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions);
• strength 是下面两个常量之一:
• PdfWriter.STRENGTH40BITS: 40 位
• PdfWriter.STRENGTH128BITS: 128位 (Acrobat Reader 5.0及以上版本支持)
• UserPassword和ownerPassword 可以为空或零长度,这种情况下, ownerPassword 将被随机的字符串代替
• Permissions 为下列常量之一:
• PdfWriter.AllowPrinting
• PdfWriter.AllowModifyContents
• PdfWriter.AllowCopy
• PdfWriter.AllowModifyAnnotations
• PdfWriter.AllowFillIn
• PdfWriter.AllowScreenReaders
• PdfWriter.AllowAssembly
• PdfWriter.AllowDegradedPrinting writer.setEncryption(PdfWriter.STRENGTH40BITS, null, null, PdfWriter.AllowCopy);
打开而无须密码,但用户不能打印、修改本文档。
writer.setEncryption(PdfWriter.STRENGTH128BITS, "userpass", "ownerpass", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);将要求输入密码('userpass'),因为添加了AllowPrinting参数,你可以打印该文档而不会发生任何问题。