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 faa4098 commit cc4c31c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Char> = ('a'..'z') + ('A'..'Z') + ('0'..'9')


Expand All @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions print.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));

0 comments on commit cc4c31c

Please sign in to comment.