Closed inf13 closed 9 years ago
I'm not aware of anyway to do this via css but the document and writer have been exposed.
There is an example of how to set it with the java api here:
http://itextpdf.com/sandbox/images/BackgroundImage
Give it a go and let me know how you get on.
@inf13 How did you get on with this? Any luck?
are simple images (not background images) admitted?, eg: <img src="..." />
Using the XMLWorker demo didn't work: http://demo.itextsupport.com/xmlworker/
HTML Code:
<img src="http://static1.squarespace.com/static/532abed3e4b025f227941d11/t/532ce5e3e4b0f59c2979d8c2/1395451365611/" alt="" />
(just a random image)
Ah, to answer myself.. they are admitted but with a local path (eg: "C:\foo.png", which is what Server.MapPath
returns). URLs are not admitted nor relative paths...
It would be nice that Base64 was admitted though, because between a local absolute path and a base64 image, <img src="data:....." />
, I think the second is more elegant
@germanger Base64 would be good, if you add it I can include it. :+1:
I trying to add a background image for every pdf page. Is it possible? (for example html analogue: body style="background: url(logo.jpg)" )