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
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ Please note that you can modify the `Borders` property of the `DefaultCellProper
table.DefaultCellProperties.Borders = new TableCellBorders(null, null, null,b);
```

>note As of **Q3 2024** RadPdfProcessing offers *Dotted*, *Dashed*, and *DashSmallGap* [border styles]({%slug radpdfprocessing-editing-table%}) out-of-the-box without the necessity to play with the **StrokeDashArray** of the **FixedContentEditor**. With this update, the Dotted, Dashed, DashSmallGap, and Thick border lines are now exported from [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}) to [RadFixedDocument]({%slug radpdfprocessing-model-radfixeddocument%}) as well.

## See Also

* [TableCell]({%slug radpdfprocessing-editing-tablecell%})
* [Table]({%slug radpdfprocessing-editing-table%})
* [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}})
* [Create Repeating Table Header Row in PdfProcessing]({%slug pdfprocessing-create-repeat-header-row%})
* [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%})
* [Supported Border Styles]({%slug radpdfprocessing-editing-table%})


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.
18 changes: 13 additions & 5 deletions libraries/radpdfprocessing/editing/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ position: 3

# Table



The __Table__ class helps you easily create tabular data content. All you need to do is define the table content and pass a Table instance to a [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) or a [RadFixedDocumentEditor]({%slug radpdfprocessing-editing-radfixeddocumenteditor%}). From then on, these editors are responsible for positioning, measuring, drawing and splitting the table onto pages.
The **Table** class helps you easily create tabular data content. All you need to do is define the table content and pass a Table instance to a [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) or a [RadFixedDocumentEditor]({%slug radpdfprocessing-editing-radfixeddocumenteditor%}). From then on, these editors are responsible for positioning, measuring, drawing and splitting the table onto pages.

![Rad Pdf Processing Editing Table 01](images/RadPdfProcessing_Editing_Table_01.png)

This article aims to present the table-related API in __RadPdfProcessing__. It contains the following sections:

This article aims to present the table-related API in __RadPdfProcessing__. It contains the following sections:

* [Defining Table Content](#defining-table-content)

Expand Down Expand Up @@ -279,6 +276,17 @@ As a result, on __Figure 7__ you can see a 45-degree rotated table similar to th
#### Figure 7: FixedWidth table
![Rad Pdf Processing Editing Table 08](images/RadPdfProcessing_Editing_Table_08.png)

## Supported Border Styles

As of **Q3 2024**, along with the BorderStyle.*Single*, RadPdfProcessing offers *Dotted*, *Dashed*, and *DashSmallGap* border styles. With this update, the Dotted, Dashed, DashSmallGap, and Thick border lines are now exported from [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}) to [RadFixedDocument]({%slug radpdfprocessing-model-radfixeddocument%}) as well.

|BorderStyle|Border Design|
|----|----|
|Single|![Pdf Single Border](images/pdf-single-border.png)|
|Dotted|![Pdf Dotted Border](images/pdf-dotted-border.png)|
|Dashed|![Pdf Dashed Border](images/pdf-dashed-border.png)|
|DashSmallGap|![Pdf Single Border](images/pdf-dash-small-gap-border.png)|

## See Also

* [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%})
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.
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.
1 change: 1 addition & 0 deletions libraries/radpdfprocessing/model/annotations/links.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Links
page_title: Links
description: Link annotations represent either a hypertext link to a destination elsewhere in the document or an action to be performed.
slug: radpdfprocessing-model-annotations-links
tags: annotations,overview,pdfprocessing,link,links
published: True
Expand Down
24 changes: 19 additions & 5 deletions libraries/radpdfprocessing/model/annotations/overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Annotations Overview
page_title: Annotations Overview
description: Learn what annotation types are supported in the PdfProcessing library offered by the Telerik Document Processing.
slug: radpdfprocessing-model-annotations-overview
tags: annotations,overview,pdfprocessing
published: True
Expand All @@ -9,11 +10,23 @@ position: 0

# Annotations Overview

