We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Digital signature in PDF

Hi, I am trying to write a PDF document using PDF template. The PDF template has “Signing” set as allowed. The output PDF has “Signing” set as NOT allowed. This is stopping progress in my work as the output pdf has to be digitally sign-able. Please share a sample code snippet if possible.
Please help.Thanks in Advance.

Regards,
Development team

Hi Linda,


Thanks for contacting support.

While you are creating the PDF document, you can also specify the access privileges (also can enable document signing). For further details, please visit Set Privileges on an Existing PDF File (Facades)

[C#]

//create
DocumentPrivileges object
<o:p></o:p>

DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;

// Sets the change level of document's privilege. Just as the Adobe Professional's

// Changes Allowed settings. 0: None. 1: Inserting, Deleting and Rotating

// pages. 2: Filling in form fields and signing existing signature fields.

// 3: Commenting, filling in form fields, and signing existing signature fields.

// 4: Any except extracting pages.

privilege.ChangeAllowLevel = 2;

//open PDF document

PdfFileSecurity fileSecurity = new PdfFileSecurity();

fileSecurity.BindPdf("source.pdf");

//set document privileges

fileSecurity.SetPrivilege(privilege);

fileSecurity.Save("updatedfile.pdf");

Hi I used the below code but no luck. Can you please provide a POC or sample code ?

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>DE</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–>

DocumentPrivilege privilege = DocumentPrivilege.AllowAll; privilege.ChangeAllowLevel = 4;

privilege.AllowPrint = true;

privilege.AllowCopy = true;

PdfFileSecurity fileSecurity = new PdfFileSecurity(wordDocument); fileSecurity.SetPrivilege(privilege); /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}

<![endif]–>

Hi Linda,


Thanks for sharing the details.

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-36936. We will
investigate this issue in details and will keep you updated on the status of a
correction. <o:p></o:p>

We apologize for your inconvenience.

@eontrading

Could you please try using Aspose.PDF for .NET 21.8 and let us know in case you still notice any issues? We tested using the latest version and did not notice any issue.