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 Apr 15, 2020. It is now read-only.
As stated, when converting a PDF with more than 10 pages to a single image, the pages past 10 are appended to the 2nd and 3rd positions of the PDF, for example:
It seems that due to the file naming convention the images are appended in this order which is incorrect:
image0.png
image1.png
image10.png
image11.png
image2.png
image3.png
image4.png
image5.png
image6.png
image7.png
image8.png
image9.png
This is happening at least on macOS, not sure about Ubuntu. Node v8
The text was updated successfully, but these errors were encountered:
Been at this for days now with this library, the gm library and using gm directly with child.spawn (the only approach I can get working). Is there something blatantly wrong with this?
This is a snippet of a larger lab experiment to test various libraries. Notice that this example has live-testing.pdf[8]. Each time I run the test, I get a different number and I see no pattern. I imagine that behavior underlies my issue, but I'm not ready to go debugging at this point since I do have things working with child.spawn. I'd be happy to help though for the sake of others. I am using @RoyHP branch for the moment.
// Test fails with the following. Each time I seem to get a randomly different .png though and out of sequence// error: {// cmd: "gm convert \"/usr/src/test/temp/live-testing.pdf[8]\" \"/usr/src/test/temp/live-testing-8.png\"",// code: 1,// killed: false,// signal: null// },// message: "Failed to convert page to image",// stderr: "gm convert: Unable to open file (/usr/src/test/temp/live-testing.pdf) [No such file or directory].\n",// stdout: ""returnnewPromise((resolve,reject)=>{constPDFImage=require("pdf-image").PDFImageletpdfImage=newPDFImage(pdfPath,{//pdfPath is set global to all tests and the path works for other testsgraphicsMagick: true}).convertFile().then(imagePath=>{// Never hit because of the error aboveconsole.dir(imagePath);resolve(imagePath);}).catch(err=>{reject(err);});});
As stated, when converting a PDF with more than 10 pages to a single image, the pages past 10 are appended to the 2nd and 3rd positions of the PDF, for example:
It seems that due to the file naming convention the images are appended in this order which is incorrect:
image0.png
image1.png
image10.png
image11.png
image2.png
image3.png
image4.png
image5.png
image6.png
image7.png
image8.png
image9.png
This is happening at least on macOS, not sure about Ubuntu. Node v8
The text was updated successfully, but these errors were encountered: