Prevent creating the citation page twice

This commit is contained in:
Antoine Snyers
2022-02-28 09:54:03 +01:00
parent 87d91c75bb
commit 3f9506e623
6 changed files with 47 additions and 36 deletions

View File

@@ -8,7 +8,6 @@
package org.dspace.disseminate;
import java.awt.Color;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
@@ -297,7 +296,7 @@ public class CitationDocumentServiceImpl implements CitationDocumentService, Ini
}
@Override
public Pair<InputStream, Long> makeCitedDocument(Context context, Bitstream bitstream)
public Pair<byte[], Long> makeCitedDocument(Context context, Bitstream bitstream)
throws IOException, SQLException, AuthorizeException {
PDDocument document = new PDDocument();
PDDocument sourceDocument = new PDDocument();
@@ -318,7 +317,7 @@ public class CitationDocumentServiceImpl implements CitationDocumentService, Ini
document.save(out);
byte[] data = out.toByteArray();
return Pair.of(new ByteArrayInputStream(data), Long.valueOf(data.length));
return Pair.of(data, Long.valueOf(data.length));
}
} finally {