fix plain text file save

This commit is contained in:
Benjamin Gamard 2017-07-31 12:08:42 +02:00
parent e0214a6a9f
commit 119d30bb16

View File

@ -116,10 +116,6 @@ public class PdfUtil {
* @return PDF input stream
*/
private static InputStream convertTextPlain(InputStream inputStream, boolean reset) throws Exception {
if (reset) {
inputStream.reset();
}
Document output = new Document(PageSize.A4, 40, 40, 40, 40);
ByteArrayOutputStream pdfOutputStream = new ByteArrayOutputStream();
PdfWriter.getInstance(output, pdfOutputStream);
@ -132,6 +128,10 @@ public class PdfUtil {
output.add(paragraph);
output.close();
if (reset) {
inputStream.reset();
}
return new ByteArrayInputStream(pdfOutputStream.toByteArray());
}