In my former question I have touched a broader problem of paths and their recognizing inside an eXist-db app.
At the moment, I am not able to get images in to PDF files. I have tried 2 installations of eXist (2.2 and 3RC) and many possible scenarios. Of course, I have tested those pictures are reachable through the browser.
In the source file, I have tried:
1. <graphic url="img/tealover.jpg"/>
2. <graphic url="/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg"/>
3. <graphic url="http://46.28.111.241:8081/exist/rest/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg"/>
4. <graphic url="url(img/tealover.jpg)"/>
5. <graphic url="url(/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg)"/>
6. <graphic url="url(http://46.28.111.241:8081/exist/rest/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg)"/>
7. <graphic url="url('img/tealover.jpg')"/>
8. <graphic url="url('/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg')"/>
9. <graphic url="url('http://46.28.111.241:8081/exist/rest/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg')"/>
As expected, samples 3, 6 and 9 work but only if I have them in a form of hardcoded links in the source. If I build up the links in my XSLT stylesheet, they are exactly the same in the FO file but there is nothing in the produced PDF.
Equivalents produced in FO file:
1. <fo:external-graphic src="img/tealover.jpg"/>
2. <fo:external-graphic src="/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg"/>
3. <fo:external-graphic src="http://46.28.111.241:8081/exist/rest/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg"/>
4. <fo:external-graphic src="url(img/tealover.jpg)"/>
5. <fo:external-graphic src="url(/db/apps/karolinum-apps/data/2015080/img/tealover.jpg)"/>
6. <fo:external-graphic src="url(http://46.28.111.241:8081/exist/rest/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg)"/>
7. <fo:external-graphic src="url('img/tealover.jpg')"/>
8. <fo:external-graphic src="url('/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg')"/>
9. <fo:external-graphic src="url('http://46.28.111.241:8081/exist/rest/db/apps/karolinum-apps/data/mono/2015080/img/tealover.jpg')"/>
When I hard-code those links into the source, in the stylesheet works src="{@url}"
. When I use the short version of url everywhere (url="img/tealover.jpg"
), in the attribute stylesheet I use
<xsl:value-of select="concat('http://46.28.111.241:8081/exist/rest', $imgPath, @url)"/>
or directly in the template
src="concat('http://46.28.111.241:8081/exist/rest', $imgPath, @url)"
The $imgPath
variable is passed as a param from the application:
let $bookUri := base-uri($resource)
let $imgPath := replace($bookUri, '[^/]*?$', '')
With this, links 1, 4 and 7 should work, the rest is a mess. I can copy these links in eXide and they still work in the browser.
When I am testing, everything looks fine. In the PDF, there is still no picture. I guess there has to be a tiny detail I am missing now.