Na sestavách se pro viditelný dig. podpis vytváří klasické read only formulářové pole, které se podpisem nahradí za obrázek podpisu.

Změna podepisovací komponenty- na windows se spouští stejná jak na linuxu, macos...
closes #244
Verze_3.0
Josef Rokos 9 years ago
parent 768d3ee874
commit 67a99d8d78

@ -1,7 +1,6 @@
package info.bukova.isspst.reporting; package info.bukova.isspst.reporting;
import com.lowagie.text.Rectangle; import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.PdfAnnotation;
import com.lowagie.text.pdf.PdfFormField; import com.lowagie.text.pdf.PdfFormField;
import com.lowagie.text.pdf.PdfName; import com.lowagie.text.pdf.PdfName;
import net.sf.jasperreports.engine.JRGenericPrintElement; import net.sf.jasperreports.engine.JRGenericPrintElement;
@ -27,7 +26,8 @@ public class SignaturePdfHandler implements GenericElementPdfHandler, GenericEle
@Override @Override
public void exportElement(JRPdfExporterContext exporterContext, JRGenericPrintElement element) { public void exportElement(JRPdfExporterContext exporterContext, JRGenericPrintElement element) {
PdfFormField field = PdfFormField.createSignature(exporterContext.getPdfWriter()); //PdfFormField field = PdfFormField.createSignature(exporterContext.getPdfWriter());
PdfFormField field = PdfFormField.createTextField(exporterContext.getPdfWriter(), true, false, 255);
Object param = element.getParameterValue("index"); Object param = element.getParameterValue("index");
String index = param != null ? String.valueOf(param) : null; String index = param != null ? String.valueOf(param) : null;
@ -37,7 +37,9 @@ public class SignaturePdfHandler implements GenericElementPdfHandler, GenericEle
field.setFieldName("signature"); field.setFieldName("signature");
} }
field.setFieldFlags(PdfAnnotation.FLAGS_PRINT | PdfAnnotation.FLAGS_LOCKED); field.put(PdfName.V, exporterContext.getPdfWriter().getPdfIndirectReference());
field.setFieldFlags(PdfFormField.FF_READ_ONLY);
field.setWidget(new Rectangle(element.getX(), field.setWidget(new Rectangle(element.getX(),
exporterContext.getExportedReport().getPageHeight() - element.getY(), exporterContext.getExportedReport().getPageHeight() - element.getY(),
element.getX() + element.getWidth(), element.getX() + element.getWidth(),

Loading…
Cancel
Save