Skip to content

Commit

Permalink
Rtf endepunkt
Browse files Browse the repository at this point in the history
  • Loading branch information
ugur93 committed Aug 7, 2024
1 parent 0160dff commit 0af72c1
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ class DokumentController(private val dokumentService: DokumentService) {
@PathVariable(required = false) dokumentreferanse: String?,
@RequestParam(required = false) resizeToA4: Boolean,
@RequestParam(required = false, defaultValue = "true") optimizeForPrint: Boolean,
): ResponseEntity<ByteArray> {
log.info("Henter dokument med journalpostId=$journalpostId og dokumentreferanse=$dokumentreferanse, resizeToA4=$resizeToA4")
@RequestParam("rtf", required = false) rtfFile: Boolean = false,
): ResponseEntity<ByteArray> {
log.info("Henter dokument med journalpostId=$journalpostId og dokumentreferanse=$dokumentreferanse, resizeToA4=$resizeToA4, rtfFile=$rtfFile")
val dokument = DokumentRef(journalpostId, dokumentreferanse, null)
val response =
dokumentService.hentDokument(dokument, DocumentProperties(resizeToA4, optimizeForPrint))
if (rtfFile) dokumentService.hentDokumentRTF(dokument) else dokumentService.hentDokument(dokument, DocumentProperties(resizeToA4, optimizeForPrint))

response.body
?.also {
Expand Down

0 comments on commit 0af72c1

Please sign in to comment.