Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting an image #1

Open
VanderDT opened this issue May 23, 2023 · 1 comment
Open

Inserting an image #1

VanderDT opened this issue May 23, 2023 · 1 comment

Comments

@VanderDT
Copy link

Hi!
Have you tried adding the ability to insert an image directly from a template or XML? Without using external files. I just can't do it (

@adangel
Copy link
Owner

adangel commented May 23, 2023

Do you mean something like that? https://stackoverflow.com/questions/10372069/inline-image-data-in-xslfo-apache-fop

It seems, you always need to use fo:external-graphic. If you use a data-url, like in the SO answer, you can directly embed it. Otherwise, FOP will try to find the image for you - it's using the "baseUri" provided at https://github.com/apache/xmlgraphics-fop/blob/1fd128127811cff7c293b62992c341e75b8624b0/fop-core/src/main/java/org/apache/fop/apps/FopFactoryBuilder.java#L71.
You can also configure a ResourceResolver, which should give you control over from where you load your images. See https://github.com/apache/xmlgraphics-fop/blob/main/fop-core/src/main/java/org/apache/fop/apps/io/ResourceResolverFactory.java for examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants