PdfDocumentSettings Enumeration |
Namespace: RadPdf.Data.Document
Member name | Value | Description | |
---|---|---|---|
None | 0 | Open PDF with default settings. | |
EnableSubmit | 1 | Enable the "submitting" of the file using form field buttons in the document. If set, clicking a PdfButtonField fields with IsSubmit will submit (save) the document (and those with IsReset will reset the form). | |
DisableRedaction | 65536 | Disable RAD PDF's redaction (experimental) feature. Redaction is an experimental feature and will only redact searchable text characters (not images or vectors), so please use at your own risk! | |
DisableEmbeddedFiles | 131072 | Disable access to embeded files (including file attachment annotations) in this document. | |
EnforceRequired | 262144 | Require that PDF form fields marked as Required contain values prior to submission. EnableSubmit must be set to use this setting. | |
DisableDownload | 2 | Disable downloading in a PdfWebControl interface. | |
DisablePrint | 524288 | Disable printing of this document. | |
DisableSelectText | 2097152 | Disable the selection of text in the document. | |
DisableSearchText | 536870912 | Disable searching for specific text in the document. | |
DisableAppend | 4 | Disable appending another file to this document. | |
FlattenForm | 8 | Flatten form fields of all saved or downloaded documents so the document appears as it would when printed. | |
DisableAddSignatureShapes | 16 | Enable the GUI creation of signature shape boxes. | |
DisableAlterObjects | 64 | Disable any movement, resizing, or property changes of objects. | |
DisableInformation | 128 | Disable the modifying of document information tags (e.g. title, author, subject, keywords). | |
DisableSecurity | 256 | Disable the setting of document security settings and passwords. | |
DisableAddPolygonShapes | 512 | Disable the addition of polygon shapes (includes rectangles and ellipses). | |
DisableAddFormFields | 1024 | Disable the addition of form fields. | |
DisableAddLinks | 2048 | Disable the addition of links. | |
DisableAddText | 4096 | Disable the addition of text. | |
DisableAddImages | 8192 | Disable the addition of images. | |
DisableAddAnnotations | 16384 | Disable the addition of annotations. | |
DisableAlterBookmarks | 32768 | Disable the addition / deletion / changing of bookmarks. | |
DisableAlterDestinations | 1073741824 | Disable the addition / deletion / changing of destinations (future use). | |
DisableAlterPages | 1048576 | Disable the deleting, moving, or rotating of pages. | |
DisableFormFields | 4194304 | Disable the use of form fields in the document. | |
DisableAnnotations | 8388608 | Disable the use of annotations in the document. | |
DisableAlterLinks | 16777216 | Disable the altering of links in the document (future use). | |
DisableDeleteFormFields | 33554432 | Disable the deletion of original form fields in the document. | |
DisableAddWhiteoutShapes | 67108864 | Disable the addition of whiteout shapes. | |
DisableAddLineShapes | 134217728 | Disable the addition of line shapes (includes line and arrow shapes). | |
DisableAddCheckShapes | 268435456 | Disable the addition of check shapes. (This does not disable checkbox form fields) | |
DisableAddShapes | 469762576 | Disable the addition of vector shapes (does not disable the addition of text shapes). | |
DisableInsertTools | 469777936 | Disable all tools found on the PdfWebControl "Insert" tab. | |
DisableAnnotateTools | 16384 | Disable all tools found on the PdfWebControl "Annotate" tab. | |
DisablePageTools | 1048580 | Disable all tools found on the PdfWebControl "Page" tab. | |
DisableTools | 470842900 | Disable all tools found in the PdfWebControl tools area. | |
IsReadOnly | 1607532500 | Document should be opened as read-only. | |
IsReadOnlyExceptFormFields | 1603338196 | Document should be opened as read-only, except form fields should remain fillable. |
These settings can be combined as they are bit flags.
To "Unlock" original form fields, neither DisableAddFormFields nor DisableDeleteFormFields can be set.
using System; using RadPdf.Data.Document; partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //Get PDF as byte array from file (or database, browser upload, remote storage, etc) byte[] pdfData = System.IO.File.ReadAllBytes(@"C:\demo.pdf"); //Load PDF byte array into RAD PDF //Use the PdfDocumentSettings to disable printing and prevent form fields from being deleted this.PdfWebControl1.CreateDocument("Document Name", pdfData, PdfDocumentSettings.DisablePrint | PdfDocumentSettings.DisableDeleteFormFields); } } }
<%@ Page Language="C#" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Assembly="RadPdf" Namespace="RadPdf.Web.UI" TagPrefix="radPdf" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>RAD PDF Sample</title> </head> <body> <form id="form1" runat="server"> <div> <radPdf:PdfWebControl id="PdfWebControl1" runat="server" height="600px" width="100%" /> </div> </form> </body> </html>
using System; using RadPdf.Data.Document; using RadPdf.Lite; partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Get PDF as byte array from file (or database, browser upload, remote storage, etc) byte[] pdfData = System.IO.File.ReadAllBytes(@"C:\demo.pdf"); // Create PdfLiteSettings PdfLiteSettings settings = new PdfLiteSettings(); // Use the PdfDocumentSettings to disable printing and prevent form fields from being deleted settings.DocumentSettings = PdfDocumentSettings.DisablePrint | PdfDocumentSettings.DisableDeleteFormFields; // Load PDF byte array into RAD PDF this.PdfWebControlLite1.CreateDocument("Document Name", pdfData, settings); } } }
<%@ Page Language="C#" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Assembly="RadPdf" Namespace="RadPdf.Web.UI" TagPrefix="radPdf" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>RAD PDF Lite Document Sample</title> </head> <body> <form id="form1" runat="server"> <div> <radPdf:PdfWebControlLite id="PdfWebControlLite1" runat="server" height="600px" width="100%" /> </div> </form> </body> </html>