return;
}
if (o instanceof URLImageContainer)
{
final URLImageContainer imageContainer = (URLImageContainer) o;
if (imageContainer.isLoadable() == false)
{
PdfLogicalPageDrawable.logger.info
("URL-image cannot be rendered, as it was declared to be not loadable: " +
imageContainer.getSourceURLString());
}
else
{
final ResourceKey resource = imageContainer.getResourceKey();
if (resource == null)
{
PdfLogicalPageDrawable.logger.info("URL-image cannot be rendered, as it did not return a valid URL.");
}
else
{
try
{
final ResourceManager resourceManager = getResourceManager();
final com.lowagie.text.Image instance;
final Object maybeImage = imageCache.get(resource);
if (maybeImage != null)
{
instance = (com.lowagie.text.Image) maybeImage;
}
else
{
final ResourceData data = resourceManager.load(resource);
instance = com.lowagie.text.Image.getInstance(data.getResource(resourceManager));
imageCache.put(resource, instance);
}
final Resource imageWrapped = resourceManager.create(resource, null, Image.class);
final Image image = (Image) imageWrapped.getResource();
if (drawImage(content, image, instance))
{
drawImageMap(content);
}
return;
}
catch (InvalidReportStateException re)
{
throw re;
}
catch (Exception e)
{
PdfLogicalPageDrawable.logger.info("URL-image cannot be rendered, as the image was not loadable.", e);
}
}
}
}
if (o instanceof LocalImageContainer)
{
final LocalImageContainer imageContainer = (LocalImageContainer) o;
final Image image = imageContainer.getImage();
if (drawImage(content, image))
{
drawImageMap(content);
}
}