Skip to content

Commit

Permalink
eux-pdf-flattener
Browse files Browse the repository at this point in the history
  • Loading branch information
walberg committed Aug 4, 2024
1 parent 5444351 commit 912b2cf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class FlattenPdfService(
fun flattenPdf(incomingPdf: ByteArray): ByteArray {
val randomName = randomStringByKotlinCollectionRandom() + ".pdf"
File(inPath + randomName).writeBytes(incomingPdf)
val process = Runtime.getRuntime().exec(arrayOf("node", printJsPath))
val process = Runtime.getRuntime().exec(arrayOf("node", printJsPath, randomName))
val exitCode = process.waitFor()

if (exitCode == 0) {
val listFiles = File(outPath).listFiles()
listFiles.forEach { f -> log.info { "File " + f.name } }
listFiles.forEach { f -> log.info { "File " + f.canonicalPath } }
val readBytes = File(outPath + randomName).readBytes()
return readBytes
} else {
Expand Down

0 comments on commit 912b2cf

Please sign in to comment.