Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libraries/radpdfprocessing/editing/radfixeddocumenteditor.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ The character properties that are responsible for the look of the runs are liste
* __Single__: The underline is a single line.

* __UnderlineColor__: The color of the underline.

* __StrikethroughPattern__: Тhe strikethrough pattern. Two patterns are supported.
* __None__: There is no strikethrough. This is the default value.
* __Single__: The strikethrough is a single line.

* __StrikethroughColor__: The color of the strikethrough.


### Inserting a Run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ These properties hold the parameters used for text fragments. The following para
* __UnderlinePattern__: The underline pattern. The property is an enumeration of type [UnderlinePattern](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Flow.UnderlinePattern.html). Two patterns are supported:
* __None__: There is no underline. This is the default value.
* __Single__: The underline is a single line.

* __UnderlineColor__: The color of the underline.

* __StrikethroughPattern__: The strikethrough pattern. The property is an enumeration of type [StrikethroughPattern](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Flow.StrikethroughPattern.html). Two patterns are supported:
* __None__: There is no strikethrough. This is the default value.
* __Single__: The strikethrough is a single line.

* __StrikethroughColor__: The color of the strikethrough.

* __CharacterSpacing__: The character spacing for text fragments. The property is of type `double?`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,50 @@ Link Annotations
Yes
</td><td>

</td></tr><tr><td>
</td></tr>

<tr>
<td>Widget Annotations</td>
<td>Yes</td>
<td></td>
</tr>
<tr>
<td>Stamp Annotations</td>
<td>Yes</td>
<td></td>
</tr>
<tr>
<td>Line Annotations</td>
<td>Yes</td>
<td></td>
</tr>
<tr>
<td>Text Annotations</td>
<td>Yes</td>
<td></td>
</tr>
<tr>
<td>Underline Annotations</td>
<td>Yes</td>
<td></td>
</tr>
<tr>
<td>StrikeOut Annotations</td>
<td>Yes</td>
<td></td>
</tr>
<tr>
<td>Squiggly Annotations</td>
<td>Yes</td>
<td></td>
</tr>
<tr>
<td>Highlight Annotations</td>
<td>Yes</td>
<td></td>
</tr>

<tr><td>

<b>
Graphics
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions libraries/radpdfprocessing/model/annotations/line.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: Line
page_title: Line Annotation
description: Line annotations display a single straight line on the page.
slug: radpdfprocessing-model-annotations-line
tags: annotation, overview, pdfprocessing, line
published: True
position: 5
---

# Line Annotation

A **Line annotation** displays a single straight line on the page. When opened, it displays a pop-up window containing the text of the associated note.

The **LineAnnotation** class is a derivative of the **MarkupAnnotation** (descendent of **ContentAnnotation**) and it exposes the following properties:

|Property|Description|
|---|---|
|**Start**|Gets or sets the starting point of the annotation.|
|**End**|Gets or sets the ending point of the annotation.|
|**StartLineEndingType**|Gets or sets the line ending type for the start of the line.|
|**EndLineEndingType**|Gets or sets the line ending type for the end of the line.|
|**Opacity**|Gets or sets the opacity of the annotation.|
|**Contents**|Gets or sets the text that shall be displayed for the annotation.|
|**Color**|Gets or sets the color of the annotation.|
|**Content**|Gets the source defining the visual content of the annotation. This content is with bigger priority compared to the annotation appearance characteristics and text properties and it is visualized by default when opening the exported document in some PDF viewer.|

### Creating a LineAnnotation

```csharp
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();

LineAnnotation annotation = page.Annotations.AddLine(new Point(10, 10), new Point(300, 300));
annotation.StartLineEndingType = LineEndingType.None;
annotation.EndLineEndingType = LineEndingType.OpenArrow;
annotation.Color = new RgbColor(255, 0, 0); //Default RgbColor(255, 255, 255)
annotation.Contents = "This is a LineAnnotation";
annotation.Opacity = 0.5;
annotation.RecalculateContent();
```

![Create LineAnnotation](images/pdf-processing-create-lineannotation.png)

### Creating a LineAnnotation with FixedContentEditor

The [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) offers the public **DrawLineAnnotation** method which creates a new __LineAnnotation__ with starting point the current point of the editor and end point the current point of the editor plus the given distances.

```csharp
RadFixedDocument fixedDocument = new RadFixedDocument();
FixedContentEditor editor = new FixedContentEditor(fixedDocument.Pages.AddPage());

editor.Position.Translate(50, 50);
editor.DrawText("Line starts here.");
editor.DrawLineAnnotation(300, 400);
```

