You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.
I am trying to merge pdf which is inside a folder of project.
My program is :
When you upload first pdf it will store in a public/uploads folder.
and when next time you upload a pdf. it read the entire folder and merge all of them into one and so on.
It was working ok in my local windows machine.
But when i uploaded to heroku it stopped working.
I am trying to merge pdf which is inside a folder of project.
My program is :
When you upload first pdf it will store in a public/uploads folder.
and when next time you upload a pdf. it read the entire folder and merge all of them into one and so on.
It was working ok in my local windows machine.
But when i uploaded to heroku it stopped working.
I used absolute path of files.
fs.readdir('./public/uploads', (err, files) => {
files.forEach(file => {
if (file.split(".")[1] === "pdf") {
list.push(__dirname + "/public/uploads/" + file);
}
})
var outputPath = __dirname + "\public\uploads\" + "studyPdf.pdf";
pdfMerge(list.reverse(), outputPath, function (err) {
if (err) {
res.send(err);
} else {
res.send("success");
}
})
});
When i am trying to do with this it returns an object :
{"killed":false,"code":127,"signal":null,"cmd":"java -jar /app/node_modules/easy-pdf-merge/jar/pdfbox.jar PDFMerger "/app/public/uploads/studyPdf.pdf" "/app/public/uploads/a.pdf" "/app\public\uploads\studyPdf.pdf""}
and when i make the list like list.push(__dirname + "\public\uploads\" + file);
It is showing me no file exists.
also i have tried path package with resolve method. It return the same object.
i also tried with relative path. but nothing works...
The text was updated successfully, but these errors were encountered: