Click or drag to resize

RedactionProposalAnnotation Class

The RedactionProposalAnnotation is a BaseMarkupAnnotation that is used to mark areas within a document that are proposed for redaction. The creation of this annotation on a page does not remove any content below it. That is left strictly to the PDF viewer and may or may not be supported. This particular annotation was only supported beginning with PDF version 1.7 and should be used with care. When a compliant viewer performs redaction based on one or more RedactionProposalAnnotation objects, it is instructed to remove all content under the area or areas specified and will remove the annotation but insert new content in its place. This content depends on the specification of the annotation. If the annotation does not specify any quadrilaterals in the Regions property, the area will be a rectangle specified by Bounds that is filled with the RedactionInteriorColor or black if none has been specified. If there are Regions specified, they will be used instead of Bounds. If OverlayText is specified, this text will be overlayed on top of the redacted area. If IsOverlayTextRepeated is true, then the text will be laid down in a repeating pattern. If RedactionTemplate is set, this template will be used for the redaction instead of all of the previous elements.
Inheritance Hierarchy

Namespace:  Atalasoft.PdfDoc.Generating.Annotations
Assembly:  Atalasoft.PdfDoc (in Atalasoft.PdfDoc.dll) Version: 11.0.0.0.0.297 (.NET 4.5.2, x86)
Syntax
public class RedactionProposalAnnotation : BaseMarkupAnnotation

The RedactionProposalAnnotation type exposes the following members.

Constructors
  NameDescription
Public methodRedactionProposalAnnotation
Initializes a new instance of the RedactionProposalAnnotation class with empty bounds.
Public methodRedactionProposalAnnotation(PdfBounds)
Initializes a new instance of the RedactionProposalAnnotation class.
Top
Properties
  NameDescription
