public class PdfHandler extends AbstractAssetHandler
PdfHandler
class ...
handles pdfs and illustrator files.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTENT_MIMETYPE
Mime type
|
PROPERTY_DEACTIVATED_MIME_TYPES
Constructor and Description |
---|
PdfHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandleSubAssets()
Indicates if the handler supports processing of
sub assets |
ExtractedMetadata |
extractMetadata(Asset asset)
This method is used by the
ExtractMetadataProcess as part of the DAM
Update Asset workflow during import or update of an asset. |
java.awt.image.BufferedImage |
getImage(Rendition rendition)
|
java.awt.image.BufferedImage |
getImage(Rendition rendition,
java.awt.Dimension dim)
|
java.lang.String[] |
getMimeTypes()
This method returns the mime types a particular
AssetHandler supports. |
com.adobe.internal.io.ByteWriter |
getRAFByteWriter(java.io.File file) |
java.util.Iterator<? extends AssetRelation> |
processRelated(Asset asset)
extracts and stores the links to the assets related with provided asset.
|
java.util.List<java.lang.String> |
processSubAssets(Asset asset)
Handler implementations may choose to support sub asset creation for the file types it handles.
|
createThumbnails, createThumbnails, createThumbnails, exportAsset
public static final java.lang.String CONTENT_MIMETYPE
public ExtractedMetadata extractMetadata(Asset asset)
ExtractMetadataProcess
as part of the DAM
Update Asset workflow during import or update of an asset. Implementations must return an ExtractedMetadata
object, which may be empty if no metadata is extracted, or
contains the metadata values extracted from the binary being imported/updated at the time. The
ExtractMetadataProcess
will later save the metadata contained in ExtractedMetadata
to
the asset's metadata node (e.g. /content/dam/geometrixx/banners/banner-mono.png/jcr:content/metadata).
Implementations are free to decide which and how many metadata values are extracted.
The method argument represents the javax.jcr.Node
of type nt:file holding the binary content or
the DAM Asset node (type dam:Asset), for which its original rendition would be retrieved.asset
- The Asset
, from whose original binary metadata will extracted.public com.adobe.internal.io.ByteWriter getRAFByteWriter(java.io.File file) throws java.io.IOException
java.io.IOException
public boolean canHandleSubAssets()
sub assets
canHandleSubAssets
in interface AssetHandler
canHandleSubAssets
in class AbstractAssetHandler
true
if handler is able to process sub assetspublic java.util.List<java.lang.String> processSubAssets(Asset asset)
CreateSubAssetsProcess
during import/update of an asset and its
binary, as part of the DAM Update Asset workflow. Sub assets represent fragments of the original asset,
for example every page of a multi-page PDF document are sub assets. Sub assets are stored as assets themselves
under the parent asset. Sub assets are stored in the subassets folder of the main asset, e.g. at
/content/dam/geometrixx/documents/ECM Artikel.pdf/subassets.
The asset
argument represents the javax.jcr.Node
of type nt:file holding the binary
content or the DAM Asset node (type dam:Asset), for which its original rendition would be retrieved.processSubAssets
in interface AssetHandler
processSubAssets
in class AbstractAssetHandler
asset
- asset to extract sub assetsAssetHandler.canHandleSubAssets()
,
Asset.isSubAsset()
public java.lang.String[] getMimeTypes()
AssetHandler
supports.public java.awt.image.BufferedImage getImage(Rendition rendition) throws java.io.IOException
Asset
s given Rendition
. For images the
BufferedImage
of the original image is returned, for other formats the first page is retrieved as
BufferedImage
getImage
in interface AssetHandler
getImage
in class AbstractAssetHandler
rendition
- The rendition for which to retrieve its graphical representation.BufferedImage
if a graphical representation exists, otherwise null
java.io.IOException
- in case an error is thrown while fetching the buffered imagepublic java.awt.image.BufferedImage getImage(Rendition rendition, java.awt.Dimension dim) throws java.io.IOException
Asset
s given Rendition
. For images the
BufferedImage
of the original image is returned, for other formats the first page is retrieved as
BufferedImage
.
If maxDimension
is given, the handler should return an
image where no dimension extends the given value. This can be used to reduce
the memory footprint of large buffered images if the full resolution is not needed.
getImage
in interface AssetHandler
getImage
in class AbstractAssetHandler
rendition
- The rendition for which to retrieve its graphical representation.dim
- optional constraint for the maximal dimension of the image.BufferedImage
if a graphical representation exists, otherwise null
java.io.IOException
- in case an error is thrown while fetching the buffered imagepublic java.util.Iterator<? extends AssetRelation> processRelated(Asset asset)
processRelated
in interface AssetHandler
processRelated
in class AbstractAssetHandler
asset
- asset to processAssetRelation
or an empty iterator if no related assets are available"Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"