Package com.xpn.xwiki.pdf.impl
Class PDFResourceResolver
- java.lang.Object
-
- com.xpn.xwiki.pdf.impl.PDFResourceResolver
-
- All Implemented Interfaces:
org.apache.xmlgraphics.io.ResourceResolver
@Component(roles=PDFResourceResolver.class) @Singleton public class PDFResourceResolver extends Object implements org.apache.xmlgraphics.io.ResourceResolver
Resolves URIs sent by Apache FOP to embed images in the exported PDF. The strategy is the following:- When an attachment is rendered during the export (specifically when
pdf.vm
is rendered), thePdfURLFactory
is called and it saves the Attachment Entity Reference in a map in the XWiki Context - When Apache FOP embeds an image it calls this URI Resolver and we try to locate the Attachment Entity Reference from that map and return the attachment stream.
- Attachment links do not call the Resolver and are thus exported correctly using a full URL to the XWiki server
- Since:
- 7.4M2
- Version:
- $Id: d29c968036b75dd3a9795cef28a1f800593fddda $
-
-
Constructor Summary
Constructors Constructor Description PDFResourceResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutputStream
getOutputStream(URI uri)
org.apache.xmlgraphics.io.Resource
getResource(URI uri)
-
-
-
Method Detail
-
getResource
public org.apache.xmlgraphics.io.Resource getResource(URI uri) throws IOException
- Specified by:
getResource
in interfaceorg.apache.xmlgraphics.io.ResourceResolver
- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream(URI uri) throws IOException
- Specified by:
getOutputStream
in interfaceorg.apache.xmlgraphics.io.ResourceResolver
- Throws:
IOException
-
-