question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

print image with raw-html

See original GitHub issue

Hi, i’m trying to print a response from a post request. this response, maybe have some images, and i’m not abble to print this images. i need to convert to base64, and because of this, my timing is groing up.

const {data} = await axios.post( url , {
                params: params
            });

            printJS({
                type: 'raw-html',
                css: css,
                scanStyles: true,
                printable: data,
                targetStyles: ['*'],
            });

can i load this images directly, without having to convert them?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
crabblycommented, May 17, 2019

Hey @bartolomeukuma, v1.0.57 just got published to npm. It includes the updates from @JandersonConstantino to pre-load raw html images.

Please run npm update print-js to get the latest version and give it a try.

2reactions
JandersonConstantinocommented, May 14, 2019

Sounds good to me. If nobody makes a pull request I will make these changes later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Print.js Raw HTML with Images - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >
Print.js - Javascript library for HTML elements, PDF and image ...
Print.js is a tiny javascript library to help printing from the web. Print friendly support for HTML elements, image files and JSON data....
Read more >
Print raw html strings on EJS - node.js - Stack Overflow
Print raw html strings on EJS ... how can i print "html safe" strings? ... Picture perfect images with the modern <img> element....
Read more >
linux - What's the best way to render raw HTML and print it (to ...
You could try using wkhtmltopdf, which uses the webkit engine to render an HTML page into a PDF file. Then you can print...
Read more >
Print an image - HTML DOM
Print an image ... You can print a web page by clicking the Print menu of browser or pressing the shortcut Ctrl+P (or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found