Png with transparency is added twice
See original GitHub issueBug Report
Description of the problem
When I try to insert a png with transparency into the document, the image is inserted twice.
this is the image: https://drive.google.com/file/d/1Paci2YPG0PAvnvNgGlVazkn3cL8txICt/view?usp=sharing
this is the output pdf https://drive.google.com/file/d/1O3sRSiHnLCpRkiflb7tjzWfxGh7xbvSf/view?usp=sharing
Code sample
const PDFDocument = require('pdfkit');
const fs = require('fs');
const doc = new PDFDocument( {
layout: 'portrait',
size: 'letter',
margin: 0,
});
doc.image('./google0.026317087946030382.png', 0 ,0 , { width: 150, height: 100});
const pdfFile = `./output.pdf`;
doc.pipe(fs.createWriteStream(pdfFile));
doc.end();
Your environment
- pdfkit version: ^0.8.3
- Node version: v8.10.0
- Operating System: ubuntu:16.04 and Windows 10
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Why this png image appears twice? - Stack Overflow
So, the image is appearing twice because you put the image src to be the logoehands.png and in the CSS you put background-image, ......
Read more >Why Is My PNG Not Transparent Photoshop? - website builder
There are a few reasons why your PNG might not be transparent in Photoshop. One reason is that you are using the wrong...
Read more >What Is the Alpha Channel in PNG Images? - MakeUseOf
Here's everything you need to know about the alpha channel in PNG images. ... if you want to add transparency, you have to...
Read more >Masks -- IM v6 Examples - ImageMagick
It saves the transparency channel as a 'matte' image file format, and required two separate steps, and commands to define the right image...
Read more >Sorting out Problems with Transparency - Mozilla Hubs
Not every .PNG contains alpha (transparency) information. The author of the image needs to have explicitly added it. Fortunately, it's not that ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
we use https://github.com/lovell/sharp to preprocesses image on the fly to produce consistent results across wide variety of images. It handles multiple formats so we can accept images in many formats and produce predictable pdfs without worrying about users supplying webp or other formats.
Version 0.9 should fix thix