mirror of
https://github.com/sismics/docs.git
synced 2024-12-22 19:33:47 +01:00
fix plain text file save
This commit is contained in:
parent
e0214a6a9f
commit
119d30bb16
@ -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());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user