Steven Calkins wrote:
Dear XWiki users,
I just wanted to share a workaround for a PDF rendering problem. I was copying and pasting html from a knowledgeroot system into xwiki. In the process I was changing the image paths to relative URLs. Normally nothing speaks against using the absolute URLs, but we may need to move the wiki soon, so I decided that relative paths are better. They display fine in Xwiki Enterprise, but then the disappointment came when I tried the PDF print. The first image appeared but the following were empty! So I needed an absolute path which I can change easily if we move the wiki.
I went into the xwiki/skins/Albatross/template directory to the the xwikivars.vm file and added a variable of the form: #set($domain = "http://domain:port") After adding it, I saved the file, restarted Tomcat and tested by typing somewhere in a page "$domain". That took care of it. The PDFs were just fine now. Now I can replace the relative URL everywhere by "${domain}/[ here relative URL]". When we move the wiki to another server it will work as soon as I make a single change in the xwiki/skins/Albatross/template/xwikivars.vm file.
I am new at XWiki, so if anyone has a better solution I'd be very glad to hear it.
If the images are attachments to the wiki, you can use the {image} macro for the 1.0 syntax, or the image: syntax for 2.0 documents. -- Sergiu Dumitriu http://purl.org/net/sergiu/