Commit b4810067 authored by Hando Lukats's avatar Hando Lukats
Browse files

TEIS-2461; generated pdf file is now cleared of special characters

parent 6d6915c0
......@@ -241,12 +241,14 @@ public class RiskAssessmentPDFService {
String jsonData = jsonUtil.writeObjectAsString(riskAssessmentPdf);
PreviewDocumentMsRequest request = getMsPreviewDocumentRequest(requestMetaDTO, jsonData);
GeneratedDocumentDto extractedMessagesDocument = docGenServiceClient.getDocument(request, requestMetaDTO);
String clearedFileName = riskAssessmentPdf.getTitle().replaceAll("[^A-Za-z0-9\\p{IsCyrillic} ]", "").trim();
SignFileStream documentToSign = SignFileStream.builder()
.content(extractedMessagesDocument.getContent())
.fileName(riskAssessmentPdf.getTitle() + FILE_EXTENSION)
.fileName(clearedFileName + FILE_EXTENSION)
.contentType(extractedMessagesDocument.getContentType())
.build();
SignFileStream signedDocument = signingServiceClient.signFileStream(documentToSign, requestMetaDTO);
return GeneratedDocumentDto.builder()
.docName(signedDocument.getFileName())
.content(signedDocument.getContent())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment