danfickle / danfickle/openhtmltopdf

During replacing Element cannot accept SVG URI with param

Open
#764 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.2k
Forks
423
PR merge metrics
No merged PRs in 30d

Description

In our project, there are some img elements in HTML which link to SVG resources. By Debugging is noticed that method ### _"createReplacedElement()"_ in the class _"PdfBoxReplacedElementFactory"_ cannot load SVG resources, if there is a param at the end of URI. please see below example:

```
logo
```
It leads to the fact that library trys to make an _PdfBoxImageElement_ instead of _PdfBoxSVGReplacedElement_ and then it cannot read the resource as well.
```
com.openhtmltopdf.load WARNING:: Unrecognized image format for: /logo.svg?ln=images&v=20210921082157
com.openhtmltopdf.exception WARNING:: Can't read image file; unexpected problem for URI '/logo.svg?ln=images&v=20210921082157'
```

Note: THe URI Address is not changeable.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.