Combine PDF pages
Transformation API & ImageService API
The Transformation API and ImageService API allow for combining PDF pages.
The source parameters can read four different sources:
XML (XML-Nodes as a variable not yet possible)
URL
file locator
storage item
assetTransformation, fopTransformation, xslTransformation
the "source"-parameter can also be a xml-node
Commissioning of parameters with XML nodes as xsl-parameters-Parameter with sub-parameter elements
<cs:command name="com.censhare.api.transformation.XslTransformation" returning="dummy">
<cs:param name="stylesheet" select="concat($config, 'modules/content_export/stylesheets/export.xsl'"/>
<cs:param name="source" select="$chapterAsset/storage_item[@key='master'][1]"/>
<cs:param name="dest" select="concat($parentDir, 'chapter-', $chapterAsset/@id, '.xhtml')"/>
<cs:param name="xsl-parameters">
<cs:param name="parent-asset">
<xsl:copy-of select="$parentAsset"/>
<cs:param>
<cs:param name="child-asset-id" select="10000"/>
</cs:param>
</cs:command>
The parameter "transform" is officially deprecated (only works for backwards compatibility):
<cs:param name="transform">
<transform format="xhtml"/>
</cs:param>
For reasons of compatibility, atomic values are still available as attributes in the variable "transform". Additionally, they are also passed as standalone XSLT variables.
Example:
<param name="target-asset-id" value="10000"/>
==> (deprecated)
$transform = <transform target-asset-id="10000"/>
$target-asset-id = 10000
fopTransformation
"stylesheet"-parameter substitutes "key"-parameter, which can read all sources
xslTransformation
"stylesheet"-parameter for all sources
CreateVirtualFileSystem
The result is a full file path in Temp-URL-Syntax.
censhare://service/filesystem/temp/_4b00328c-a299-4b9e-83ec-7cfad03098c9/"
New Commands
" com.censhare.api.pdf.CombinePDF
"Parameter "sources": XML-Node
<sources>
<source type="file" value="/modules/..." pages="(1,2,3)"/>
<source type="file-locator" value="..." pages="1"/>
<source type="url" value="censhare://..."/>
</sources>
If the "pages" parameter is missing, all pages are read.
Parameter „dest“: represents the file locator of the destination file.
File-Locators to assets
REST extension for:
Access to temporary filesystem: "censhare://service/filesystem/" + name of file system + "/" + path
censhare://service/filesystem/temp/_4b00328c-a299-4b9e-83ec-7cfad03098c9/result.jpg"
Asset management enhancements
A temporary file is assigned via REST URL. Previously:
corpus:asset-temp-filesystem="temp" und corpus:asset-temp-filepath="11/80/118009.gif"
New alternative option:
corpus:asset-temp-file-url="censhare://service/filesystem/temp/11/80/118009.gif