Package com.openhtmltopdf.pdfboxout
Class PdfBoxUserAgent
- java.lang.Object
-
- com.openhtmltopdf.swing.NaiveUserAgent
-
- com.openhtmltopdf.pdfboxout.PdfBoxUserAgent
-
- All Implemented Interfaces:
DocumentListener
,UserAgentCallback
public class PdfBoxUserAgent extends NaiveUserAgent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openhtmltopdf.swing.NaiveUserAgent
NaiveUserAgent.DataUriFactory, NaiveUserAgent.DefaultAccessController, NaiveUserAgent.DefaultHttpStream, NaiveUserAgent.DefaultHttpStreamFactory, NaiveUserAgent.DefaultUriResolver
-
-
Field Summary
Fields Modifier and Type Field Description private PdfBoxOutputDevice
_outputDevice
private SharedContext
_sharedContext
-
Fields inherited from class com.openhtmltopdf.swing.NaiveUserAgent
_accessControllers, _baseUri, _imageCache, _protocolsStreamFactory, _resolver, DEFAULT_URI_RESOLVER
-
-
Constructor Summary
Constructors Constructor Description PdfBoxUserAgent(PdfBoxOutputDevice outputDevice)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImageResource
getImageResource(java.lang.String uriStr)
Retrieves the Image at the given URI.SharedContext
getSharedContext()
private byte[]
readStream(java.io.InputStream is)
private void
scaleToOutputResolution(PdfBoxImage image)
void
setSharedContext(SharedContext sharedContext)
-
Methods inherited from class com.openhtmltopdf.swing.NaiveUserAgent
checkAccessAllowed, clearImageCache, documentLoaded, documentStarted, extractProtocol, getBaseURL, getBinaryResource, getCSSResource, getDefaultUriResolver, getImageResource, getProtocolFactory, getXMLResource, hasProtocolFactory, isVisited, onLayoutException, onRenderException, openReader, openStream, readAll, resolveUri, resolveURI, setAccessController, setBaseURL, setProtocolsStreamFactory, setUriResolver
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.openhtmltopdf.extend.UserAgentCallback
getBinaryResource, getCSSResource, getXMLResource
-
-
-
-
Field Detail
-
_sharedContext
private SharedContext _sharedContext
-
_outputDevice
private final PdfBoxOutputDevice _outputDevice
-
-
Constructor Detail
-
PdfBoxUserAgent
public PdfBoxUserAgent(PdfBoxOutputDevice outputDevice)
-
-
Method Detail
-
readStream
private byte[] readStream(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
getImageResource
public ImageResource getImageResource(java.lang.String uriStr)
Description copied from interface:UserAgentCallback
Retrieves the Image at the given URI. This is a synchronous call.- Parameters:
uriStr
- Location of the image- Returns:
- An ImageResource for the content at the URI.
-
scaleToOutputResolution
private void scaleToOutputResolution(PdfBoxImage image)
-
getSharedContext
public SharedContext getSharedContext()
-
setSharedContext
public void setSharedContext(SharedContext sharedContext)
-
-