The string contains characters that are not digits. You may have to investigate the exact content of the strings and possibly add extra conditions before you extract it to eliminate some characters before they are conveted to a number.
In function TPAdES.FirstPart(ts: TStringList): string;
Replace
begin
Ffirstobjnumber := StrToInt(ExtractNumber(copy(ts.Strings[0], 0, Pos(' ', ts.Strings[0]))));
By
s: string; // add this definition to the var section
begin
s := copy(ts.Strings[0], 0, Pos(' ', ts.Strings[0]));
if System.Character.IsDigit(s[1]) = true then
Ffirstobjnumber := StrToInt(ExtractNumber(copy(ts.Strings[0], 0, Pos(' ', ts.Strings[0]))))
else begin
i := Pos(' ', ts.Strings[0]);
s := ts.Strings[0].Substring(i, ts.Strings[0].Length);
Ffirstobjnumber := StrToInt(ExtractNumber(copy(s, 0, Pos(' ', s))));
end;
I signed your file with this change and my USB token. The issue was there is an extra ' ' in the string before what we need to extract and this raised an exception as the extracted substring could not be converted to a number.