![Create LineAnnotation with FixedContentEditor](images/pdf-processing-create-lineannotation-with-fixedcontenteditor.png)

## See Also

* [AcroForm]({%slug radpdfprocessing-model-interactive-forms-acroform %})
* [FormField]({%slug radpdfprocessing-model-interactive-forms-form-fields%})
* [Annotations Overview]({%slug radpdfprocessing-model-annotations-overview%})
4 changes: 2 additions & 2 deletions libraries/radpdfprocessing/model/annotations/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ The abstract **Annotation** element associates an object with a location on a [R
|[Link]({%slug radpdfprocessing-model-annotations-links%})|A link annotation represents either a hypertext link to a destination elsewhere in the document or an action to be performed.|
|[Widget]({%slug radpdfprocessing-model-annotations-widgets%})|Interactive forms use widget annotations to represent the appearance of fields and to manage user interactions.|
|[Text]({%slug radpdfprocessing-model-annotations-text%})|A text annotation represents a *sticky note* attached to a point in the PDF document.|
|Line||
|Stamp||
|[Line]({%slug radpdfprocessing-model-annotations-line%})|Line annotations display a single straight line on the page.|
|[Stamp]({%slug radpdfprocessing-model-annotations-stamp%})|Stamp annotations display text or graphics intended to look as if they were stamped on the page with a rubber stamp.|
|[TextMarkup]({%slug radpdfprocessing-model-annotations-text-markup%})| Text markup annotations appear as **Highlights**, **Underlines**, **Strikeouts** or **Squiggly** underlines in the text of a document. When opened, they display a pop-up window containing the text of the associated note.|

* **Border**: Represents the annotation borders. This property is of type [AnnotationBorder](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Annotations.AnnotationBorder.html).
Expand Down
146 changes: 146 additions & 0 deletions libraries/radpdfprocessing/model/annotations/stamp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
title: Stamp
page_title: Stamp Annotation
description: Stamp annotations display text or graphics intended to look as if they were stamped on the page with a rubber stamp.
slug: radpdfprocessing-model-annotations-stamp
tags: annotation, overview, pdfprocessing, stamp
published: True
position: 6
---

# Stamp Annotation

A **Stamp annotation** displays text or graphics intended to look as if they were stamped on the page with a rubber stamp. When opened, it displays a pop-up window containing the text of the associated note.

The **StampAnnotation** class is a derivative of the **MarkupAnnotation** (descendent of **ContentAnnotation**) and it exposes the following properties:

|Property|Description|
|---|---|
|**Name**|Gets or sets the name of the stamp. The name can be chosen from the predefined names in the __StampAnnotationPredefinedNames__ class or it can be a custom string. In the case of a custom string an appearance should be provided via the __ContentAnnotation.Content__ property.|
|**Opacity**|Gets or sets the opacity of the annotation.|
|**Contents**|Gets or sets the text that shall be displayed for the annotation.|
|**Color**|Gets or sets the color of the annotation.|
|**Content**|Gets the source defining the visual content of the annotation. This content is with bigger priority compared to the annotation appearance characteristics and text properties and it is visualized by default when opening the exported document in some PDF viewer.|

### Creating a StampAnnotation

```csharp
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();

RadFixedPage page = fixedDocument.Pages.AddPage();

StampAnnotation annotation1 = page.Annotations.AddStamp(new Rect(50, 50, 300, 50));
annotation1.Name = StampAnnotationPredefinedNames.SBApproved;

StampAnnotation annotation3 = page.Annotations.AddStamp(new Rect(50, 100, 300, 50));
annotation3.Name = StampAnnotationPredefinedNames.SBCompleted;

StampAnnotation annotation4 = page.Annotations.AddStamp(new Rect(50, 150, 300, 50));
annotation4.Name = StampAnnotationPredefinedNames.SBConfidential;

StampAnnotation annotation5 = page.Annotations.AddStamp(new Rect(50, 200, 300, 50));
annotation5.Name = StampAnnotationPredefinedNames.SBDraft;

StampAnnotation annotation6 = page.Annotations.AddStamp(new Rect(50, 250, 300, 50));
annotation6.Name = StampAnnotationPredefinedNames.SBFinal;

StampAnnotation annotation7 = page.Annotations.AddStamp(new Rect(50, 300, 300, 50));
annotation7.Name = StampAnnotationPredefinedNames.SBForComment;

StampAnnotation annotation8 = page.Annotations.AddStamp(new Rect(50, 350, 300, 50));
annotation8.Name = StampAnnotationPredefinedNames.SBForPublicRelease;

StampAnnotation annotation9 = page.Annotations.AddStamp(new Rect(50, 400, 300, 50));
annotation9.Name = StampAnnotationPredefinedNames.SBInformationOnly;

StampAnnotation annotation10 = page.Annotations.AddStamp(new Rect(50, 450, 300, 50));
annotation10.Name = StampAnnotationPredefinedNames.SBNotApproved;

StampAnnotation annotation11 = page.Annotations.AddStamp(new Rect(50, 500, 300, 50));
annotation11.Name = StampAnnotationPredefinedNames.SBNotForPublicRelease;

StampAnnotation annotation13 = page.Annotations.AddStamp(new Rect(50, 550, 300, 50));
annotation13.Name = StampAnnotationPredefinedNames.SBPreliminaryResults;

StampAnnotation annotation15 = page.Annotations.AddStamp(new Rect(50, 600, 300, 50));
annotation15.Name = StampAnnotationPredefinedNames.SBRejected;

StampAnnotation annotation16 = page.Annotations.AddStamp(new Rect(50, 650, 300, 50));
annotation16.Name = StampAnnotationPredefinedNames.SBVoid;
```

![Create StampAnnotation](images/pdf-processing-create-stampannotation.png)

### Creating a StampAnnotation with FixedContentEditor

The [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) offers the public **DrawStampAnnotation** method which creates a new __StampAnnotation__ and draws it with a specified annotation size and name.

```csharp
RadFixedDocument fixedDocument = new RadFixedDocument();
FixedContentEditor editor = new FixedContentEditor(fixedDocument.Pages.AddPage());

editor.Position.Translate(100, 100);
editor.DrawStampAnnotation(new Size(250, 250), StampAnnotationPredefinedNames.SBFinal);
editor.Position.Translate(400, 100);
editor.DrawStampAnnotation(new Size(250, 250), StampAnnotationPredefinedNames.SBConfidential);
```

![Create StampAnnotation with FixedContentEditor](images/pdf-processing-create-stampannotation-with-fixedcontenteditor.png)

### Creating a StampAnnotation with Appearance

The **AnnotationContentSource** class, accessed by the **Content** property of the annotation object, represents the [FormSource]({%slug radpdfprocessing-model-formsource%}) instances used for displaying the widget content. The following example shows how to create a custom Stamp annotation and change its visual appearance:

>important When creating a custom stamp name (not from the predefined names), it is important to start the name with "#". Otherwise, if the stamp is moved in adobe, its appearance will be rewritten.

>important When creating appearance for an annotation, it is important to create it with the same size as the rect of the annotation otherwise unexpected behavior may occur when the annotation is moved in Adobe.

```csharp
private RadFixedDocument CreateTextAnnotation()
{
RadFixedDocument fixedDocument = new RadFixedDocument();
RadFixedPage page = fixedDocument.Pages.AddPage();

StampAnnotation annotation = page.Annotations.AddStamp(new Rect(100, 100, 300, 100));
annotation.Name = "#Sold";

FormSource simpleForm = new FormSource();
CreateContentFormWithText(simpleForm, "Sold");

AnnotationContentSource content = new AnnotationContentSource();
annotation.Content.NormalContentSource = simpleForm;
return fixedDocument;
}

private static void CreateContentFormWithText(FormSource normalForm, string text)
{
normalForm.Size = new Size(300, 100);

FixedContentEditor formEditor = new FixedContentEditor(normalForm);

using (formEditor.SaveProperties())
{
formEditor.GraphicProperties.IsFilled = true;
formEditor.GraphicProperties.IsStroked = true;
formEditor.GraphicProperties.StrokeThickness = 2;
formEditor.GraphicProperties.StrokeColor = new RgbColor(92, 229, 0);
formEditor.GraphicProperties.FillColor = new RgbColor(213, 222, 226);
formEditor.GraphicProperties.StrokeDashArray = new double[] { 17, 4 };
formEditor.DrawRectangle(new Rect(formEditor.Position.Matrix.OffsetX, formEditor.Position.Matrix.OffsetY, 300,100));
}

formEditor.TextProperties.FontSize = 20;
formEditor.Position.Translate(10, 10);
formEditor.DrawText(text);
}
```

![Create StampAnnotation with Appearance](images/pdf-processing-create-stampannotation-with-appearance.png)

## See Also

* [AcroForm]({%slug radpdfprocessing-model-interactive-forms-acroform %})
* [FormField]({%slug radpdfprocessing-model-interactive-forms-form-fields%})
* [Annotations Overview]({%slug radpdfprocessing-model-annotations-overview%})
* [FormSource]({%slug radpdfprocessing-model-formsource%})
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ No
Strikethrough
</td>
<td>
No
Yes
</td>
<td></td>
</tr>
Expand Down