Skip to content

Commit

Permalink
Fjern logger
Browse files Browse the repository at this point in the history
  • Loading branch information
thanglyphan committed Dec 7, 2023
1 parent 06f8c5c commit 0f7d822
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,9 @@ private static ByteArrayOutputStream convertWordToPdf(SedMedVedlegg.BinaerFil bi
InputStream is = new ByteArrayInputStream(binaerFil.getInnhold());
ByteArrayOutputStream out = new ByteArrayOutputStream();

log.info("KonverteringPDF: Conversion started in convertWordToPdf");
try (
XWPFDocument document = new XWPFDocument(is)
) {
log.info("KonverteringPDF: InputStream ready");

if (konverterbarFiltype == JournalpostFiltype.DOCX) {
Document pdfDocument = new Document();
Expand All @@ -214,16 +212,12 @@ private static ByteArrayOutputStream convertWordToPdf(SedMedVedlegg.BinaerFil bi
pdfDocument.add(new Paragraph(paragraph.getText()));
}
pdfDocument.close();

log.info("KonverteringPDF: Conversion completed");
} else {
throw new IllegalArgumentException("KonverteringPDF: Conversion not implemented for file type " + konverterbarFiltype);
throw new IllegalArgumentException("Ikke implementert konvertering for filtype: " + konverterbarFiltype);
}
} catch (IOException | DocumentException | StackOverflowError e) {
throw new RuntimeException("KonverteringPDF: Could not convert attachment " + binaerFil.getFilnavn() +
" with MIME-type " + binaerFil.getMimeType() + " to PDF", e);
throw new RuntimeException("KonverteringPDF: Kunne ikke konvertere");
}
log.info("KonverteringPDF: Output stream is {}", out);
return out;
}

Expand Down

0 comments on commit 0f7d822

Please sign in to comment.