Skip to content

PR for inserting arbitrary PNG #62

@MP70

Description

@MP70

Sorry, I know I've just added a PR, not expecting a response soon just thought I'd add it while its on my mind..

Other libs such as node-pptx allow the user to add an arbitrary image in whereas this seems to require the image is already on a template slide. I would like the ability to extend templating (in spirit) to images, like how we have replaceText which takes a text element ID maybe we have a 'replaceImage' which will take a imageElement ID and copy the new image into ppt/images, remove the old image and update the reference in the element. This will be trivial to implement BUT the issue is that it is going to be painful for the user to find the Image element ID in order to pass it in replaceImage.

so could/should we:

  1. take the image file name and find the element based on that
  2. take a imageElement ID
  3. take a text element in the slide that matches a certain regex e.g {%image Image1} then modify it so it becomes a image element, user can pass in W/H (and position?) at replace time?
  4. suggest the user does it as Use pptx-automizer along with from-scratch-libraries (e.g. PptxGenJS) #60
  5. something else/out of scope of this lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions