如何解决预期=“ endstream”实际=“在偏移量369250”处发生错误,某些PDF中
我使用1.8.10-alfresco补丁pdfBox版本,也尝试了1.8.8。
它在某些pdf文件中也可以正常工作。
<dependency>
<groupId>org.apache.pdfBox</groupId>
<artifactId>pdfBox</artifactId>
<version>${pdfBox.version}</version>
<scope>1.8.10-alfresco-patched</scope>
</dependency>
@Override
public NodeRef appendPDF(NodeRef targetNodeRef,Map<String,Serializable> params) {
PDDocument pdf = null;
PDDocument pdfTarget = null;
InputStream is = null;
InputStream tis = null;
File tempDir = null;
ContentWriter writer = null;
NodeRef destinationNode = null;
try {
NodeRef toAppend = (NodeRef) params.get(ParaM_TARGET_NODE);
Boolean inplace = Boolean.valueOf(String.valueOf(params.get(ParaM_INPLACE)));
ContentReader append = getReader(toAppend);
is = append.getContentInputStream();
ContentReader targetReader = getReader(targetNodeRef);
System.out.println(targetNodeRef);
tis = targetReader.getContentInputStream();
}
ref File此targetReader.getContentInputStream方法将生成错误。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。