Hopding / pdf-lib

Create and modify PDF documents in any JavaScript environment
https://pdf-lib.js.org
MIT License
6.84k stars 652 forks source link

drawImage adds a border around the image that can not be removed #1626

Closed Inambe closed 5 months ago

Inambe commented 5 months ago

What were you trying to do?

I'm trying to draw an Image on an existing PDF document.

How did you attempt to do it?

code is pretty simple and taken from the docs:

sixthPage.drawImage(chartImage, {
  x: 144,
  y: pageHeight - 298,
  height: 160,
  width: 160,
});

What actually happened?

The drawn image has a border around it which I can't control apparently. image

What did you expect to happen?

I expect no border at all or a way to control it (so I can hide it).

How can we reproduce the issue?

If you draw image on any pdf (I've four of these).

Version

1.17.1

What environment are you running pdf-lib in?

Node

Checklist

Additional Notes

I do not understand PDFs very much so any help is appreciated.

Inambe commented 5 months ago

I'm sorry, apparently, it's my image's issue. The browser preview of image doesn't show the border so you can understand my confusion. image