Giter VIP home page Giter VIP logo

Comments (6)

pbw3 avatar pbw3 commented on July 1, 2024 1
const imageToBase64 = require('image-to-base64');
...

// loop through img elements before converting html to docx
//   img.src = getImageBase64(img.src)

async function getImageBase64(imgSrc) {
    const pre = 'data:image/png;base64, ';
    return new Promise((resolve, reject) => {
        imageToBase64(imgSrc)
            .then((res) => { return resolve(pre + res); })
            .catch((error) => { return reject(error); })
    });
}

from html-to-docx.

privateOmega avatar privateOmega commented on July 1, 2024

@diptobuet Sorry for the delay in answering this, I haven't had the time to go through this repo for sometime now.

What do you mean normal html image?

from html-to-docx.

TheDarkStrix avatar TheDarkStrix commented on July 1, 2024

@privateOmega I think he means

<img src="https://i.picsum.photos/id/816/200/200.jpg?hmac=ZNsj0gw4AJtSDA82gMxujRjh3_5ZHoVje8CtZopmcz4" /> 

Non-base64 sources.

Currently is there any way to get this working ?

from html-to-docx.

privateOmega avatar privateOmega commented on July 1, 2024

@TheDarkStrix Sorry, i haven't had the time to look at anything on this project for sometime now, and unless we get someone who could help us out in this matter, there isn't much for now, sorry for that.

from html-to-docx.

Arman19941113 avatar Arman19941113 commented on July 1, 2024

<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgAB...">actually it's not work with my inlined base64 image

from html-to-docx.

Arman19941113 avatar Arman19941113 commented on July 1, 2024

eventually I chose html-docx-js

from html-to-docx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.