View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007759 | Scribus | public | 2009-01-27 16:43 | 2019-07-10 21:23 | |
Reporter | dclemente | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | new | Resolution | open | ||
Product Version | 1.3.3.13svn | ||||
Summary | 0007759: [patch] New PDF form field: Digital signature | ||||
Description | This patch against 1.3.3.x adds a new type of form field: the digital signature field. It is a placeholder which can hold some data about the verification status of the document. An enabled viewer, like Acrobat Reader or Evince, will show some information inside that box, and will allow you to verify it when you click. The patch only allows you to place a signature field, but not to digitally sign the document. An external program can do this. The new annotation type is based in the text field and has type 14. Ideally, constants should be used instead of numbers to identify field types (see bug 7609). I followed Scribus' current style and used the number comparison. This function can have a better icon and more translations. This needs to be ported to 1.3.5. But I suggest improving bug 0007609 first. | ||||
Tags | #rottenpatch, patch | ||||
Patch | Yes | ||||
child of | 0003831 | acknowledged | Metabug: PDF Forms |
2009-01-27 16:43
|
digital-signature.patch (11,650 bytes)
=== modified file 'Scribus.pot' --- Scribus.pot 2008-11-13 15:46:29 +0000 +++ Scribus.pot 2008-11-17 15:02:34 +0000 @@ -3231,6 +3231,9 @@ msgid "List Box" msgstr "" +msgid "Digital Signature" +msgstr "" + msgid "Insert PDF Fields" msgstr "" === modified file 'scribus/actionmanager.cpp' --- scribus/actionmanager.cpp 2008-11-13 15:46:29 +0000 +++ scribus/actionmanager.cpp 2008-11-17 17:32:01 +0000 @@ -851,7 +851,7 @@ if (currItem->isAnnotation()) { int aType=currItem->annotation().Type(); - bool setter=((aType == 0) || (aType == 1) || (aType > 9)); + bool setter=((aType == 0) || (aType == 1) || ((aType > 9) && (aType < 14))); (*scrActions)["itemPDFAnnotationProps"]->setEnabled(setter); (*scrActions)["itemPDFFieldProps"]->setEnabled(!setter); } === modified file 'scribus/annot.cpp' --- scribus/annot.cpp 2008-11-13 15:46:29 +0000 +++ scribus/annot.cpp 2008-11-18 17:30:33 +0000 @@ -70,14 +70,20 @@ Layout1->addWidget( TextLabel1 ); ComboBox1 = new QComboBox( true, this, "ComboBox1" ); - QString tmp[] = { tr("Button"), tr("Text Field"), tr("Check Box"), tr("Combo Box"), tr("List Box")}; + QString tmp[] = { tr("Button"), tr("Text Field"), tr("Check Box"), tr("Combo Box"), tr("List Box"), tr("Digital Signature")}; size_t array = sizeof(tmp) / sizeof(*tmp); for (uint a = 0; a < array; ++a) ComboBox1->insertItem(tmp[a]); ComboBox1->setEditable(false); Layout1->addWidget( ComboBox1 ); AnnotLayout->addLayout( Layout1 ); - ComboBox1->setCurrentItem(item->annotation().Type()-2); + int an_type=item->annotation().Type(); + /* TODO: fix bug 7609 to simplify this fragile code */ + if (an_type == 14) { + ComboBox1->setCurrentItem(5); + } else { + ComboBox1->setCurrentItem(an_type-2); + } Fram = new QWidgetStack(this); AnnotLayout->addWidget( Fram ); @@ -1019,7 +1025,14 @@ Frame9->setFrameShadow( QFrame::Plain ); Fram->addWidget(Frame9, 2); - SetZiel(item->annotation().Type()-2); + an_type=item->annotation().Type(); + /* TODO: fix bug 7609 to simplify this fragile code */ + if (an_type==14) { + SetZiel(5); + } else { + SetZiel(an_type-2); + } + Layout1_2 = new QHBoxLayout; Layout1_2->setSpacing( 6 ); Layout1_2->setMargin( 0 ); @@ -1691,7 +1704,14 @@ QString tmp, tmp2; QString Nfo(""); bool AAct = false; - item->annotation().setType(ComboBox1->currentItem()+2); + int combo1=ComboBox1->currentItem(); + /* TODO: fix bug 7609 to simplify this fragile code */ + if (combo1 == 5) { + item->annotation().setType(14); + } else { + item->annotation().setType(combo1+2); + } + if (Name->text() != OldName) { item->setItemName(Name->text()); @@ -1734,7 +1754,7 @@ if (CanEdit->isChecked()) item->annotation().addToFlag(262144); } - if (item->annotation().Type() == 3) + if (item->annotation().Type() == 3 || (item->annotation().Type() == 14)) { if (MultiL->isChecked()) item->annotation().addToFlag(4096); @@ -1745,7 +1765,7 @@ if (NoScroll->isChecked()) item->annotation().addToFlag(8388608); } - if ((item->annotation().Type() == 3) || (item->annotation().Type() == 5)) + if ((item->annotation().Type() == 3) || (item->annotation().Type() == 14) || (item->annotation().Type() == 5)) { if (NoValid->isChecked()) item->annotation().setV_act(""); === modified file 'scribus/pdflib.cpp' --- scribus/pdflib.cpp 2008-11-13 15:46:29 +0000 +++ scribus/pdflib.cpp 2008-11-19 10:11:20 +0000 @@ -4689,6 +4689,7 @@ case 4: case 5: case 6: + case 14: Seite.FormObjects.append(ObjCounter-1); PutDoc("/Subtype /Widget\n"); PutDoc("/T "+EncString("("+anTitle+")",ObjCounter-1)+"\n"); @@ -4744,6 +4745,13 @@ if (ite->annotation().MaxChar() != -1) PutDoc("/MaxLen "+QString::number(ite->annotation().MaxChar())+"\n"); break; + case 14: + PutDoc("/FT /Sig\n"); + PutDoc("/Q "+QString::number(QMIN(ite->textAlignment,2))+"\n"); + PutDoc("/AP << /N "+QString::number(ObjCounter)+" 0 R >>\n"); + if (ite->annotation().MaxChar() != -1) + PutDoc("/MaxLen "+QString::number(ite->annotation().MaxChar())+"\n"); + break; case 4: PutDoc("/FT /Btn\n"); PutDoc(ite->annotation().IsChk() ? "/V /Yes\n/DV /Yes\n/AS /Yes\n" : @@ -4847,6 +4855,7 @@ case 6: case 5: case 3: + case 14: break; case 4: PutDoc("/CA "+EncString("("+ct+")",ObjCounter-1)+" "); @@ -4883,7 +4892,7 @@ PutDoc(" 0 R >>\n"); } } - if (ite->annotation().AAact()) + if ((ite->annotation().AAact()) && (ite->annotation().Type() != 14)) { if (!ite->annotation().Action().isEmpty()) { @@ -4924,7 +4933,7 @@ } break; } - if ((ite->annotation().Type() < 2) || (ite->annotation().Type() > 9)) + if ((ite->annotation().Type() < 2) || ((ite->annotation().Type() > 9) && (ite->annotation().Type() < 14))) PutDoc("/Border [ 0 0 0 ]\n"); switch (((abs(static_cast<int>(ite->rotation())) / 90)*90)) { @@ -4975,7 +4984,7 @@ PDF_xForm(img2.width(), img2.height(), cc); } } - if (ite->annotation().Type() == 3) + if (ite->annotation().Type() == 3 || ite->annotation().Type() == 14) { cc = ""; if (ite->fillColor() != CommonStrings::None) @@ -5038,7 +5047,7 @@ } if ((ite->annotation().Type() > 1) && ((ite->annotation().ActionType() == 1) || (ite->annotation().AAact())) && (!ite->annotation().Action().isEmpty())) WritePDFString(ite->annotation().Action()); - if ((ite->annotation().Type() > 1) && (ite->annotation().AAact())) + if ((ite->annotation().Type() > 1) && (ite->annotation().Type() != 14) && (ite->annotation().AAact())) { StartObj(ObjCounter); ObjCounter++; @@ -5069,7 +5078,7 @@ PutDoc("/Bl << /Type /Action /S /JavaScript /JS "+QString::number(ObjCounter+AAcoun)+" 0 R >>\n"); AAcoun++; } - if ((ite->annotation().Type() == 3) || (ite->annotation().Type() == 5) || (ite->annotation().Type() == 6)) + if ((ite->annotation().Type() == 3) || (ite->annotation().Type() == 14) || (ite->annotation().Type() == 5) || (ite->annotation().Type() == 6)) { if (!ite->annotation().K_act().isEmpty()) { @@ -5107,7 +5116,7 @@ WritePDFString(ite->annotation().Fo_act()); if (!ite->annotation().Bl_act().isEmpty()) WritePDFString(ite->annotation().Bl_act()); - if ((ite->annotation().Type() == 3) || (ite->annotation().Type() == 5) || (ite->annotation().Type() == 6)) + if ((ite->annotation().Type() == 3) || (ite->annotation().Type() == 14) || (ite->annotation().Type() == 5) || (ite->annotation().Type() == 6)) { if (!ite->annotation().K_act().isEmpty()) WritePDFString(ite->annotation().K_act()); === modified file 'scribus/po/scribus.ca.ts' --- scribus/po/scribus.ca.ts 2008-11-13 15:46:29 +0000 +++ scribus/po/scribus.ca.ts 2008-11-17 15:02:34 +0000 @@ -4854,6 +4854,10 @@ <translation>Quadre de Llista</translation> </message> <message> + <source>Digital Signature</source> + <translation>Signatura digital</translation> + </message> + <message> <source>Properties</source> <translation>Propietats</translation> </message> @@ -26380,6 +26384,10 @@ <translation>Quadre de Llista</translation> </message> <message> + <source>Digital Signature</source> + <translation>Signatura digital</translation> + </message> + <message> <source>Insert PDF Fields</source> <translation>Inserir Camps PDF</translation> </message> === modified file 'scribus/po/scribus.es_ES.ts' --- scribus/po/scribus.es_ES.ts 2008-11-13 15:46:29 +0000 +++ scribus/po/scribus.es_ES.ts 2008-11-17 15:02:34 +0000 @@ -3978,6 +3978,10 @@ <translation>Casilla de lista</translation> </message> <message> + <source>Digital Signature</source> + <translation>Firma digital</translation> + </message> + <message> <source>Properties</source> <translation>Propiedades</translation> </message> @@ -18037,6 +18041,10 @@ <translation>Casilla de lista</translation> </message> <message> + <source>Digital Signature</source> + <translation>Signatura digital</translation> + </message> + <message> <source>Insert PDF Fields</source> <translation>Insertar campos PDF</translation> </message> === modified file 'scribus/qm/scribus.ca.qm' Binary files scribus/qm/scribus.ca.qm 2008-11-13 15:46:29 +0000 and scribus/qm/scribus.ca.qm 2008-11-19 10:09:41 +0000 differ === modified file 'scribus/scribus.cpp' --- scribus/scribus.cpp 2008-11-13 15:46:29 +0000 +++ scribus/scribus.cpp 2008-11-17 17:32:01 +0000 @@ -5704,6 +5704,7 @@ case modeInsertPDFCheckbox: case modeInsertPDFCombobox: case modeInsertPDFListbox: + case modeInsertPDFSignature: case modeInsertPDFTextAnnotation: case modeInsertPDFLinkAnnotation: case modeDrawFreehandLine: @@ -8354,7 +8355,7 @@ if (doc->m_Selection->count() != 0) { PageItem *currItem = doc->m_Selection->itemAt(0); - if ((currItem->annotation().Type() == 0) || (currItem->annotation().Type() == 1) || (currItem->annotation().Type() > 9)) + if ((currItem->annotation().Type() == 0) || (currItem->annotation().Type() == 1) || ((currItem->annotation().Type() > 9) && (currItem->annotation().Type() < 14))) { int AnType = currItem->annotation().Type(); int AnActType = currItem->annotation().ActionType(); === modified file 'scribus/scribusstructs.h' --- scribus/scribusstructs.h 2008-11-13 15:46:29 +0000 +++ scribus/scribusstructs.h 2008-11-17 15:02:34 +0000 @@ -371,6 +371,7 @@ modeInsertPDFCheckbox, modeInsertPDFCombobox, modeInsertPDFListbox, + modeInsertPDFSignature, modeInsertPDFTextAnnotation, modeInsertPDFLinkAnnotation, modeDrawFreehandLine, === modified file 'scribus/scribusview.cpp' --- scribus/scribusview.cpp 2008-11-13 15:46:29 +0000 +++ scribus/scribusview.cpp 2008-11-17 17:32:01 +0000 @@ -5390,6 +5390,7 @@ case modeInsertPDFCheckbox: case modeInsertPDFCombobox: case modeInsertPDFListbox: + case modeInsertPDFSignature: case modeInsertPDFTextAnnotation: case modeInsertPDFLinkAnnotation: selectPage(m); @@ -5416,6 +5417,9 @@ case modeInsertPDFListbox: currItem->annotation().setType(6); break; + case modeInsertPDFSignature: + currItem->annotation().setType(14); + break; case modeInsertPDFTextAnnotation: currItem->annotation().setType(10); break; === modified file 'scribus/werktoolb.cpp' --- scribus/werktoolb.cpp 2008-11-13 15:46:29 +0000 +++ scribus/werktoolb.cpp 2008-11-17 15:02:34 +0000 @@ -163,7 +163,7 @@ { int c = PDFM->indexOf(id); PDFwerkz = c; - QString tmp[] = {"pushbutton.png", "textview.png", "checkbox.png", "combobox.png", "listbox.png"}; + QString tmp[] = {"pushbutton.png", "textview.png", "checkbox.png", "combobox.png", "listbox.png", "signature.png"}; PDFTool->setPixmap(loadIcon(tmp[c])); PDFTool->setOn(true); PDFaTool->setOn(false); @@ -189,8 +189,8 @@ void WerkToolBP::languageChange() { PDFM->clear(); - QString tmp_icn[] = {"pushbutton.png", "textview.png", "checkbox.png", "combobox.png", "listbox.png"}; - QString tmp_txt[] = { tr("Button"), tr("Text Field"), tr("Check Box"), tr("Combo Box"), tr("List Box")}; + QString tmp_icn[] = {"pushbutton.png", "textview.png", "checkbox.png", "combobox.png", "listbox.png", "signature.png"}; + QString tmp_txt[] = { tr("Button"), tr("Text Field"), tr("Check Box"), tr("Combo Box"), tr("List Box"), tr("Digital Signature")}; size_t ar_tmp = sizeof(tmp_icn) / sizeof(*tmp_icn); for (uint a = 0; a < ar_tmp; ++a) PDFM->insertItem(loadIcon(tmp_icn[a]), tmp_txt[a]); |
|
Sorry, i can't apply this patch because it really creates Signature fields, but these Signatures are not vaild. They are missing the required "/V" entry, which should contain a Digital Signature dictionary. See the PDF Reference: - Chapter 8.6.3 -> Signature Fields - Chapter 8.7 Digital Signatures |
|
This is not to digitally sign the document; for that, Scribus would have to include cryptographic libraries. This new field type is just a *placeholder* for the signature, and it is other program's job to find this field and store the digital signature there. Library Itext could successfully sign in this way the documents I produced with my patch, and I think that Acrobat Reader too. Then this field was displayed as valid/invalid in viewers. The /V entry seems to be optional. From the PDF 1.8 reference ( http://www.adobe.com/devnet/pdf/pdf_reference.html ), page 446 (12.7.4.5 Signature Fields): „The field type (FT) shall be Sig, and the field value (V), if present, shall be a signature dictionary containing the signature and specifying various attributes of the signature field (see Table 252).“ |
|
I meant PDF 1.7. But in PDF 1.5, it is the same: V is optional for the signature field. |
|
I should make clear that users sign the PDF only *after* filling out the form; the signing process occurs thus in the PDF viewer and not in the form design tool (Scribus). |
|
what's the fate of this ticket ? |
|
I did that patch when I needed to create PDF forms which can be digitally signed, and I remember it worked. As stated above, it's just a placeholder (similar to a textbox) but one that will trigger cryptographic operations in the PDF viewer. I don't create PDF anymore and I don't know the current status in Scribus 1.4. If noone can test and maintain this feature, you can close this bug, and whoever needs it again can change the source code and recompile. |
|
It is possible to add this feature (digital signature field) to Scribus? |
|
I think, there is only one FOSS implementation for signature field: eforms latex package (https://ctan.org/pkg/eforms) See documentation: https://mirrors.ctan.org/macros/latex/contrib/acrotex/doc/eformman.pdf (page 16, "2.4. Signature Fields"). Here is what this latex do: http://tug.ctan.org/tex-archive/macros/latex/contrib/acrotex/eforms.dtx \def\sigFieldDefaults{\F{\FPrint}\BC{}\BG{}\W{1}\S{S}} \def\common@SigFieldCode {% /Subtype /Widget /T (\Fld@name) /FT/Sig \eq@F \eq@TU /BS <<\eq@W\eq@S>> /MK <<\eq@R\eq@BC\eq@BG\eq@mkIns>> /DA (\eq@DA) \eq@Lock \eq@A\eq@AA \eq@rawPDF } Devs, is it possible to implement this feature in Scribus? |
|
I found an other much simpler latex implementation. See: http://home.htp-tel.de/lottermose2/tex/dist/digsig.sty \newcommand{\PDFFormExtension@Signature}{% /T (\Fld@name) /Subtype /Widget /FT /Sig /F \ifFld@hidden 2\else 4\fi\space /Q \Fld@align\space /MK << /BC [] >>} |
|
I tried a workaround but did not succeed: Add signature field as latex render frame and export pdf with "Embed PDF and EPS files (experimental)" option. But it's not working :-(. We need a native implementation. |
|
Hi @JLuc, I'm not a programmer. therefore I hope you can review the original patch. I can contribute the missing icon for this feature, that's all. Here it is s simple icon. |
|
personally, i would only push for this feature, if we have a documented way for signing the pdf and then "viewing" the the result with free software on free operating systems. scribus is a layout program for print and pdf forms are only a "byproduct", not an important feature. that's why i'd prefer to only implement such non-core features, if they do (also) work with free software. i tried to find out if it's possible to do the full signing process and then view the signed document with free software and i could not find out how i could do it. but i admit that i did not try very hard. so @bubu, as a non programmer, you could provide such a documentation : - ) |
|
|
|
Personally my motivation is to provide GDPR compliant PDF forms. This is an actual feature for Europe. @ale I understood you. I made a small research and provide some documentation and examples. I hope this helps. See previously attached first PDF. |
|
i have had a look at "Create PDF Signature field in Scribus.pdf " and while i felt a bit lost, i had the feeling that even if scribus applies the given patch there is no way to complete the signature process with free software only. and there is no way to read the signature either with free software. is this correct? |
|
@ale, yes. - Signing: Currently we cant's sign with free software. But in poppler this in on his way: https://gitlab.freedesktop.org/poppler/poppler/issues/465 - Checking: Reading is still supported with poppler's command line tool: pdfsig. |
Date Modified | Username | Field | Change |
---|---|---|---|
2009-01-27 16:43 | dclemente | New Issue | |
2009-01-27 16:43 | dclemente | File Added: digital-signature.patch | |
2009-01-31 12:08 | fschmid | Note Added: 0021053 | |
2009-02-02 21:42 | mhanski | Relationship added | child of 0003831 |
2009-02-04 11:24 | dclemente | Note Added: 0021070 | |
2009-02-04 11:29 | dclemente | Note Added: 0021071 | |
2009-03-26 11:08 | dclemente | Note Added: 0021411 | |
2014-06-13 00:35 | Kunda | Tag Attached: patch | |
2014-10-24 23:00 | Kunda | Patch | => Yes |
2016-01-15 20:15 | Kunda | Note Added: 0038180 | |
2016-01-18 18:59 | dclemente | Note Added: 0038255 | |
2019-06-27 15:00 | bubu | Note Added: 0046345 | |
2019-06-27 16:31 | JLuc | Description Updated | |
2019-06-27 18:15 | bubu | File Added: eforms generated one signature field.pdf | |
2019-06-27 18:15 | bubu | Note Added: 0046346 | |
2019-06-28 07:31 | bubu | Note Added: 0046347 | |
2019-06-28 08:32 | bubu | File Added: Digital signature test with latex digsig.pdf | |
2019-06-28 08:32 | bubu | File Added: Digital signature test with latex digsig.sla | |
2019-06-28 08:32 | bubu | File Added: Digital signature test with latex eforms.pdf | |
2019-06-28 08:32 | bubu | File Added: Digital signature test with latex eforms.sla | |
2019-06-28 08:32 | bubu | Note Added: 0046348 | |
2019-07-01 06:22 | bubu | File Added: pdf_signature.svg | |
2019-07-01 06:22 | bubu | File Added: pdf_signature.png | |
2019-07-01 06:22 | bubu | Note Added: 0046353 | |
2019-07-01 09:52 | JLuc | Tag Attached: #rottenpatch | |
2019-07-01 12:49 | ale | Note Added: 0046355 | |
2019-07-10 13:55 | bubu | File Added: Create PDF Signature field in Scribus.pdf | |
2019-07-10 13:55 | bubu | File Added: PDF_form.sla | |
2019-07-10 13:55 | bubu | File Added: PDF_form_(Scribus).pdf | |
2019-07-10 13:55 | bubu | File Added: PDF_form_(Scribus)_signed_with_JSignPdf.pdf | |
2019-07-10 13:55 | bubu | File Added: PDF_form_(Scribus)_signed_with_PortableSigner.pdf | |
2019-07-10 13:55 | bubu | File Added: Empty_signature_field_example_(digsig).pdf | |
2019-07-10 13:55 | bubu | File Added: Empty_signature_field_example_(digsig)_signed_with_Adobe_Reader_DC_Win.pdf | |
2019-07-10 13:55 | bubu | File Added: Empty_signature_field_example_(digsig)_signed_with_Master_PDF_Editor.pdf | |
2019-07-10 13:55 | bubu | File Added: Empty_signature_field_example_(eform).pdf | |
2019-07-10 13:55 | bubu | File Added: Empty_signature_field_example_(eform)_signed_with_Adobe_Reader_DC_Win.pdf | |
2019-07-10 15:18 | bubu | File Added: Empty_signature_field_example_(eform)_signed_with_Master_PDF_Editor.pdf | |
2019-07-10 15:18 | bubu | File Added: Empty_signature_field_example_(Adobe_Acrobat).pdf | |
2019-07-10 15:18 | bubu | File Added: Empty_signature_field_example_(Adobe_Acrobat)_signed_with_Adobe_Reader.pdf | |
2019-07-10 15:18 | bubu | File Added: Empty_signature_field_example_(Adobe_Acrobat)_signed_with_Adobe_Reader_DC_Win.pdf | |
2019-07-10 15:18 | bubu | File Added: Empty_signature_field_example_(Adobe_Acrobat)_signed_with_Master_PDF_Editor.pdf | |
2019-07-10 15:18 | bubu | Note Added: 0046371 | |
2019-07-10 21:08 | ale | Note Added: 0046373 | |
2019-07-10 21:23 | bubu | Note Added: 0046374 |