Skip to content

Commit

Permalink
Merge pull request #71 from divyeshmakwana96/master
Browse files Browse the repository at this point in the history
Added quality and density support
  • Loading branch information
w3nl authored Jul 13, 2024
2 parents e0e6c7b + 5601a21 commit 7411b87
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class Ppt2PngConverter extends Converter {
return pdf2png({
file: pdf,
output: this.output,
density: this.density,
quality: this.quality

Check failure on line 49 in src/converter.js

View workflow job for this annotation

GitHub Actions / build

Insert `,`
});
});
}
Expand All @@ -53,15 +55,20 @@ class Ppt2PngConverter extends Converter {
* Create the converter
*
* @param {array} files
* @param {string} output
* @param {object} options
*
* @return {object}
*/
static create({ files, output }) {
static create({ files, output, options }) {
const converter = new Ppt2PngConverter();

converter.setFiles(files);
converter.setOutput(output);

converter.density = (options && options.density) || undefined;
converter.quality = (options && options.quality) || undefined;

return converter;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/pdf2png.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import Pdf2PngConverter from '@hckrnews/pdf2png';

export default ({ file, output }) => {
export default ({ file, output, density, quality }) => {
const pdfConverter = Pdf2PngConverter.create({
file,
output,
density,
quality

Check failure on line 8 in src/pdf2png.js

View workflow job for this annotation

GitHub Actions / build

Insert `,`
});

return pdfConverter.convert();
Expand Down
4 changes: 3 additions & 1 deletion test/test2.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {

const converter = Ppt2PngConverter.create({
files: ['test/OPW 733 Tienduizend redenen.ppt'],
output: 'output/'
output: 'output/',
density: 300,
quality: 100,
});


Expand Down

0 comments on commit 7411b87

Please sign in to comment.