<span style=“font-size: 11pt; line-height: 115%; font-family: “Calibri”,“sans-serif”;” lang=“EN-AU”>Hi,
I
am generating a .Pdf file using Aspose.pdf 4.8.0. Every thing is working
fine but as per our requirement the generated pdf should only available
for read purpose and no one can do <!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</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:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<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]–><!–[if gte mso 10]>
<![endif]–><span style=“font-size: 11pt; line-height: 115%; font-family: “Calibri”,“sans-serif”;” lang=“EN-AU”>Copy,
Paste, Print, Print Screen, Email, Save, Save As etc. Other than Save As and Print Screen, other options are disabled. I have written the following code
Aspose.Pdf.Pdf document = new Aspose.Pdf.Pdf();<span style=“font-size: 11pt; line-height: 115%; font-family: “Calibri”,“sans-serif”;” lang=“EN-AU”>How to achieve the same using Aspose.
Aspose.Pdf.Section section = document.Sections.Add();
Aspose.Pdf.Text text1 = new Aspose.Pdf.Text(“HTML contents will be displayed under this line”);
section.Paragraphs.Add(text1);
Aspose.Pdf.Security security = new Aspose.Pdf.Security();
security.IsAnnotationsModifyingAllowed = false;
security.IsContentsModifyingAllowed = false;
security.IsCopyingAllowed = false;
security.IsDegradedPrintingAllowed = false;
security.IsDocumentAssemblyingAllowed = false;
security.IsFormFillingAllowed = false;
security.IsPrintingAllowed = false;
security.IsScreenReadersAllowed = false;
document.Security = security;
document.Save(“test.pdf”);