The abstract __Annotation__ element associates an object with a location on a [RadFixedPage]({%slug radpdfprocessing-model-radfixedpage%}). Annotation exposes the following properties:
An *annotation* associates an object such as a note, sound, or movie with a location on a page of a PDF document, or provides a way to interact with the user by
means of the mouse and keyboard. PDF includes a wide variety of standard [annotation types](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Annotations.AnnotationType.html). Many of the standard annotation types may be displayed in either the open or the closed state. When closed, they appear on the page in some distinctive form, such as an icon, a box, or a rubber stamp, depending on the specific annotation type. When the user activates the annotation by clicking it, it exhibits its associated object, such as by opening a pop-up window displaying a text note or by playing a sound or a movie.

The abstract **Annotation** element associates an object with a location on a [RadFixedPage]({%slug radpdfprocessing-model-radfixedpage%}). Annotation exposes the following properties:

* __Rect__: The rectangle, which defines the location of the annotation on the page.
* **Rect**: The rectangle, which defines the location of the annotation on the page.

* __Type__: Property of type [AnnotationType](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Annotations.AnnotationType.html), which determines the type of the annotation. The only supported types are [Link]({%slug radpdfprocessing-model-annotations-links%}) and [Widget]({%slug radpdfprocessing-model-annotations-widgets%}).
* **Type**: Property of type [AnnotationType](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Annotations.AnnotationType.html), which determines the type of the annotation. The supported types are listed in the following table:

