预期=“ 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 (将#修改为@)