esig / dss-demonstrations

Examples of DSS integration
GNU Lesser General Public License v2.1
92 stars 70 forks source link

Visible Signature via RestAPI #50

Closed rlanzettaAlm closed 10 months ago

rlanzettaAlm commented 10 months ago

Hi when I sign a document via restAPI including the ImageParameters section the produced file reports that the document has been modified.

POST - /services/rest/signature/one-document/signDocument

"imageParameters" : {
  "alignmentHorizontal" : null,
  "alignmentVertical" : null,
  "imageScaling" : null,
  "backgroundColor" : null,
  "dpi" : null,
  "image" : null,
  "rotation" : null,
  "fieldParameters" : {
    "fieldId" : null,
    "originX" : 400,
    "originY" : 750,
    "width" : 60.0,
    "height" : 30.0,
    "page" : 1
  },
  "textParameters" : {
    "backgroundColor" : {
      "red" : 255,
      "green" : 255,
      "blue" : 255,
      "alpha" : 255
    },
    "font" : null,
    "textWrapping" : "FILL_BOX_AND_LINEBREAK",
    "padding" : null,
    "signerTextHorizontalAlignment" : "CENTER",
    "signerTextVerticalAlignment" : null,
    "signerTextPosition" : "TOP",
    "size" : 12,
    "text" : "Firmato digitalmente",
    "textColor" : {
      "red" : 0,
      "green" : 0,
      "blue" : 255,
      "alpha" : 255
    }
  },
  "zoom" : null
},

image

If i remove the ImageParameters section it works!

pvandenbroucke commented 10 months ago

Hi,

Do you provide the same parameters to getDataToSign and signDocument ? DSS is stateless and requires to get same parameters at each calls.

Please refer to the documentation.

Regards,

Pierrick

rlanzettaAlm commented 10 months ago

Thanks Pierrick, you're right!

That's exactly the mistake