Public propertyAdditionalActions
Gets the additional actions associated with the annotation. These are generally only used by widget annotations.
(Inherited from BaseAnnotation.)
Public propertyAnnotationType
Gets the type of the original PDF annotation if this annotation was imported from a file. This is generally only useful if the annotation was a type not recognized or not currently modeled by DotPdf
(Inherited from BaseAnnotation.)
Public propertyAppearance
Gets or sets the AppearanceSet for the annotation. This property defaults to null (no appearance set).
(Inherited from BaseAnnotation.)
Public propertyAuthorName
Gets or sets the name of the author of the annotation.
(Inherited from BaseMarkupAnnotation.)
Public propertyAutoGenerateBasicAppearance
Gets or sets a value indicating whether to auto generate a basic appearance for the proposed redaction. Generation of the appearance happens when the document is saved.
Public propertyBorder
Gets or sets the AnnotationBorder for this annotation.
(Inherited from BaseAnnotation.)
Public propertyBorderStyle
Gets or sets the BorderStyle for the annotation.
(Inherited from BaseAnnotation.)
Public propertyBounds
Gets or sets the bounding rectangle for this annotation.
(Inherited from BaseAnnotation.)
Public propertyClickActions
Gets the set of actions performed when the annotation has been clicked.
(Inherited from BaseAnnotation.)
Public propertyColor
Gets or sets the color of the annotation. The meaning of this color varies based on the annotation type. It may represent the background color of the annotation's icon (if any) when closed, the title bar of the annotation's pop-up window, the border color of the annotation.
(Inherited from BaseAnnotation.)
Public propertyContents
Gets or sets the text contents of the annotation. How contents is used depends on the annotation type. For example a StickyNoteAnnotation will use Contents to represent text the user has entered.
(Inherited from BaseAnnotation.)
Public propertyCreationDate
Gets the creation date of the annotation. When a new BaseMarkupAnnotation is constructed the CreationDate is automatically set to the current date and time. When a BaseMarkupAnnotation is read from a file, the CreationDate will reflect the date in the file.
(Inherited from BaseMarkupAnnotation.)
Public propertyDefaultAppearanceState
Gets or sets the name of the default appearance state for the annotation. In annotations that may have multiple possible states (say, "On" of "Off") this the name of the default state. In an annotation's "normal" state, this corresponds to Appearance.Normal[DefaultAppearanceState].
(Inherited from BaseAnnotation.)
Public propertyDefaultTextAppearance
Gets or sets the default text appearance for the annotation. If set to null, this will internally default to Helvetica 10 point.
Public propertyDocumentRevision
Gets the revision of the document in which this widget was found.
(Inherited from BaseAnnotation.)
Public propertyEnforceReadyOnlyWithException
Gets or sets a value indicating whether to enforce ready only with the ReadOnly propery with an exception.
(Inherited from BaseAnnotation.)
Public propertyHidden
Gets or sets a value indicating whether this BaseAnnotation is hidden. A hidden annotation is neither displayed nor printed by a viewer under any circumstances. Default is false.
(Inherited from BaseAnnotation.)
Public propertyInReplyTo
Gets or sets the BaseAnnotation that this annotation is in reply to.
(Inherited from BaseMarkupAnnotation.)
Public propertyInReplyToRelation
Gets or sets the relationship of this annotation to its InReplyTo. Default is Reply.
(Inherited from BaseMarkupAnnotation.)
Public propertyIntent
Gets or sets the intent of the annotation. Set automatically where required.
(Inherited from BaseMarkupAnnotation.)
Public propertyInvisible
Gets or sets a value indicating whether this BaseAnnotation is invisible. Invisibility specifically means that if the annotation is not recognized by the viewer, then it should not be displayed, otherwise the viewer may make a substitute appearance for the annotation. Default is false.
(Inherited from BaseAnnotation.)
Public propertyIsDirty
Gets or sets a value indicating whether the annotation is dirty and in need of being written.
(Inherited from BaseAnnotation.)
Public propertyIsOverlayTextRepeated
Gets or sets a value indicating whether the OverlayText, if present, will be repeated.
Protected propertyIsParentRequired
Gets a value indicating whether this instance requires the parent property.
(Inherited from BaseAnnotation.)
Public propertyIsReadOnlyOrFieldReadOnly
Determines whether the annotation is read only if either ReadOnly is true or if this object implements IFormElement, if IsFieldReadOnly is true.
(Inherited from BaseAnnotation.)
Public propertyIsTransparent
Gets or sets a value indicating whether this instance is transparent. This is an indication that there was no Color specified for the annotation.
(Inherited from BaseAnnotation.)
Public propertyLocked
Gets or sets a value indicating whether this BaseAnnotation is locked. A locked annotation may not be deleted or have its properties changed, but its contents (such as a form field) may still be editable.
(Inherited from BaseAnnotation.)
Public propertyModificationDate
Gets or sets the modification date for this annotation. DotPdf does not update this property. It is the client's responsibility to change it.
(Inherited from BaseAnnotation.)
Public propertyName
Gets or sets the name of the annotation. This name is meant to be a unique identifier for the annotation and may be use in scripts in PdfJavaScriptAction objects that want to find an annotation.
(Inherited from BaseAnnotation.)
Public propertyNoRotate
Gets or sets a value indicating whether the annotation should be rotated when a page is rotated. Default is false.
(Inherited from BaseAnnotation.)
Public propertyNoView
Gets or sets a value indicating whether the annotation is viewable and will interact with the user. This is different from hidden in that an annotation NoView set to true can be printed. This is a way, for example, to put watermarks on a page that only show when printed. Default is false.
(Inherited from BaseAnnotation.)
Public propertyNoZoom
Gets or sets a value indicating whether the annotation's appearance is scaled when the page is zoomed in. Default is false.
(Inherited from BaseAnnotation.)
Public propertyOverlayText
Gets or sets the overlay text that will be used on the redaction when placed.
Public propertyParentPage
Gets or sets the parent page that contains this annotation.
(Inherited from BaseAnnotation.)
Public propertyPopup
Gets or sets the a popup annotation for this annotation. A popup annotation can either be hidden or shown and allows extra information about an annotation to be shown. When adding a popup annotation to another annotation, the popup will need to be added to the same Annotations collection. When attached to a BaseMarkupAnnotation, the PopupAnnotation will project the text content and author of the BaseMarkupAnnotation.
(Inherited from BaseMarkupAnnotation.)
Public propertyPrint
Gets or sets a value indicating whether this BaseAnnotation is printed. Default is false.
(Inherited from BaseAnnotation.)
Public propertyReadOnly
Gets or sets a value indicating whether the annotation can interact with the user. Default is false.
(Inherited from BaseAnnotation.)
Public propertyRedactionInteriorColor
Gets or sets the color of the interior of the redacted area. If not set, the redacted area will be transparent.
Public propertyRedactionTemplate
Gets or sets the name of a template resource to be used when the redaction is applied. If specified, this template will take precedence over all other appearance related properties.
Public propertyRegions
Gets the regions for this annotation. Regions represents a set of quadrilaterals each of which represent the area covered by the annotation. Typically, parts of the annotation are drawn through sections of the quatrilateral. For example, underlines are drawn across the bottom of the annotation, strike outs through the middle.
Public propertyRichTextContent
The Contents property can also be represented as rich text. Rich text is content that may include a subset of XHTML markup include body, p, i, b, and span tags. When setting the RichTextContent property, you should also set the Contents property to the plain text equivalent with no markup.
(Inherited from BaseMarkupAnnotation.)
Public propertyTextAlignment
Gets or sets the text alignment.
Public propertyToggleNoView
Gets or sets a value indicating whether to toggle the sense of the NoView property. This might be used to make an annotation visible when the mouse enters it.
(Inherited from BaseAnnotation.)
Public propertyTransparency
Gets or sets the transparency of the annotation. 1.0 means fully transparent and 0.0 means fully opaque. Default is 0.
(Inherited from BaseMarkupAnnotation.)
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasAppearance
Determines whether this instance has at least 1 element in the Normal appearance set.
(Inherited from BaseAnnotation.)
Public methodStatic memberMakeBasicAppearance
Makes the basic appearance for the annotation. Unlike CheckboxWidgetAnnotation, TextWidgetAnnotation can't easily share the same appearance since appearances are geometrically scaled to fit the bounds of the annotation. This means that border outlines will grow or shrink when drawn. When the Bounds of the annotation change, the appearance needs to be rebuilt in order to render correctly in the document. This method is provided so that, for example, client code might add in custom coloring or easily build consistent appearances for when the annotation has been cliecked on or when it is rolled over.
Public methodMakeRepairContext
Makes the repair context for repairing problems in this annotation object. An object implementing IValidatable should at least return an empty RepairContext object.
(Inherited from BaseAnnotation.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNotifyResourceRenamed
This method is called when a global resourec has been renamed, allowing the resource consumer to update to the new name. Annotations defer this to their appearance, if any.
(Inherited from BaseAnnotation.)
Public methodResourcesUsed
Reports a list of all resources consumed by the object of the given class.
(Inherited from BaseAnnotation.)
Protected methodThrowIfReadOnlyT
If EnforceReadyOnlyWithException is true and ReadOnly is true, throw an InvalidOperationException, otherwise return value.
(Inherited from BaseAnnotation.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidate
Validates the annotation and accumulates any problems.
(Inherited from BaseAnnotation.)
Protected methodValidateActionList
Validates the action list.
(Inherited from BaseAnnotation.)
Protected methodValidateActions
Validates the actions.
(Inherited from BaseAnnotation.)
Protected methodValidateProperties
Validates the properties for the CaretAnnotation.
(Inherited from BaseMarkupAnnotation.)
Top
Examples
This example shows how to detect if a document contains any RedactionProposalAnnotation objects. This might be useful in flagging a document to prevent it from being sent out if the redactions have not been applied.
public static bool PageHasRedactions(PdfGeneratedPage page)
{
    if (page == null) throw new Exception("page was null or not a PdfGeneratedPage.");
    foreach (BaseAnnotation annot in page.Annotations) {
        if (annot is RedactionProposalAnnotation) return true;
    }
    return false;
}

public static bool DocumentHasRedactions(PdfGeneratedDocument doc)
{
    foreach (BasePage page in doc.Pages)
    {
        // page argument will be null if BasePage is not a PdfGeneratedPage
        // this would happen if the document was opened without the "attempt to import foreign content" flag set.
        if (PageHasRedactions(page as PdfGeneratedPage)) return true;
    }
    return false;
}
See Also