0

I used 1.8.10-alfresco patched pdfbox version and I also tried 1.8.8.

And it will also work fine in some 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 this targetReader.getContentInputStream method will generate error.

Rekha Ahir
  • 13
  • 4

0 Answers0