Digitální podpis se zobrazí v PDF viditelně. Server předá podepisovací aplikaci ID fieldu, kde se podpis zobrazí. ID je zadáno v reportu jaku parametr pole signature.

refs #224
Verze_3.0
Josef Rokos 10 years ago
parent 11e3a48b28
commit 05faa87071

@ -28,9 +28,20 @@ public class SignaturePdfHandler implements GenericElementPdfHandler, GenericEle
@Override
public void exportElement(JRPdfExporterContext exporterContext, JRGenericPrintElement element) {
PdfFormField field = PdfFormField.createSignature(exporterContext.getPdfWriter());
Object param = element.getParameterValue("index");
String index = param != null ? String.valueOf(param) : null;
if (index != null) {
field.setFieldName("signature-" + index);
} else {
field.setFieldName("signature");
}
field.setFieldFlags(PdfAnnotation.FLAGS_PRINT | PdfAnnotation.FLAGS_LOCKED);
field.setWidget(new Rectangle(element.getX(), element.getY(), element.getX() + element.getWidth(), element.getY() + element.getHeight()), PdfName.HIGHLIGHT);
field.setWidget(new Rectangle(element.getX(),
exporterContext.getExportedReport().getPageHeight() - element.getY(),
element.getX() + element.getWidth(),
exporterContext.getExportedReport().getPageHeight() - element.getY() - element.getHeight()), PdfName.HIGHLIGHT);
exporterContext.getPdfWriter().addAnnotation(field);
}

@ -2,7 +2,7 @@
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="tripRequirement" pageWidth="612" pageHeight="792" columnWidth="572" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0b7fa2d2-d452-4a1f-b1c0-2d8e16a22525">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="272"/>
<property name="ireport.y" value="387"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
@ -324,12 +324,6 @@ L - letadlo, P - pěšky, T - taxi]]></text>
<textFieldExpression><![CDATA[$P{P_PREV_APPROVE_DATE}]]></textFieldExpression>
<anchorNameExpression><![CDATA["SIGN_1"]]></anchorNameExpression>
</textField>
<image onErrorType="Blank">
<reportElement uuid="baf922bc-b6fb-4dbf-abc9-250f448baef3" x="378" y="368" width="183" height="50">
<printWhenExpression><![CDATA[$P{P_PREV_APPROVER_SIGNATURE} != null]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA[$P{P_PREV_APPROVER_SIGNATURE}]]></imageExpression>
</image>
<textField>
<reportElement uuid="16e5c4e2-a366-4eca-ad27-7db7fef6771c" x="186" y="27" width="375" height="20">
<printWhenExpression><![CDATA[$F{ownedBy.address} != null]]></printWhenExpression>
@ -348,8 +342,11 @@ L - letadlo, P - pěšky, T - taxi]]></text>
<textFieldExpression><![CDATA[$F{foreignPersons}]]></textFieldExpression>
</textField>
<genericElement>
<reportElement uuid="c1d18650-66b9-425c-acbe-7b4e952bfd16" x="442" y="460" width="119" height="48"/>
<reportElement uuid="c1d18650-66b9-425c-acbe-7b4e952bfd16" x="378" y="369" width="183" height="48"/>
<genericElementType namespace="urn:sig:sig" name="signature"/>
<genericElementParameter name="index">
<valueExpression><![CDATA[1]]></valueExpression>
</genericElementParameter>
</genericElement>
</band>
</detail>

Loading…
Cancel
Save