diff --git a/eux-pdf-flattener-service/src/main/kotlin/no/nav/eux/pdf/service/FlattenPdfService.kt b/eux-pdf-flattener-service/src/main/kotlin/no/nav/eux/pdf/service/FlattenPdfService.kt index 98f457b..cbeff5c 100644 --- a/eux-pdf-flattener-service/src/main/kotlin/no/nav/eux/pdf/service/FlattenPdfService.kt +++ b/eux-pdf-flattener-service/src/main/kotlin/no/nav/eux/pdf/service/FlattenPdfService.kt @@ -15,7 +15,7 @@ class FlattenPdfService( val inPath= "/tmp/pdf.js/in/" val outPath = "/tmp/pdf.js/out/" val printJsPath = "/print.js" - val timeout = 65; + val timeout = 55; val charPool : List = ('a'..'z') + ('A'..'Z') + ('0'..'9') @@ -26,6 +26,8 @@ class FlattenPdfService( val exitCode = process.waitFor() if (exitCode == 0) { + val listFiles = File(outPath).listFiles() + log.info { "Files $listFiles" } val readBytes = File(outPath + randomName).readBytes() return readBytes } else { diff --git a/print.js b/print.js index 34c56d0..19a1f99 100644 --- a/print.js +++ b/print.js @@ -7,8 +7,8 @@ const options = { }; var args = process.argv.slice(2); - const url = 'http://localhost:8888/web/viewer.html?file=/in/' + args[0]; - - -let pdf = htmlPdf.create(url, options).then((pdf) => pdf.toFile('/tmp/pdf.js/out/' + args[0])); +const outFile = '/tmp/pdf.js/out/' + args[0] +process.stdout.write(url) +process.stdout.write(outFile) +let pdf = htmlPdf.create(url, options).then((pdf) => pdf.toFile(outFile));