|Annotation Type|Description|
|----|----|
|[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||
|[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 All @@ -22,5 +35,6 @@ The abstract __Annotation__ element associates an object with a location on a [R
## See Also

* [RadFixedPage]({%slug radpdfprocessing-model-radfixedpage%})
* [AnnotationType API Reference](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Annotations.AnnotationType.html)
* [Link API Reference](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Annotations.Link.html)
* [TextMarkup]({%slug radpdfprocessing-model-annotations-text-markup%})
* [Text]({%slug radpdfprocessing-model-annotations-text%})
* [Link]({%slug radpdfprocessing-model-annotations-links%})
174 changes: 174 additions & 0 deletions libraries/radpdfprocessing/model/annotations/text-markup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
---
title: Text Markup
page_title: Text Markup Annotation
description: Text markup annotations appear as highlights, underlines, strikeouts, or squiggly underlines in the text of a document.
slug: radpdfprocessing-model-annotations-text-markup
tags: annotation, overview, pdfprocessing, text, markup
published: True
position: 4
---

# TextMarkup

**Text Markup annotations** appear as highlights, underlines, strikeouts, or jagged ("squiggly") underlines in the text of a document. When opened, they display a pop-up window containing the text of the associated note.

![Text Markup Annotation](images/pdf-processing-create-text-markup-annotation.png)

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

|Property|Description|
|---|---|
|**TextMarkupType**|Gets the type of the annotation. The **TextMarkupAnnotationType** enum offers *Highlight*, *StrikeOut*, *Underline*, *Squiggly* options.|
|**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.|

Depending on the TextMarkupAnnotationType the respective type of the TextMarkup annotation can be added to the PDF document using the below examples:

## Highlight

### Creating a Highlight Annotation

```csharp
string sampleText = File.ReadAllText("dummyText.txt");

RadFixedDocument fixedDocument = new RadFixedDocument();
using (RadFixedDocumentEditor documentEditor = new RadFixedDocumentEditor(fixedDocument))
{
documentEditor.InsertRun(sampleText);
}
TextSearch search = new TextSearch(fixedDocument);
IEnumerable<SearchResult> result = search.FindAll("amet", TextSearchOptions.Default);
foreach (SearchResult r in result)
{
Rect highlightRectangle = r.GetWordBoundingRect();
TextMarkupAnnotation annotation = r.GetResultPage().Annotations.AddHighlight(highlightRectangle);
annotation.Color = new RgbColor(125, 255, 0, 0);

annotation.RecalculateContent();
}

```

![Create Highlight Annotation](images/pdf-processing-create-highlight-annotation.png)

### Creating a Highlight Annotation with Appearance


```csharp
private RadFixedDocument CreateTextMarkupAnnotation()
{
string sampleText = File.ReadAllText("dummyText.txt");
RadFixedDocument fixedDocument = new RadFixedDocument();
using (RadFixedDocumentEditor documentEditor = new RadFixedDocumentEditor(fixedDocument))
{
documentEditor.InsertRun(sampleText);
}
TextMarkupAnnotation annotation = fixedDocument.Pages[0].Annotations.AddHighlight(new Rect(150, 150, 100, 40));

FormSource simpleForm = new FormSource();
CreateContentFormWithText(simpleForm, "Hover me!");
annotation.Content.NormalContentSource = simpleForm;

FormSource secondForm = new FormSource();
CreateContentFormWithText(secondForm, "Hovered!");
annotation.Content.MouseOverContentSource = secondForm;
return fixedDocument;
}

private static void CreateContentFormWithText(FormSource normalForm, string text)
{
Size s = new Size(100, 40);
Random rand= new Random();
normalForm.Size = s;

FixedContentEditor formEditor = new FixedContentEditor(normalForm);

using (formEditor.SaveProperties())
{
formEditor.GraphicProperties.IsFilled = true;
formEditor.GraphicProperties.IsStroked = true;
formEditor.GraphicProperties.StrokeThickness = 1;
formEditor.GraphicProperties.StrokeColor = new RgbColor(255, 0, 0);
formEditor.GraphicProperties.FillColor = new RgbColor(175,255, 255, 0);
formEditor.GraphicProperties.StrokeDashArray = new double[] { 17, 4 };
formEditor.DrawRectangle(new Rect(s));
}

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

![Create Highlight Annotation with Appearance](images/pdf-processing-create-highlight-annotation-with-appearance.gif)

## Underline

```csharp
RadFixedDocument fixedDocument = new RadFixedDocument();
RadFixedPage page = fixedDocument.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page);
editor.Position.Translate(100, 100);
editor.DrawText("This is an underline.");

TextSearch search = new TextSearch(fixedDocument);
IEnumerable<SearchResult> underlineSearch = search.FindAll("underline", TextSearchOptions.Default);
Rect underlineRectangle = underlineSearch.First().GetWordBoundingRect();
TextMarkupAnnotation underlineAnnotation = page.Annotations.AddUnderline(underlineRectangle);
underlineAnnotation.Color = new RgbColor(255, 0, 255);
underlineAnnotation.Opacity = 0.90;
underlineAnnotation.RecalculateContent();
```

![Create Underline Annotation](images/pdf-processing-create-underline-annotation.png)

## Squiggly

```csharp
RadFixedDocument fixedDocument = new RadFixedDocument();
RadFixedPage page = fixedDocument.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page);
editor.Position.Translate(100, 100);
editor.DrawText("This is a squiggly line.");

TextSearch search = new TextSearch(fixedDocument);
IEnumerable<SearchResult> squigglySearch = search.FindAll("squiggly", TextSearchOptions.Default);
Rect squigglyRectangle = squigglySearch.First().GetWordBoundingRect();
TextMarkupAnnotation squigglyAnnotation = page.Annotations.AddSquiggly(squigglyRectangle);
squigglyAnnotation.Color = new RgbColor (255,0, 0);
squigglyAnnotation.Opacity = 0.70;
squigglyAnnotation.RecalculateContent();
```

![Create Squiggly Annotation](images/pdf-processing-create-squiggly-annotation.png)

## StrikeOut

```csharp
RadFixedDocument fixedDocument = new RadFixedDocument();
RadFixedPage page = fixedDocument.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page);
editor.Position.Translate(100, 100);
editor.DrawText("This is an underline.");

TextSearch search = new TextSearch(fixedDocument);
IEnumerable<SearchResult> underlineSearch = search.FindAll("underline", TextSearchOptions.Default);
Rect underlineRectangle = underlineSearch.First().GetWordBoundingRect();
TextMarkupAnnotation underlineAnnotation = page.Annotations.AddUnderline(underlineRectangle);
underlineAnnotation.Color = new RgbColor(255, 0, 255);
underlineAnnotation.Opacity = 0.90;
underlineAnnotation.RecalculateContent();
```

![Create StrikeOut Annotation](images/pdf-processing-create-strikeOut-annotation.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%})
Loading