<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="transform-to-pdf-action" parent="script">
<property name="scriptLocation">
<bean class="org.alfresco.repo.jscript.ClasspathScriptLocation">
<constructor-arg>
<value>alfresco/extension/scripts/transformToPdf.js</value>
</constructor-arg>
</bean>
</property>
</bean>
</beans>
var name = document.properties["cm:name"];
var version = document.properties["cm:versionLabel"];
newdoc = document.transformDocument("application/pdf");
newdoc.properties["gen:Version"] = name + " ("+ version +")";
newdoc.save();
<config evaluator="string-compare" condition="DocLibActions">
<actions>
<!– Transfor Document To PDF –>
<action id="transform-to-pdf" type="javascript" label="Transformer en PDF">
<param name="function">onActionFormDialog</param>
<!– Additional parameters for onFormDialog function –>
<param name="itemKind">action</param>
<param name="itemId">transform-to-pdf-action</param>
<param name="mode">create</param>
<param name="destination">{node.nodeRef}</param>
<!–
<param name="action">transform-to-pdf-action</param>
–>
<param name="successMessage">Succcès : le document PDF a été créé</param>
<param name="failureMessage">Echec : Le document PDF n'a pas été créé"</param>
</action>
</actions>
<actionGroups>
<actionGroup id="document-browse">
<action index="460" id="transform-to-pdf"/>
</actionGroup>
</actionGroups>
</config>
<config evaluator="string-compare" condition="transform-to-pdf-action">
<forms>
<form>
<field-visibility>
<show id="destination-folder" />
</field-visibility>
<appearance>
<field id="destination-folder" label="Choisir la destination">
<control template="/org/alfresco/components/form/controls/association.ftl">
<control-param name="displayMode">items</control-param>
<control-param name="showTargetLink">true</control-param>
<control-param name="compactMode">true</control-param>
</control>
</field>
</appearance>
</form>
</forms>
</config>
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.