mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 15:17:57 +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
|
* @return PDF input stream
|
||||||
*/
|
*/
|
||||||
private static InputStream convertTextPlain(InputStream inputStream, boolean reset) throws Exception {
|
private static InputStream convertTextPlain(InputStream inputStream, boolean reset) throws Exception {
|
||||||
if (reset) {
|
|
||||||
inputStream.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
Document output = new Document(PageSize.A4, 40, 40, 40, 40);
|
Document output = new Document(PageSize.A4, 40, 40, 40, 40);
|
||||||
ByteArrayOutputStream pdfOutputStream = new ByteArrayOutputStream();
|
ByteArrayOutputStream pdfOutputStream = new ByteArrayOutputStream();
|
||||||
PdfWriter.getInstance(output, pdfOutputStream);
|
PdfWriter.getInstance(output, pdfOutputStream);
|
||||||
@ -132,6 +128,10 @@ public class PdfUtil {
|
|||||||
output.add(paragraph);
|
output.add(paragraph);
|
||||||
output.close();
|
output.close();
|
||||||
|
|
||||||
|
if (reset) {
|
||||||
|
inputStream.reset();
|
||||||
|
}
|
||||||
|
|
||||||
return new ByteArrayInputStream(pdfOutputStream.toByteArray());
|
return new ByteArrayInputStream(pdfOutputStream.toByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user