Ziv-Barber / officegen

Standalone Office Open XML files (Microsoft Office 2007 and later) generator for Word (docx), PowerPoint (pptx) and Excell (xlsx) in javascript. The output is a stream.
MIT License
2.65k stars 471 forks source link

Documentation/Readme Update Request #332

Closed mohit472 closed 4 years ago

mohit472 commented 4 years ago

Steps to Reproduce

pObj.addImage ( path.resolve(__dirname, 'myFile.png', { cx: 300, cy: 200 } ) );

Expected Behavior

Image with height 300 and length 300

Just the code must be changed pObj.addImage ( path.resolve(__dirname, 'myFile.png'), { cx: 300, cy: 200 } );

Actual Behavior

Emitted 'error' event at:
    at WriteStream.onerror (\node_modules\readable-stream\lib\_stream_readable.js:685:52)
internal/validators.js:125
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
    at validateString (internal/validators.js:125:11)
    at Object.resolve (path.js:161:7)
    at mdTODocx (D:\Work\Generate_docx\read-markdown.js:70:34)
    at D:\Work\Generate_docx\read-markdown.js:47:17
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

Ziv-Barber commented 4 years ago

Thanks! Fixed for the next release.