Allow multiple pdf files to be converted#40
Allow multiple pdf files to be converted#40litemikx wants to merge 22 commits intofitraditya:developfrom
Conversation
feature: add options.page
Fixed using gm as node_module to identify pages
It works fine on Windows (checked). Put link how required GraphicsMagick with Ghostscript can be installed on Windows.
Update README.md. Add instruction for windows users.
- Remove or assign on options to avoid overwriting options whenever Pdf2Img.prototype.convert is called. - Added function Pdf2Img.prototype.convertList() to convert list of pdf files in array. 1st argument is the array, 2nd argument is the "options" object.
- Remove "or" assignment on Pdf2Img.prototype.setOptions() to avoid overwriting options object whenever Pdf2Img.prototype.convert is called. - Added function Pdf2Img.prototype.convertList() to convert list of pdf files in array. 1st argument is the array, 2nd argument is the "options" object.
# Conflicts: # lib/pdf2img.js
- Remove "or" assignment on Pdf2Img.prototype.setOptions() to avoid overwriting options object whenever Pdf2Img.prototype.convert is called. - Added function Pdf2Img.prototype.convertList() to convert list of pdf files in array. 1st argument is the array, 2nd argument is the "options" object.
|
Sorry about that, this is my first time contributing to a project and probably got confused with some of the steps. Wanted to share the changes I made that allows converting multiple pdfs in an array. Any feedback is appreciated, not sure though why CI build is failing. Thanks! |
| var Pdf2Img = function() {}; | ||
|
|
||
| Pdf2Img.prototype.setOptions = function(opts) { | ||
| options.type = opts.type || options.type; |
There was a problem hiding this comment.
This doesn't seem right, now if options has already value and it is not given in opts it will be overridden with undefined.
There was a problem hiding this comment.
Thanks for the feedback, I made another commit that should handle assignments on the options variable.
| options.density = opts.density || options.density; | ||
| options.outputdir = opts.outputdir || options.outputdir; | ||
| options.outputname = opts.outputname || options.outputname; | ||
| options.type = opts.type != null || opts.type != 'undefined' ? opts.type : options.type; |
There was a problem hiding this comment.
This is broken in so many levels that I don't know where to start. Why have you changed these line at all? AFAIK the original implementation was correct.
There was a problem hiding this comment.
Needed to edit the lib to be used in converting list of PDF files, so far it's working on my end. Most likely my code is not clean or should have better error handling. Added a new function at the bottom that handles an array of PDF where "options" can be passed. Oh well, will need to re-visit this next time.
Pdf2Img.prototype.convert is called.
files in array. 1st argument is the array, 2nd argument is the "options"
object.