diegomura / diegomura/react-pdf

Support SVG image element with objectFit, objectPosition

Open
#2,986 0 comments 0 reactions 0 assignees View on GitHub
new feature
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

- I see an example in a closed issue: https://github.com/diegomura/react-pdf/issues/1428
- However, I have a use case where I set the backgroundSize/objectFit) and backgroundPosition/objectPosition to the background image.
- Like the screenshot below, I have a cross shape and the background image has backgroundSize/objectFit = 'contain' and backgroundPosition/objectPosition = 'left top'

![image](https://github.com/user-attachments/assets/dd549cee-9460-4eff-8967-953548886e06)

I tried but I see it didn't work. I wonder if we can support these?

In the example (https://github.com/diegomura/react-pdf/issues/1428) I see we have to provide the `x` and `y` values in the Image component. Is there a way I don't have to use it?
![image](https://github.com/user-attachments/assets/b3f3180c-1cd2-4f71-8d34-c9a6253d7409)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.