mirror of
https://github.com/sismics/docs.git
synced 2025-12-15 10:46:26 +00:00
trim crappy characters
This commit is contained in:
@@ -200,7 +200,7 @@ public class PdfUtil {
|
||||
.addText("Created by " + documentDto.getCreator()
|
||||
+ " on " + dateFormat.format(new Date(documentDto.getCreateTimestamp())), true)
|
||||
.newLine()
|
||||
.addText(Strings.nullToEmpty(documentDto.getDescription()).replaceAll("[\r\n]", ""))
|
||||
.addText(documentDto.getDescription())
|
||||
.newLine();
|
||||
if (!Strings.isNullOrEmpty(documentDto.getSubject())) {
|
||||
pdfPage.addText("Subject: " + documentDto.getSubject());
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.sismics.docs.core.util.pdf;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.pdmodel.PDPage;
|
||||
import org.apache.pdfbox.pdmodel.PDPageContentStream;
|
||||
import org.apache.pdfbox.pdmodel.font.PDFont;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Wrapper around PDFBox for high level abstraction of PDF writing.
|
||||
*
|
||||
@@ -102,7 +102,10 @@ public class PdfPage implements Closeable {
|
||||
if (text == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Remove \r\n non breakable space
|
||||
text = text.replaceAll("[\r\n]", "").replace("\u00A0", " ");
|
||||
|
||||
pdContent.setFont(font, fontSize);
|
||||
int start = 0;
|
||||
int end = 0;
|
||||
|
||||
Reference in New Issue
Block a user