Skip to content

Png with transparency is added twice #902

@wasa4587

Description

@wasa4587

Bug 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions