neocotic / convert-svg

Node.js packages for converting SVG into other formats using headless Chromium
MIT License
198 stars 45 forks source link

puppeteer params.width and params.height error #102

Open pilezkiy opened 1 year ago

pilezkiy commented 1 year ago

When set float scale like 2.9459 in options of convertFile puppeteer throw error

Invalid parameters Failed to deserialize params.width - BINDINGS: int32 value expected

In file /convert-svg-core/src/Converter.js:298 must to fix like: if (options.scale !== 1) { dimensions.height *= options.scale; dimensions.height = Math.ceil(dimensions.height); dimensions.width *= options.scale; dimensions.width = Math.ceil(dimensions.width); await this[_setDimensions](page, dimensions); }

After that all works.