Wiki source code of SignPDF
Last modified by Outhman Moustaghfir on 2023/05/26 18:24
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.2 | 1 | == Introduction == |
2 | |||
3 | SignPDF connector helps to sign digitally all kinds of PDF with some private key. | ||
4 | |||
5 | [[image:2022-01-03_11h41_18.png||height="116" width="89"]] | ||
6 | |||
7 | == Parameters == | ||
8 | |||
9 | The required parameters in this connector are : | ||
10 | |||
![]() |
4.148 | 11 | * **Output FileName**: the folder and the name of the output signed PDF, eg: '/out/Signed.pdf' , '/work/digSign.pdf' ... |
![]() |
9.1 | 12 | ** __//NB//:__ putting the output signed pdf in out allows to show and download from the exploitation page. |
![]() |
11.1 | 13 | * **Key Store**: allows uploading a certain key store (containing the key pair: public and private) or selecting one among the already imported key stores. |
14 | * **Password**: the password for recovering the key store. | ||
![]() |
1.2 | 15 | * **Crypto Algorithm: **the algorithm used for data encryption. |
16 | * **Crypto Standard ** | ||
17 | |||
![]() |
10.1 | 18 | Other optional parameters that can be used to draw a rectangle containing a block of information, either a text , image or both : |
![]() |
1.2 | 19 | |
![]() |
16.1 | 20 | * **Position**: coordinates of the drawn rectangle split by ';' ( **//x ; y ; width ; height//** ), the page is set by default to __**//the last page//**__, but if the page must be specified, it can be added at the position coordinates like ( **//x ; y ; width ; height//** //**; page**//), eg : "22;22;300 ;450 ; 2" or "5;0;70 ;130" ... And another param is added to Position so you can specify the font size of the text as ( **//x ; y ; width ; height//** //**; page; fontSize**//) the default value is set to 10, but if you want to ignore the page param you have to set it like ( **//x ; y ; width ; height//** //**; -1 ; fontSize**//) so it will sign on the last page with the font size value wanted |
21 | * **Signature Text: ** the text to fill in the drawn rectangle. you can use the tag '<br>' in your text in order to add a new line in your text. | ||
22 | **eg : **Approuvé<br>Signé par iXPath <br> le {System.Date;yyyy/MM/dd} it will display the following result : | ||
23 | Approuvé | ||
24 | Signé par iXPath | ||
25 | Le 2023/01/20 | ||
![]() |
9.1 | 26 | * **Signature image~: **the image to be inserted. |
![]() |
19.1 | 27 | * **QR Code : **Generate a QR code for the desired text and use it to digitally sign the file**.** |
![]() |
1.2 | 28 | |
![]() |
19.1 | 29 | [[image:signµPdf.png||height="395" width="272"]] |
30 | |||
![]() |
4.152 | 31 | == Example == |
![]() |
4.4 | 32 | |
![]() |
4.154 | 33 | Let's take a simple case where we create FileListener and SignPDF connectors in one scenario : |
34 | |||
![]() |
5.2 | 35 | [[image:2022-01-03_15h03_57.png]] |
![]() |
4.154 | 36 | |
![]() |
9.1 | 37 | we keep the same SignPDF configuration as previously. The connector should draw a rectangle on x = 0 & y = 0, with width = 200 and height = 100, and fill it only with an image (ixpath.png). |
38 | |||
![]() |
7.6 | 39 | if trigger the scenario with a pdf with no signature : |
![]() |
4.154 | 40 | |
![]() |
7.4 | 41 | (% class="box" %) |
42 | ((( | ||
![]() |
9.1 | 43 | ##__[[image:2022-01-03_15h26_57.png||class="img-rounded" height="357" width="254"]]__ the output PDF will look like this: ##[[image:2022-01-03_15h46_31.png||height="386" width="271"]] |
![]() |
7.4 | 44 | ))) |
![]() |
7.2 | 45 | |
![]() |
8.9 | 46 | The signed pdf will contain the certificate and all information linked to it. |
![]() |
16.1 | 47 | |
48 | |||
49 | = Updates = | ||
50 | |||
51 | * the text is longer combined with the image in one single frame when combined as : | ||
52 | |||
53 | [[image:1674215066969-265.png||height="185" width="278"]] | ||
54 | |||
55 | they will be displayed separately, the image will be on top, and the text on the bottom of the frame : | ||
56 | |||
57 | [[image:image (1).png]] | ||
![]() |
19.1 | 58 | |
59 | |||
![]() |
20.1 | 60 | * Sample PDF Document with Signature Text, Signature Image, and QR Code: |
![]() |
19.1 | 61 | |
62 | **[[image:MicrosoftTeams-image (1).png||height="190" width="369"]]** |