Click or drag to resize

PdfDocumentSettings Enumeration

Settings for a document opened in PdfWebControl

Namespace:  RadPdf.Data.Document
Assembly:  RadPdf (in RadPdf.dll) Version: 3.44.0.0 (3.44.0.0)
Syntax
[FlagsAttribute]
public enum PdfDocumentSettings
Members
  Member nameValueDescription
None0 Open PDF with default settings.
EnableSubmit1 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).
DisableRedaction65536 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!
EnforceRequired262144 Require that PDF form fields marked as Required contain values prior to submission. EnableSubmit must be set to use this setting.
DisableDownload2 Disable downloading in a PdfWebControl interface.
DisablePrint524288 Disable printing of this document.
DisableSelectText2097152 Disable the selection of text in the document.
DisableSearchText536870912 Disable searching for specific text in the document.
DisableAppend4 Disable appending another file to this document.
FlattenForm8 Flatten form fields of all saved or downloaded documents so the document appears as it would when printed.
DisableAddSignatureShapes16 Enable the GUI creation of signature shape boxes.
DisableAlterObjects64 Disable any movement, resizing, or property changes of objects.
DisableInformation128 Disable the modifying of document information tags (e.g. title, author, subject, keywords).
DisableSecurity256 Disable the setting of document security settings and passwords.
DisableAddPolygonShapes512 Disable the addition of polygon shapes (includes rectangles and ellipses).
DisableAddFormFields1024 Disable the addition of form fields.
DisableAddLinks2048 Disable the addition of links.
DisableAddText4096 Disable the addition of text.
DisableAddImages8192 Disable the addition of images.
DisableAddAnnotations16384 Disable the addition of annotations.
DisableAlterBookmarks32768 Disable the addition / deletion / changing of bookmarks.
DisableAlterDestinations1073741824 Disable the addition / deletion / changing of destinations (future use).
DisableAlterPages1048576 Disable the deleting, moving, or rotating of pages.
DisableFormFields4194304 Disable the use of form fields in the document.
DisableAnnotations8388608 Disable the use of annotations in the document.
DisableAlterLinks16777216 Disable the altering of links in the document (future use).
DisableDeleteFormFields33554432 Disable the deletion of original form fields in the document.
DisableAddWhiteoutShapes67108864 Disable the addition of whiteout shapes.
DisableAddLineShapes134217728 Disable the addition of line shapes (includes line and arrow shapes).
DisableAddCheckShapes268435456 Disable the addition of check shapes. (This does not disable checkbox form fields)
DisableAddShapes469762576 Disable the addition of vector shapes (does not disable the addition of text shapes).
DisableInsertTools469777936 Disable all tools found on the PdfWebControl "Insert" tab.
DisableAnnotateTools16384 Disable all tools found on the PdfWebControl "Annotate" tab.
DisablePageTools1048580 Disable all tools found on the PdfWebControl "Page" tab.
DisableTools470842900 Disable all tools found in the PdfWebControl tools area.
IsReadOnly1607532500 Document should be opened as read-only.
IsReadOnlyExceptFormFields1603338196 Document should be opened as read-only, except form fields should remain fillable.
Remarks

These settings can be combined as they are bit flags.

To "Unlock" original form fields, neither DisableAddFormFields nor DisableDeleteFormFields can be set.

Examples
The following aspx and code behind files use the CreateDocument method to open a new document from the local file system using the PdfWebControl:
C#
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);
        }
    }
}
XML
<%@ 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>
PdfDocumentSettings can also be used with the PdfWebControlLite when using Lite Documents as seen below:
C#
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);
        }
    }
}
XML
<%@ 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>
See Also