Home > Blockchain >  Visible signature in PDF file (2)
Visible signature in PDF file (2)

Time:01-29

Continuing from this question, the PDF is now constructed as such:

8 0 obj
<</F 132/Type/Annot/Subtype/Widget/Rect[2 198 100 190]/FT/Sig/DR<<>>/T(Signature1)/V 6 0 R/P 3 0 R/AP<</N 7 0 R>>>>
endobj
6 0 obj
<</Contents <...>/Type/Sig/SubFilter/ETSI.CAdES.detached/M(D:20230128131946 00'00')/ByteRange [0 830 60832 1714]/Filter/Adobe.PPKLite>>
endobj
9 0 obj
<</BaseFont/Helvetica/Type/Font/Subtype/Type1/Encoding/WinAnsiEncoding/Name/Helv>>
endobj
10 0 obj
<</BaseFont/ZapfDingbats/Type/Font/Subtype/Type1/Name/ZaDb>>
endobj
12 0 obj<</Font 13 0 R>>
endobj
13 0 obj<</FAdESFont1 14 0 R>>
endobj
14 0 obj<</Type /Font /Subtype /Type1 /BaseFont /Helvetica>>
endobj
15 0 obj
<</Length 90>>stream
BT
2 194 TD
/FAdESFont1 5 Tf
([email protected] MICHAIL CHOURDAKIS 1/28/2023 15:19:46) Tj
ET

endstream
endobj
7 0 obj
<</Type/XObject/Resources<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]>>/Subtype/Form/BBox[2 198 100 190]/Length 90/FormType 1/Filter/FlateDecode>>stream
BT
2 194 TD
/FAdESFont1 5 Tf
([email protected] MICHAIL CHOURDAKIS 1/28/2023 15:19:46) Tj
ET

endstream
endobj
3 0 obj
<</Type/Page/Parent 2 0 R/Resources<</Font<</F1 4 0 R>>>>/Contents 5 0 R/Annots[8 0 R]>>
endobj
2 0 obj
<</Type/Pages/MediaBox[0 0 200 200]/Count 1/Kids[3 0 R]>>
endobj
1 0 obj
<</AcroForm<</Fields[8 0 R]/DR<</Font<</Helv 9 0 R/ZaDb 10 0 R>>>>/DA(/Helv 0 Tf 0 g )/SigFlags 3>>/Type/Catalog/Pages 2 0 R>>
endobj
11 0 obj
<</Producer(AdES Tools https://www.turboirc.com)/ModDate(D:20230128131946 00'00')>>
endobj
xref
0 4
0000000000 65535 f 
0000061862 00000 n 
0000061787 00000 n 
0000061681 00000 n 
6 10
0000000810 00000 n 
0000061409 00000 n 
0000000679 00000 n 
0000060958 00000 n 
0000061056 00000 n 
0000062004 00000 n 
0000061133 00000 n 
0000061165 00000 n 
0000061203 00000 n 
0000061271 00000 n 
trailer
<</Root 1 0 R/Prev 492/Info 11 0 R/Size 20/ID[<6BD3BF95416A5C19FFBC464EC610875C><54ACC00AA74869363131BCC04E65417F>]>>
startxref
62104
%%EOF

The idea is:

  1. Create the annotation object (ID 8) which refers to the signature /V (6) and something to show ? /N (8).

  2. The annotation object is a stream containing the text?

    7 0 obj <</Type/XObject/Resources<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]>>/Subtype/Form/BBox[2 198 100 190]/Length 90/FormType 1/Filter/FlateDecode>>stream BT 2 194 TD /FAdESFont1 5 Tf ([email protected] MICHAIL CHOURDAKIS 1/28/2023 15:19:46) Tj ET

endstream endobj

This time adobe accepts the signature and has a "box" in which I can click to show signature information, but the text (mail name date) is not displayed.

What am I missing?

In the previous mode I was changing the content of the original root by I learned from this question that this is an incorrect way of adding a visible signature and will not work for re-signing.

CodePudding user response:

Your appearance stream in object 7 has some errors, in particular

  • Its resources dictionary does not contain a fonts section; so how should the text in it be rendered?
  • It claims to be flate-encoded but obviously is not.
  •  Tags:  
  • pdf
  • Related