Search code examples
xmlfacebookpdfxsl-foapache-fop

XSL-FO: external-graphic with intternet image


We are using Apache FOP to produce a PDF from an XML file. The XML can contain a link to a facebook profile image, but the path is in fact a redirection.

The following does not work, it uses the path we have in XML file:

<fo:external-graphic src="url('http://graph.facebook.com/<some id nbs>/picture"') />

The following works:

<fo:external-graphic src="url('https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xap1/v/t1.0-1/p50x50/<some id>_n.jpg?oh=<some id>"') />

However, it is impossible to hard-code every true URI. How can I force FO to follow the link? Otherwise, maybe there is a way to retrieve the image from the 1st URI?

Thanks for your answers. XSL-FO can be really painful.


Solution

  • Found the problem:

    • using src="url('http://...')" won't work
    • using directly the url will work src="http://..."

    However, still doesn't work with Facebook pictures. Works fine with twitter, instagram...