From 89c753a9ca9a3461e75a384299e9b972ce872bae Mon Sep 17 00:00:00 2001 From: Muhammad Adil Date: Mon, 8 Apr 2024 10:28:18 +0500 Subject: [PATCH] Basic Examples --- content/english/net/_index.md | 23 ++++++ content/english/net/advanced-usage/_index.md | 25 +++++++ .../change-image-quality/_index.md | 35 +++++++++ .../export-annotations-xml-file/_index.md | 32 ++++++++ .../generate-document-pages-preview/_index.md | 42 +++++++++++ .../_index.md | 42 +++++++++++ .../_index.md | 44 +++++++++++ .../_index.md | 43 +++++++++++ .../get-all-version-keys-document/_index.md | 34 +++++++++ .../_index.md | 47 ++++++++++++ .../_index.md | 35 +++++++++ .../_index.md | 31 ++++++++ .../loading-custom-fonts/_index.md | 42 +++++++++++ .../put-image-annotation-over-text/_index.md | 47 ++++++++++++ .../rotating-pdf-documents/_index.md | 35 +++++++++ .../set-document-preview-resolution/_index.md | 42 +++++++++++ .../english/net/applying-licenses/_index.md | 14 ++++ .../_index.md | 46 ++++++++++++ .../_index.md | 45 +++++++++++ .../_index.md | 33 +++++++++ .../english/net/document-components/_index.md | 14 ++++ .../add-button-component-to-pdf/_index.md | 67 +++++++++++++++++ .../add-checkbox-component-to-pdf/_index.md | 62 ++++++++++++++++ .../add-dropdown-component-to-pdf/_index.md | 68 +++++++++++++++++ .../net/document-loading-essentials/_index.md | 19 +++++ .../load-document-from-amazon-s3/_index.md | 66 +++++++++++++++++ .../load-document-from-azure/_index.md | 74 +++++++++++++++++++ .../load-document-from-ftp/_index.md | 70 ++++++++++++++++++ .../load-document-from-local-disk/_index.md | 44 +++++++++++ .../load-document-from-stream/_index.md | 44 +++++++++++ .../load-document-from-url/_index.md | 62 ++++++++++++++++ .../_index.md | 46 ++++++++++++ .../_index.md | 45 +++++++++++ content/english/net/getting-started/_index.md | 11 +++ .../net/removing-annotations/_index.md | 19 +++++ .../remove-annotations-by-id/_index.md | 39 ++++++++++ .../_index.md | 37 ++++++++++ .../remove-annotations/_index.md | 35 +++++++++ .../_index.md | 37 ++++++++++ .../remove-multiple-annotations/_index.md | 37 ++++++++++ .../remove-replies-by-id/_index.md | 50 +++++++++++++ .../remove-replies-by-username/_index.md | 49 ++++++++++++ .../remove-replies-to-annotations/_index.md | 49 ++++++++++++ .../net/unlocking-annotation-power/_index.md | 30 ++++++++ .../add-area-annotation/_index.md | 66 +++++++++++++++++ .../add-arrow-annotation/_index.md | 65 ++++++++++++++++ .../add-distance-annotation/_index.md | 65 ++++++++++++++++ .../add-ellipse-annotation/_index.md | 66 +++++++++++++++++ .../add-image-annotation-local-path/_index.md | 47 ++++++++++++ .../_index.md | 47 ++++++++++++ .../add-link-annotation/_index.md | 67 +++++++++++++++++ .../add-point-annotation/_index.md | 61 +++++++++++++++ .../add-polyline-annotation/_index.md | 66 +++++++++++++++++ .../_index.md | 64 ++++++++++++++++ .../_index.md | 50 +++++++++++++ .../add-text-field-annotation/_index.md | 68 +++++++++++++++++ .../add-text-highlight-annotation/_index.md | 67 +++++++++++++++++ .../add-text-redaction-annotation/_index.md | 65 ++++++++++++++++ .../add-text-replacement-annotation/_index.md | 70 ++++++++++++++++++ .../add-text-squiggly-annotation/_index.md | 68 +++++++++++++++++ .../add-text-strikeout-annotation/_index.md | 67 +++++++++++++++++ .../add-text-underline-annotation/_index.md | 68 +++++++++++++++++ .../add-watermark-annotation/_index.md | 68 +++++++++++++++++ 63 files changed, 3016 insertions(+) create mode 100644 content/english/net/_index.md create mode 100644 content/english/net/advanced-usage/_index.md create mode 100644 content/english/net/advanced-usage/change-image-quality/_index.md create mode 100644 content/english/net/advanced-usage/export-annotations-xml-file/_index.md create mode 100644 content/english/net/advanced-usage/generate-document-pages-preview/_index.md create mode 100644 content/english/net/advanced-usage/generate-preview-without-annotations/_index.md create mode 100644 content/english/net/advanced-usage/generate-preview-without-comments/_index.md create mode 100644 content/english/net/advanced-usage/generate-preview-worksheet-columns/_index.md create mode 100644 content/english/net/advanced-usage/get-all-version-keys-document/_index.md create mode 100644 content/english/net/advanced-usage/get-document-text-content-information/_index.md create mode 100644 content/english/net/advanced-usage/get-list-annotations-version-key/_index.md create mode 100644 content/english/net/advanced-usage/import-annotations-from-document/_index.md create mode 100644 content/english/net/advanced-usage/loading-custom-fonts/_index.md create mode 100644 content/english/net/advanced-usage/put-image-annotation-over-text/_index.md create mode 100644 content/english/net/advanced-usage/rotating-pdf-documents/_index.md create mode 100644 content/english/net/advanced-usage/set-document-preview-resolution/_index.md create mode 100644 content/english/net/applying-licenses/_index.md create mode 100644 content/english/net/applying-licenses/set-license-from-file-groupdocs-annotation-dotnet/_index.md create mode 100644 content/english/net/applying-licenses/set-license-from-stream-groupdocs-annotation-dotnet/_index.md create mode 100644 content/english/net/applying-licenses/set-metered-license-groupdocs-annotation-dotnet/_index.md create mode 100644 content/english/net/document-components/_index.md create mode 100644 content/english/net/document-components/add-button-component-to-pdf/_index.md create mode 100644 content/english/net/document-components/add-checkbox-component-to-pdf/_index.md create mode 100644 content/english/net/document-components/add-dropdown-component-to-pdf/_index.md create mode 100644 content/english/net/document-loading-essentials/_index.md create mode 100644 content/english/net/document-loading-essentials/load-document-from-amazon-s3/_index.md create mode 100644 content/english/net/document-loading-essentials/load-document-from-azure/_index.md create mode 100644 content/english/net/document-loading-essentials/load-document-from-ftp/_index.md create mode 100644 content/english/net/document-loading-essentials/load-document-from-local-disk/_index.md create mode 100644 content/english/net/document-loading-essentials/load-document-from-stream/_index.md create mode 100644 content/english/net/document-loading-essentials/load-document-from-url/_index.md create mode 100644 content/english/net/document-loading-essentials/load-password-protected-documents/_index.md create mode 100644 content/english/net/document-loading-essentials/loading-annotated-document-version/_index.md create mode 100644 content/english/net/getting-started/_index.md create mode 100644 content/english/net/removing-annotations/_index.md create mode 100644 content/english/net/removing-annotations/remove-annotations-by-id/_index.md create mode 100644 content/english/net/removing-annotations/remove-annotations-using-save-options/_index.md create mode 100644 content/english/net/removing-annotations/remove-annotations/_index.md create mode 100644 content/english/net/removing-annotations/remove-multiple-annotations-by-ids/_index.md create mode 100644 content/english/net/removing-annotations/remove-multiple-annotations/_index.md create mode 100644 content/english/net/removing-annotations/remove-replies-by-id/_index.md create mode 100644 content/english/net/removing-annotations/remove-replies-by-username/_index.md create mode 100644 content/english/net/removing-annotations/remove-replies-to-annotations/_index.md create mode 100644 content/english/net/unlocking-annotation-power/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-area-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-arrow-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-distance-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-ellipse-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-image-annotation-local-path/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-image-annotation-remote-path/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-link-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-point-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-polyline-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-resources-redaction-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-search-text-fragment-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-text-field-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-text-highlight-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-text-redaction-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-text-replacement-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-text-squiggly-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-text-strikeout-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-text-underline-annotation/_index.md create mode 100644 content/english/net/unlocking-annotation-power/add-watermark-annotation/_index.md diff --git a/content/english/net/_index.md b/content/english/net/_index.md new file mode 100644 index 0000000..8f75f09 --- /dev/null +++ b/content/english/net/_index.md @@ -0,0 +1,23 @@ +--- +title: Tutorials and Examples of GroupDocs.Annotation for .NET +linktitle: GroupDocs.Annotation for .NET Tutorials +type: docs +weight: 10 +url: /net/ +description: +is_root: true +--- + +### [Document Loading Essentials](./document-loading-essentials/) + +### [Getting Started](./getting-started/) + +### [Advanced Usage](./advanced-usage/) + +### [Unlocking Annotation Power](./unlocking-annotation-power/) + +### [Document Components](./document-components/) + +### [Removing Annotations](./removing-annotations/) + +### [Applying Licenses](./applying-licenses/) diff --git a/content/english/net/advanced-usage/_index.md b/content/english/net/advanced-usage/_index.md new file mode 100644 index 0000000..98c9147 --- /dev/null +++ b/content/english/net/advanced-usage/_index.md @@ -0,0 +1,25 @@ +--- +title: Advanced Usage +linktitle: Advanced Usage +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 22 +url: /net/advanced-usage/ +--- + +## Advanced Usage Tutorials +### [Change Image Quality](./change-image-quality/) +### [Export Annotations from XML File](./export-annotations-xml-file/) +### [Generate Document Pages Preview](./generate-document-pages-preview/) +### [Generate Preview without Annotations](./generate-preview-without-annotations/) +### [Generate Preview without Comments](./generate-preview-without-comments/) +### [Generate Preview Worksheet Columns](./generate-preview-worksheet-columns/) +### [Get All Version Keys on Document](./get-all-version-keys-document/) +### [Get Document Text Content Information](./get-document-text-content-information/) +### [Get List of Annotations using Version Key](./get-list-annotations-version-key/) +### [Import Annotations from Document](./import-annotations-from-document/) +### [Loading Custom Fonts](./loading-custom-fonts/) +### [Put Image Annotation over Text](./put-image-annotation-over-text/) +### [Rotating PDF Documents](./rotating-pdf-documents/) +### [Set Document Preview Resolution](./set-document-preview-resolution/) \ No newline at end of file diff --git a/content/english/net/advanced-usage/change-image-quality/_index.md b/content/english/net/advanced-usage/change-image-quality/_index.md new file mode 100644 index 0000000..392cebe --- /dev/null +++ b/content/english/net/advanced-usage/change-image-quality/_index.md @@ -0,0 +1,35 @@ +--- +title: Change Image Quality +linktitle: Change Image Quality +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 10 +url: /net/advanced-usage/change-image-quality/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + class ChangeImageQuality + { + public static void Run() + { + using (Annotator annotator = new Annotator("input.pdf-file")) // specify the path to the input PDF file +{ + string dataDir = "input.pdf"; // specify the path to the input PDF file + string data = "image.jpg"; // the path to the JPG file + int pageNumber = 1; // set the page where the image will be inserted + int imageQuality = 10; // set image quality + annotator.Document.AddImageToDocument(dataDir, data, pageNumber, imageQuality); +} + } + } +} + +``` diff --git a/content/english/net/advanced-usage/export-annotations-xml-file/_index.md b/content/english/net/advanced-usage/export-annotations-xml-file/_index.md new file mode 100644 index 0000000..2a1dad3 --- /dev/null +++ b/content/english/net/advanced-usage/export-annotations-xml-file/_index.md @@ -0,0 +1,32 @@ +--- +title: Export Annotations from XML File +linktitle: Export Annotations from XML File +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 11 +url: /net/advanced-usage/export-annotations-xml-file/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + class ExportAnnotationsFromXMLFile + { + public static void Run() + { + using (Annotator annotator = new Annotator("input.pdf-file")) // specify the path to the input PDF file +{ + annotator.ExportAnnotationsFromXMLFile("input.XML-file"); // specify the path to the input XML file + annotator.Save("result_export"); +} + } + } +} + +``` diff --git a/content/english/net/advanced-usage/generate-document-pages-preview/_index.md b/content/english/net/advanced-usage/generate-document-pages-preview/_index.md new file mode 100644 index 0000000..c42ec54 --- /dev/null +++ b/content/english/net/advanced-usage/generate-document-pages-preview/_index.md @@ -0,0 +1,42 @@ +--- +title: Generate Document Pages Preview +linktitle: Generate Document Pages Preview +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 12 +url: /net/advanced-usage/generate-document-pages-preview/ +--- + +## Complete Source Code +```csharp +using GroupDocs.Annotation.Options; +using System; +using System.IO; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + /// + /// This example demonstrates annotating generating previews from document + /// + internal class GenerateDocumentPagesPreview + { + public static void Run() + { + using (Annotator annotator = new Annotator("input.pdf")) + { + PreviewOptions previewOptions = new PreviewOptions(pageNumber => + { + var pagePath = Path.Combine(Constants.GetOutputDirectoryPath(), $"result_{pageNumber}.png"); + return File.Create(pagePath); + }); + previewOptions.PreviewFormat = PreviewFormats.PNG; + + previewOptions.PageNumbers = new int[] { 1, 2, 3, 4 }; + annotator.Document.GeneratePreview(previewOptions); + } + Console.WriteLine($"\nDocument previews generated successfully.\nCheck output in {Constants.GetOutputDirectoryPath()}."); + } + } +} +``` diff --git a/content/english/net/advanced-usage/generate-preview-without-annotations/_index.md b/content/english/net/advanced-usage/generate-preview-without-annotations/_index.md new file mode 100644 index 0000000..cbd5614 --- /dev/null +++ b/content/english/net/advanced-usage/generate-preview-without-annotations/_index.md @@ -0,0 +1,42 @@ +--- +title: Generate Preview without Annotations +linktitle: Generate Preview without Annotations +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 13 +url: /net/advanced-usage/generate-preview-without-annotations/ +--- + +## Complete Source Code +```csharp +using System.IO; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp +{ + /// + /// This example demonstrates generating preview of document without rendering comments + /// + class GeneratePreviewWithoutAnnotations + { + public static void Run() + { + using (Annotator annotator = new Annotator("annotated.pdf"_DOCX)) + { + PreviewOptions previewOptions = new PreviewOptions(pageNumber => + { + var pagePath = $"result{pageNumber}.png"; + return File.Create(pagePath); + }); + + previewOptions.PreviewFormat = PreviewFormats.PNG; + previewOptions.PageNumbers = new int[] {1, 2, 3, 4, 5, 6}; + previewOptions.RenderAnnotations = false; + annotator.Document.GeneratePreview(previewOptions); + } + } + } +} + +``` diff --git a/content/english/net/advanced-usage/generate-preview-without-comments/_index.md b/content/english/net/advanced-usage/generate-preview-without-comments/_index.md new file mode 100644 index 0000000..ae83748 --- /dev/null +++ b/content/english/net/advanced-usage/generate-preview-without-comments/_index.md @@ -0,0 +1,44 @@ +--- +title: Generate Preview without Comments +linktitle: Generate Preview without Comments +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 14 +url: /net/advanced-usage/generate-preview-without-comments/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + /// + /// This example demonstrates generating preview of document without rendering comments + /// + class GeneratePreviewWithoutComments + { + public static void Run() + { + using (Annotator annotator = new Annotator("annotated.pdf"_DOCX)) + { + PreviewOptions previewOptions = new PreviewOptions(pageNumber => + { + var pagePath = $"result{pageNumber}.png"; + return File.Create(pagePath); + }); + previewOptions.PreviewFormat = PreviewFormats.PNG; + previewOptions.PageNumbers = new int[] { 1, 2, 3, 4, 5, 6 }; + previewOptions.RenderComments = false; + annotator.Document.GeneratePreview(previewOptions); + } + } + } +} + +``` diff --git a/content/english/net/advanced-usage/generate-preview-worksheet-columns/_index.md b/content/english/net/advanced-usage/generate-preview-worksheet-columns/_index.md new file mode 100644 index 0000000..ca50d25 --- /dev/null +++ b/content/english/net/advanced-usage/generate-preview-worksheet-columns/_index.md @@ -0,0 +1,43 @@ +--- +title: Generate Preview Worksheet Columns +linktitle: Generate Preview Worksheet Columns +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 15 +url: /net/advanced-usage/generate-preview-worksheet-columns/ +--- + +## Complete Source Code +```csharp +using GroupDocs.Annotation; +using GroupDocs.Annotation.Options; +using System; +using System.IO; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + /// + /// This example demonstrates generating previews from document with specified worksheet columns + /// + internal class GeneratePreviewWorksheetColumns + { + public static void Run() + { + PreviewOptions previewOptions = + new PreviewOptions( + pageNumber => new FileStream(Path.Combine(Constants.GetOutputDirectoryPath(), $"cells_page{pageNumber}.png"), FileMode.Create), + (number, stream) => stream.Dispose() + ); + previewOptions.WorksheetColumns.Add(new WorksheetColumnsRange("Sheet1", 2, 3)); + previewOptions.WorksheetColumns.Add(new WorksheetColumnsRange("Sheet1", 1, 1)); + + using (Annotator annotator = new Annotator("input.xlsx")) + { + annotator.Document.GeneratePreview(previewOptions); + } + Console.WriteLine($"\nDocument previews generated successfully.\nCheck output in {Constants.GetOutputDirectoryPath()}."); + } + } +} +``` diff --git a/content/english/net/advanced-usage/get-all-version-keys-document/_index.md b/content/english/net/advanced-usage/get-all-version-keys-document/_index.md new file mode 100644 index 0000000..e90ebdc --- /dev/null +++ b/content/english/net/advanced-usage/get-all-version-keys-document/_index.md @@ -0,0 +1,34 @@ +--- +title: Get All Version Keys on Document +linktitle: Get All Version Keys on Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 16 +url: /net/advanced-usage/get-all-version-keys-document/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.Text; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + /// + /// This example demonstrates getting all version keys from document + /// + class GetAllVersionKeysOnDocument + { + public static void Run() + { + using (Annotator annotator = new Annotator("annotated_with_versions.pdf")) + { + List versionKeys = annotator.GetVersionsList(); + } + } + } +} + +``` diff --git a/content/english/net/advanced-usage/get-document-text-content-information/_index.md b/content/english/net/advanced-usage/get-document-text-content-information/_index.md new file mode 100644 index 0000000..fa7b57b --- /dev/null +++ b/content/english/net/advanced-usage/get-document-text-content-information/_index.md @@ -0,0 +1,47 @@ +--- +title: Get Document Text Content Information +linktitle: Get Document Text Content Information +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 17 +url: /net/advanced-usage/get-document-text-content-information/ +--- + +## Complete Source Code +```csharp +using System; +using GroupDocs.Annotation.Models; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + /// + /// This example demonstrates how to get an information about document's text content + /// + class GetDocumentTextContentInformation + { + public static void Run() + { + using (Annotator annotator = new Annotator("annotated.pdf"_DOCX)) + { + IDocumentInfo documentInfo = annotator.Document.GetDocumentInfo(); + + foreach (PageInfo page in documentInfo.PagesInfo) + { + //Here you can get information about page through the 'page' object. + Console.WriteLine("Page number {0}, width: {1} and height: {2}", page.PageNumber, page.Width, page.Height); + + foreach (TextLineInfo textLine in page.TextLines) + { + //Here you can get information about every text line on page, through the 'textLine' object. + Console.WriteLine("\tText line. '{0}'", textLine.Text); + Console.WriteLine("\t\tText width {0} and height {1}. Top indent: {2}, left indent: {3}", + textLine.Width, textLine.Height, textLine.TopIndent, textLine.LeftIndent); + } + } + } + } + } +} + +``` diff --git a/content/english/net/advanced-usage/get-list-annotations-version-key/_index.md b/content/english/net/advanced-usage/get-list-annotations-version-key/_index.md new file mode 100644 index 0000000..b6a268e --- /dev/null +++ b/content/english/net/advanced-usage/get-list-annotations-version-key/_index.md @@ -0,0 +1,35 @@ +--- +title: Get List of Annotations using Version Key +linktitle: Get List of Annotations using Version Key +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 18 +url: /net/advanced-usage/get-list-annotations-version-key/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.Text; +using GroupDocs.Annotation.Models.AnnotationModels; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + /// + /// This example demonstrates getting list of annotations from document using version key + /// + class GetListOfAnnotationsUsingVersionKey + { + public static void Run() + { + using (Annotator annotator = new Annotator("annotated_with_versions.pdf")) + { + List annotations = annotator.GetVersion("CUSTOM_VERSION"); + } + } + } +} + +``` diff --git a/content/english/net/advanced-usage/import-annotations-from-document/_index.md b/content/english/net/advanced-usage/import-annotations-from-document/_index.md new file mode 100644 index 0000000..fee7036 --- /dev/null +++ b/content/english/net/advanced-usage/import-annotations-from-document/_index.md @@ -0,0 +1,31 @@ +--- +title: Import Annotations from Document +linktitle: Import Annotations from Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 19 +url: /net/advanced-usage/import-annotations-from-document/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + class ImportAnnotationsFromDocument + { + public static void Run() + { + using (Annotator annotator = new Annotator("input.pdf-file")) // specify the path to the file with the annotated + { + annotator.ImportAnnotationsFromDocument("result.XML-file"); // specify the path to the result XML file + } + } + } +} + +``` diff --git a/content/english/net/advanced-usage/loading-custom-fonts/_index.md b/content/english/net/advanced-usage/loading-custom-fonts/_index.md new file mode 100644 index 0000000..6ba2949 --- /dev/null +++ b/content/english/net/advanced-usage/loading-custom-fonts/_index.md @@ -0,0 +1,42 @@ +--- +title: Loading Custom Fonts +linktitle: Loading Custom Fonts +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 20 +url: /net/advanced-usage/loading-custom-fonts/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + class LoadingCustomFonts + { + public static void Run() + { + using (Annotator annotator = new Annotator("input.pdf"_WITH_CUSTOM_FONT, new LoadOptions { FontDirectories = new List { Constants.GetFontDirectory() } })) + { + PreviewOptions previewOptions = new PreviewOptions(pageNumber => + { + var pagePath = Path.Combine(Constants.GetOutputDirectoryPath(), $"result_with_font_{pageNumber}.png"); + return File.Create(pagePath); + }); + + previewOptions.PreviewFormat = PreviewFormats.PNG; + previewOptions.PageNumbers = new int[] { 1, 2, 3, 4 }; + + annotator.Document.GeneratePreview(previewOptions); + } + Console.WriteLine($"\nDocument previews generated successfully.\nCheck output in {Constants.GetOutputDirectoryPath()}."); + } + } +} + +``` diff --git a/content/english/net/advanced-usage/put-image-annotation-over-text/_index.md b/content/english/net/advanced-usage/put-image-annotation-over-text/_index.md new file mode 100644 index 0000000..1ef3fa5 --- /dev/null +++ b/content/english/net/advanced-usage/put-image-annotation-over-text/_index.md @@ -0,0 +1,47 @@ +--- +title: Put Image Annotation over Text +linktitle: Put Image Annotation over Text +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 21 +url: /net/advanced-usage/put-image-annotation-over-text/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + class PutImageAnnotationOverText + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result_for_zIndex" + Path.GetExtension("input.pdf"_ZINDEX)); + + using (Annotator annotator = new Annotator("input.pdf"_ZINDEX)) + { + ImageAnnotation image = new ImageAnnotation + { + Box = new Rectangle(100, 100, 100, 100), + CreatedOn = DateTime.Now, + Opacity = 0.7, + PageNumber = 0, + ImagePath = "image.png", + ZIndex = 3 + }; + annotator.Add(image); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/advanced-usage/rotating-pdf-documents/_index.md b/content/english/net/advanced-usage/rotating-pdf-documents/_index.md new file mode 100644 index 0000000..1839d23 --- /dev/null +++ b/content/english/net/advanced-usage/rotating-pdf-documents/_index.md @@ -0,0 +1,35 @@ +--- +title: Rotating PDF Documents +linktitle: Rotating PDF Documents +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 22 +url: /net/advanced-usage/rotating-pdf-documents/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + class RotationDocument + { + public static void Run() + { + using (Annotator annotator = new Annotator("input.pdf")) + { + annotator.ProcessPages = 1; + annotator.Rotation = RotationDocument.on90; + annotator.Save("result.pdf"); + } + + Console.WriteLine($"\nThe document is rotated 90 degrees"); + } + } +} + +``` diff --git a/content/english/net/advanced-usage/set-document-preview-resolution/_index.md b/content/english/net/advanced-usage/set-document-preview-resolution/_index.md new file mode 100644 index 0000000..28ef2d5 --- /dev/null +++ b/content/english/net/advanced-usage/set-document-preview-resolution/_index.md @@ -0,0 +1,42 @@ +--- +title: Set Document Preview Resolution +linktitle: Set Document Preview Resolution +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 23 +url: /net/advanced-usage/set-document-preview-resolution/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage +{ + class SetDocumentPreviewResolution + { + public static void Run() + { + using (Annotator annotator = new Annotator("input.pdf")) + { + PreviewOptions previewOptions = new PreviewOptions(pageNumber => + { + var pagePath = Path.Combine(Constants.GetOutputDirectoryPath(), $"result_with_resolution_{pageNumber}.png"); + return File.Create(pagePath); + }); + + previewOptions.PreviewFormat = PreviewFormats.PNG; + previewOptions.Resolution = 144; + + annotator.Document.GeneratePreview(previewOptions); + } + + Console.WriteLine($"\nDocument preview with resolution generated successfully.\nCheck output in {Constants.GetOutputDirectoryPath()}."); + } + } +} + +``` diff --git a/content/english/net/applying-licenses/_index.md b/content/english/net/applying-licenses/_index.md new file mode 100644 index 0000000..a1b4166 --- /dev/null +++ b/content/english/net/applying-licenses/_index.md @@ -0,0 +1,14 @@ +--- +title: Applying Licenses +linktitle: Applying Licenses +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 26 +url: /net/applying-licenses/ +--- + +## Applying Licenses Tutorials +### [Set License from File - GroupDocs.Annotation .NET](./set-license-from-file-groupdocs-annotation-dotnet/) +### [Set License from Stream - GroupDocs.Annotation .NET](./set-license-from-stream-groupdocs-annotation-dotnet/) +### [Set Metered License - GroupDocs.Annotation .NET](./set-metered-license-groupdocs-annotation-dotnet/) \ No newline at end of file diff --git a/content/english/net/applying-licenses/set-license-from-file-groupdocs-annotation-dotnet/_index.md b/content/english/net/applying-licenses/set-license-from-file-groupdocs-annotation-dotnet/_index.md new file mode 100644 index 0000000..df8c3aa --- /dev/null +++ b/content/english/net/applying-licenses/set-license-from-file-groupdocs-annotation-dotnet/_index.md @@ -0,0 +1,46 @@ +--- +title: Set License from File - GroupDocs.Annotation .NET +linktitle: Set License from File - GroupDocs.Annotation .NET +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 10 +url: /net/applying-licenses/set-license-from-file-groupdocs-annotation-dotnet/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; + +namespace GroupDocs.Annotation.Examples.CSharp +{ + /// + /// This example demonstrates how to set license from file. + /// + /// + /// The SetLicense method attempts to set a license from several locations relative to the executable and GroupDocs.Annotation.dll. + /// You can also use the additional overload to load a license from a stream, this is useful for instance when the + /// License is stored as an embedded resource. + /// + class SetLicenseFromFile + { + public static void Run() + { + if (File.Exists(Constants.LicensePath)) + { + License license = new License(); + license.SetLicense(Constants.LicensePath); + Console.WriteLine("License set successfully."); + } + else + { + Console.WriteLine("\nWe do not ship any license with this example. " + + "\nVisit the GroupDocs site to obtain either a temporary or permanent license. " + + "\nLearn more about licensing at https://purchase.groupdocs.com/faqs/licensing. " + + "\nLear how to request temporary license at https://purchase.groupdocs.com/temporary-license."); + } + } + } +} +``` diff --git a/content/english/net/applying-licenses/set-license-from-stream-groupdocs-annotation-dotnet/_index.md b/content/english/net/applying-licenses/set-license-from-stream-groupdocs-annotation-dotnet/_index.md new file mode 100644 index 0000000..59e0b06 --- /dev/null +++ b/content/english/net/applying-licenses/set-license-from-stream-groupdocs-annotation-dotnet/_index.md @@ -0,0 +1,45 @@ +--- +title: Set License from Stream - GroupDocs.Annotation .NET +linktitle: Set License from Stream - GroupDocs.Annotation .NET +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 11 +url: /net/applying-licenses/set-license-from-stream-groupdocs-annotation-dotnet/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage +{ + /// + /// This example demonstrates how to set license from stream. + /// + class SetLicenseFromStream + { + public static void Run() + { + if (File.Exists(Constants.LicensePath)) + { + using (FileStream stream = File.OpenRead(Constants.LicensePath)) + { + License license = new License(); + license.SetLicense(stream); + } + + Console.WriteLine("License set successfully."); + } + else + { + Console.WriteLine("\nWe do not ship any license with this example. " + + "\nVisit the GroupDocs site to obtain either a temporary or permanent license. " + + "\nLearn more about licensing at https://purchase.groupdocs.com/faqs/licensing. " + + "\nLear how to request temporary license at https://purchase.groupdocs.com/temporary-license."); + } + } + } +} +``` diff --git a/content/english/net/applying-licenses/set-metered-license-groupdocs-annotation-dotnet/_index.md b/content/english/net/applying-licenses/set-metered-license-groupdocs-annotation-dotnet/_index.md new file mode 100644 index 0000000..8ed309a --- /dev/null +++ b/content/english/net/applying-licenses/set-metered-license-groupdocs-annotation-dotnet/_index.md @@ -0,0 +1,33 @@ +--- +title: Set Metered License - GroupDocs.Annotation .NET +linktitle: Set Metered License - GroupDocs.Annotation .NET +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 12 +url: /net/applying-licenses/set-metered-license-groupdocs-annotation-dotnet/ +--- + +## Complete Source Code +```csharp +using System; + +namespace GroupDocs.Annotation.Examples.CSharp +{ + /// + /// This example demonstrates how to set Metered license. + /// Learn more about Metered license at https://purchase.groupdocs.com/faqs/licensing/metered. + /// + class SetMeteredLicense + { + public static void Run() + { + string publicKey = "*****"; + string privateKey = "*****"; + Metered metered = new Metered(); + metered.SetMeteredKey(publicKey, privateKey); + Console.WriteLine("License set successfully."); + } + } +} +``` diff --git a/content/english/net/document-components/_index.md b/content/english/net/document-components/_index.md new file mode 100644 index 0000000..2417cf1 --- /dev/null +++ b/content/english/net/document-components/_index.md @@ -0,0 +1,14 @@ +--- +title: Document Components +linktitle: Document Components +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 24 +url: /net/document-components/ +--- + +## Document Components Tutorials +### [Add Button Component to PDF Document](./add-button-component-to-pdf/) +### [Add Checkbox Component to PDF Document](./add-checkbox-component-to-pdf/) +### [Add Dropdown Component to PDF Document](./add-dropdown-component-to-pdf/) \ No newline at end of file diff --git a/content/english/net/document-components/add-button-component-to-pdf/_index.md b/content/english/net/document-components/add-button-component-to-pdf/_index.md new file mode 100644 index 0000000..d9fe8e4 --- /dev/null +++ b/content/english/net/document-components/add-button-component-to-pdf/_index.md @@ -0,0 +1,67 @@ +--- +title: Add Button Component to PDF Document +linktitle: Add Button Component to PDF Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 10 +url: /net/document-components/add-button-component-to-pdf/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Models.FormatSpecificComponents.Pdf; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding button component. + /// + class AddButtonComponent + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + ButtonComponent button = new ButtonComponent + { + Box = new Rectangle(100, 100, 100, 100), + PenColor = 65535, + Style = BorderStyle.Dashed, + BorderWidth = 0, + BorderColor = 0, + AlternateName = "Name", + PartialName = "Patial Name", + NormalCaption = "Caption", + ButtonColor = 16761035, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(button); + annotator.Save("result.pdf"); + } + + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} +``` diff --git a/content/english/net/document-components/add-checkbox-component-to-pdf/_index.md b/content/english/net/document-components/add-checkbox-component-to-pdf/_index.md new file mode 100644 index 0000000..d25ba55 --- /dev/null +++ b/content/english/net/document-components/add-checkbox-component-to-pdf/_index.md @@ -0,0 +1,62 @@ +--- +title: Add Checkbox Component to PDF Document +linktitle: Add Checkbox Component to PDF Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 11 +url: /net/document-components/add-checkbox-component-to-pdf/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Models.FormatSpecificComponents.Pdf; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding checkBox component. + /// + class AddCheckBoxComponent + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + CheckBoxComponent checkBox = new CheckBoxComponent + { + Checked = true, + Box = new Rectangle(100, 100, 100, 100), + PenColor = 65535, + Style = BoxStyle.Star, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(checkBox); + annotator.Save("result.pdf"); + } + + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} +``` diff --git a/content/english/net/document-components/add-dropdown-component-to-pdf/_index.md b/content/english/net/document-components/add-dropdown-component-to-pdf/_index.md new file mode 100644 index 0000000..85b9548 --- /dev/null +++ b/content/english/net/document-components/add-dropdown-component-to-pdf/_index.md @@ -0,0 +1,68 @@ +--- +title: Add Dropdown Component to PDF Document +linktitle: Add Dropdown Component to PDF Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 12 +url: /net/document-components/add-dropdown-component-to-pdf/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Models.FormatSpecificComponents.Pdf; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding area annotation. + /// + class AddDropdownComponent + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + DropdownComponent dropdown = new DropdownComponent + { + Options = new List { "Item1", "Item2", "Item3" }, + SelectedOption = null, + Placeholder = "Choose option", + Box = new Rectangle(100, 100, 100, 100), + CreatedOn = DateTime.Now, + Message = "This is dropdown component", + PageNumber = 0, + PenColor = 65535, + PenStyle = PenStyle.Dot, + PenWidth = 3, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(dropdown); + annotator.Save("result.pdf"); + } + + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} +``` diff --git a/content/english/net/document-loading-essentials/_index.md b/content/english/net/document-loading-essentials/_index.md new file mode 100644 index 0000000..9127c0e --- /dev/null +++ b/content/english/net/document-loading-essentials/_index.md @@ -0,0 +1,19 @@ +--- +title: Document Loading Essentials +linktitle: Document Loading Essentials +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 20 +url: /net/document-loading-essentials/ +--- + +## Document Loading Essentials Tutorials +### [Load Document from Amazon S3](./load-document-from-amazon-s3/) +### [Load Document from Azure](./load-document-from-azure/) +### [Load Document from FTP](./load-document-from-ftp/) +### [Load Document from Local Disk](./load-document-from-local-disk/) +### [Load Document from Stream](./load-document-from-stream/) +### [Load Document from URL](./load-document-from-url/) +### [Loading Annotated Document Version](./loading-annotated-document-version/) +### [Load Password Protected Documents](./load-password-protected-documents/) \ No newline at end of file diff --git a/content/english/net/document-loading-essentials/load-document-from-amazon-s3/_index.md b/content/english/net/document-loading-essentials/load-document-from-amazon-s3/_index.md new file mode 100644 index 0000000..1a246a1 --- /dev/null +++ b/content/english/net/document-loading-essentials/load-document-from-amazon-s3/_index.md @@ -0,0 +1,66 @@ +--- +title: Load Document from Amazon S3 +linktitle: Load Document from Amazon S3 +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 10 +url: /net/document-loading-essentials/load-document-from-amazon-s3/ +--- + +## Complete Source Code +```csharp +#if !NETCOREAPP +using Amazon.S3; +using Amazon.S3.Model; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using System; +using System.IO; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage.Loading +{ + /// + /// This example demonstrates loading document from Amazon S3 storage. + /// + class LoadDocumentFromAmazonS3 + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + string key = "sample.pdf"; + using (Annotator annotator = new Annotator(DownloadFile(key))) + { + AreaAnnotation area = new AreaAnnotation() + { + Box = new Rectangle(100, 100, 100, 100), + BackgroundColor = 65535, + }; + annotator.Add(area); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + + private static Stream DownloadFile(string key) + { + AmazonS3Client client = new AmazonS3Client(); + string bucketName = "my-bucket"; + GetObjectRequest request = new GetObjectRequest + { + Key = key, + BucketName = bucketName + }; + using (GetObjectResponse response = client.GetObject(request)) + { + MemoryStream stream = new MemoryStream(); + response.ResponseStream.CopyTo(stream); + stream.Position = 0; + return stream; + } + } + } +} +#endif +``` diff --git a/content/english/net/document-loading-essentials/load-document-from-azure/_index.md b/content/english/net/document-loading-essentials/load-document-from-azure/_index.md new file mode 100644 index 0000000..f44bf06 --- /dev/null +++ b/content/english/net/document-loading-essentials/load-document-from-azure/_index.md @@ -0,0 +1,74 @@ +--- +title: Load Document from Azure +linktitle: Load Document from Azure +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 11 +url: /net/document-loading-essentials/load-document-from-azure/ +--- + +## Complete Source Code +```csharp +#if !NETCOREAPP +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using Microsoft.WindowsAzure.Storage; +using Microsoft.WindowsAzure.Storage.Auth; +using Microsoft.WindowsAzure.Storage.Blob; +using System; +using System.IO; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage.Loading +{ + /// + /// This example demonstrates loading document from Azure. + /// + class LoadDocumentFromAzure + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + string blobName = "sample.pdf"; + using (Annotator annotator = new Annotator(DownloadFile(blobName))) + { + AreaAnnotation area = new AreaAnnotation() + { + Box = new Rectangle(100, 100, 100, 100), + BackgroundColor = 65535, + }; + annotator.Add(area); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + + public static Stream DownloadFile(string blobName) + { + CloudBlobContainer container = GetContainer(); + CloudBlob blob = container.GetBlobReference(blobName); + MemoryStream memoryStream = new MemoryStream(); + blob.DownloadToStream(memoryStream); + memoryStream.Position = 0; + return memoryStream; + } + + private static CloudBlobContainer GetContainer() + { + string accountName = "***"; + string accountKey = "***"; + string endpoint = $"https://{accountName}.blob.core.windows.net/"; + string containerName = "***"; + StorageCredentials storageCredentials = new StorageCredentials(accountName, accountKey); + CloudStorageAccount cloudStorageAccount = new CloudStorageAccount( + storageCredentials, new Uri(endpoint), null, null, null); + CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient(); + CloudBlobContainer container = cloudBlobClient.GetContainerReference(containerName); + container.CreateIfNotExists(); + return container; + } + } +} +#endif +``` diff --git a/content/english/net/document-loading-essentials/load-document-from-ftp/_index.md b/content/english/net/document-loading-essentials/load-document-from-ftp/_index.md new file mode 100644 index 0000000..00f3dc2 --- /dev/null +++ b/content/english/net/document-loading-essentials/load-document-from-ftp/_index.md @@ -0,0 +1,70 @@ +--- +title: Load Document from FTP +linktitle: Load Document from FTP +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 12 +url: /net/document-loading-essentials/load-document-from-ftp/ +--- + +## Complete Source Code +```csharp +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using System; +using System.IO; +using System.Net; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage.Loading +{ + /// + /// This example demonstrates loading document from FTP. + /// + class LoadDocumentFromFtp + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + string filePath = "sample.pdf"; + using (Annotator annotator = new Annotator(GetFileFromFtp(filePath))) + { + AreaAnnotation area = new AreaAnnotation() + { + Box = new Rectangle(100, 100, 100, 100), + BackgroundColor = 65535, + }; + annotator.Add(area); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + + private static Stream GetFileFromFtp(string filePath) + { + Uri uri = new Uri(filePath); + FtpWebRequest request = CreateRequest(uri); + using (WebResponse response = request.GetResponse()) + return GetFileStream(response); + } + + private static FtpWebRequest CreateRequest(Uri uri) + { + FtpWebRequest request = (FtpWebRequest)WebRequest.Create(uri); + request.Method = WebRequestMethods.Ftp.DownloadFile; + return request; + } + + private static Stream GetFileStream(WebResponse response) + { + MemoryStream fileStream = new MemoryStream(); + using (Stream responseStream = response.GetResponseStream()) + responseStream.CopyTo(fileStream); + fileStream.Position = 0; + return fileStream; + } + } +} + +``` diff --git a/content/english/net/document-loading-essentials/load-document-from-local-disk/_index.md b/content/english/net/document-loading-essentials/load-document-from-local-disk/_index.md new file mode 100644 index 0000000..608663f --- /dev/null +++ b/content/english/net/document-loading-essentials/load-document-from-local-disk/_index.md @@ -0,0 +1,44 @@ +--- +title: Load Document from Local Disk +linktitle: Load Document from Local Disk +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 13 +url: /net/document-loading-essentials/load-document-from-local-disk/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage.Loading +{ + /// + /// This example demonstrates loading document from file path. + /// + class LoadDocumentFromLocalDisk + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + AreaAnnotation area = new AreaAnnotation() + { + Box = new Rectangle(100, 100, 100, 100), + BackgroundColor = 65535, + }; + annotator.Add(area); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/document-loading-essentials/load-document-from-stream/_index.md b/content/english/net/document-loading-essentials/load-document-from-stream/_index.md new file mode 100644 index 0000000..14f99fe --- /dev/null +++ b/content/english/net/document-loading-essentials/load-document-from-stream/_index.md @@ -0,0 +1,44 @@ +--- +title: Load Document from Stream +linktitle: Load Document from Stream +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 14 +url: /net/document-loading-essentials/load-document-from-stream/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage.Loading +{ + /// + /// This example demonstrates loading document from stream. + /// + class LoadDocumentFromStream + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator(File.OpenRead("input.pdf"))) + { + AreaAnnotation area = new AreaAnnotation() + { + Box = new Rectangle(100, 100, 100, 100), + BackgroundColor = 65535, + }; + annotator.Add(area); + annotator.Save(File.Create(outputPath)); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/document-loading-essentials/load-document-from-url/_index.md b/content/english/net/document-loading-essentials/load-document-from-url/_index.md new file mode 100644 index 0000000..44eaa58 --- /dev/null +++ b/content/english/net/document-loading-essentials/load-document-from-url/_index.md @@ -0,0 +1,62 @@ +--- +title: Load Document from URL +linktitle: Load Document from URL +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 15 +url: /net/document-loading-essentials/load-document-from-url/ +--- + +## Complete Source Code +```csharp +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using System; +using System.IO; +using System.Net; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage.Loading +{ + /// + /// This example demonstrates loading document from URL. + /// + class LoadDocumentFromUrl + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + string url = "https://github.com/groupdocs-annotation/GroupDocs.Annotation-for-.NET/blob/master/Examples/Resources/SampleFiles/input.pdf?raw=true"; + using (Annotator annotator = new Annotator(GetRemoteFile(url))) + { + AreaAnnotation area = new AreaAnnotation() + { + Box = new Rectangle(100, 100, 100, 100), + BackgroundColor = 65535, + }; + annotator.Add(area); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + + private static Stream GetRemoteFile(string url) + { + WebRequest request = WebRequest.Create(url); + using (WebResponse response = request.GetResponse()) + return GetFileStream(response); + } + + private static Stream GetFileStream(WebResponse response) + { + MemoryStream fileStream = new MemoryStream(); + using (Stream responseStream = response.GetResponseStream()) + responseStream.CopyTo(fileStream); + fileStream.Position = 0; + return fileStream; + } + } +} + +``` diff --git a/content/english/net/document-loading-essentials/load-password-protected-documents/_index.md b/content/english/net/document-loading-essentials/load-password-protected-documents/_index.md new file mode 100644 index 0000000..8051a3a --- /dev/null +++ b/content/english/net/document-loading-essentials/load-password-protected-documents/_index.md @@ -0,0 +1,46 @@ +--- +title: Load Password Protected Documents +linktitle: Load Password Protected Documents +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 17 +url: /net/document-loading-essentials/load-password-protected-documents/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage.Loading +{ + /// + /// This example demonstrates annotating documents that are protected with a password. + /// + class LoadPasswordProtectedDocuments + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + LoadOptions loadOptions = new LoadOptions() { Password = "1234" }; + using (Annotator annotator = new Annotator("input.pdf"_PROTECTED, loadOptions)) + { + AreaAnnotation area = new AreaAnnotation() + { + Box = new Rectangle(100, 100, 100, 100), + BackgroundColor = 65535, + }; + annotator.Add(area); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/document-loading-essentials/loading-annotated-document-version/_index.md b/content/english/net/document-loading-essentials/loading-annotated-document-version/_index.md new file mode 100644 index 0000000..7b89512 --- /dev/null +++ b/content/english/net/document-loading-essentials/loading-annotated-document-version/_index.md @@ -0,0 +1,45 @@ +--- +title: Loading Annotated Document Version +linktitle: Loading Annotated Document Version +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 16 +url: /net/document-loading-essentials/loading-annotated-document-version/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.AdvancedUsage.Loading +{ + /// + /// This example demonstrates loading annotated document versions that were added using save method. + /// + class LoadingAnnotatedDocumentVersion + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), + "result" + Path.GetExtension("input.pdf")); + + LoadOptions loadOptions = new LoadOptions { Version = "FIRST" }; + using (Annotator annotator = new Annotator("annotated_with_versions.pdf", loadOptions)) + { + var annotations = annotator.Get(); // As you can see, the number of annotations are not the same as you can see at the document. It's because we loaded not from last version + annotator.Save(outputPath); // Now we save this version as separate document, were this version will be added as new, but version from loaded document will be penultimate + } + + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/getting-started/_index.md b/content/english/net/getting-started/_index.md new file mode 100644 index 0000000..ff7eaa9 --- /dev/null +++ b/content/english/net/getting-started/_index.md @@ -0,0 +1,11 @@ +--- +title: Getting Started +linktitle: Getting Started +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 21 +url: /net/getting-started/ +--- + +## Getting Started Tutorials \ No newline at end of file diff --git a/content/english/net/removing-annotations/_index.md b/content/english/net/removing-annotations/_index.md new file mode 100644 index 0000000..72a5671 --- /dev/null +++ b/content/english/net/removing-annotations/_index.md @@ -0,0 +1,19 @@ +--- +title: Removing Annotations +linktitle: Removing Annotations +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 25 +url: /net/removing-annotations/ +--- + +## Removing Annotations Tutorials +### [Remove Annotations in .NET](./remove-annotations/) +### [Remove Annotations by ID](./remove-annotations-by-id/) +### [Remove Multiple Annotations in .NET](./remove-multiple-annotations/) +### [Remove Multiple Annotations by IDs](./remove-multiple-annotations-by-ids/) +### [Remove Annotations Using Save Options in .NET](./remove-annotations-using-save-options/) +### [Remove Replies to Annotations in .NET](./remove-replies-to-annotations/) +### [Remove Replies by ID in .NET](./remove-replies-by-id/) +### [Remove Replies by User Name in .NET](./remove-replies-by-username/) \ No newline at end of file diff --git a/content/english/net/removing-annotations/remove-annotations-by-id/_index.md b/content/english/net/removing-annotations/remove-annotations-by-id/_index.md new file mode 100644 index 0000000..9893da8 --- /dev/null +++ b/content/english/net/removing-annotations/remove-annotations-by-id/_index.md @@ -0,0 +1,39 @@ +--- +title: Remove Annotations by ID +linktitle: Remove Annotations by ID +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 11 +url: /net/removing-annotations/remove-annotations-by-id/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage +{ + /// + /// This example demonstrates how to remove annotations from annotated document by Id + /// + class RemoveAnnotationById + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("annotated.pdf")) + { + annotator.Remove(0); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + + } +} + +``` diff --git a/content/english/net/removing-annotations/remove-annotations-using-save-options/_index.md b/content/english/net/removing-annotations/remove-annotations-using-save-options/_index.md new file mode 100644 index 0000000..84262b5 --- /dev/null +++ b/content/english/net/removing-annotations/remove-annotations-using-save-options/_index.md @@ -0,0 +1,37 @@ +--- +title: Remove Annotations Using Save Options in .NET +linktitle: Remove Annotations Using Save Options in .NET +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 14 +url: /net/removing-annotations/remove-annotations-using-save-options/ +--- + +## Complete Source Code +```csharp +using GroupDocs.Annotation.Options; +using System; +using System.IO; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage +{ + /// + /// This example demonstrates how to remove annotations from document using SaveOptions Property + /// + class RemoveAnnotationUsingSaveOptions + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("annotated.pdf")) + { + annotator.Save(outputPath, new SaveOptions() { AnnotationTypes = AnnotationType.None }); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/removing-annotations/remove-annotations/_index.md b/content/english/net/removing-annotations/remove-annotations/_index.md new file mode 100644 index 0000000..4e88904 --- /dev/null +++ b/content/english/net/removing-annotations/remove-annotations/_index.md @@ -0,0 +1,35 @@ +--- +title: Remove Annotations in .NET +linktitle: Remove Annotations in .NET +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 10 +url: /net/removing-annotations/remove-annotations/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage +{ + class RemoveAnnotationByAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("annotated.pdf")) + { + annotator.Remove(annotator.Get()[0]); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/removing-annotations/remove-multiple-annotations-by-ids/_index.md b/content/english/net/removing-annotations/remove-multiple-annotations-by-ids/_index.md new file mode 100644 index 0000000..85d5c69 --- /dev/null +++ b/content/english/net/removing-annotations/remove-multiple-annotations-by-ids/_index.md @@ -0,0 +1,37 @@ +--- +title: Remove Multiple Annotations by IDs +linktitle: Remove Multiple Annotations by IDs +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 13 +url: /net/removing-annotations/remove-multiple-annotations-by-ids/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage +{ + class RemoveAnnotationsByIds + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("annotated.pdf")) + { + annotator.Remove(new List{0,1}); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/removing-annotations/remove-multiple-annotations/_index.md b/content/english/net/removing-annotations/remove-multiple-annotations/_index.md new file mode 100644 index 0000000..e51a158 --- /dev/null +++ b/content/english/net/removing-annotations/remove-multiple-annotations/_index.md @@ -0,0 +1,37 @@ +--- +title: Remove Multiple Annotations in .NET +linktitle: Remove Multiple Annotations in .NET +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 12 +url: /net/removing-annotations/remove-multiple-annotations/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage +{ + class RemoveAnnotationsByAnnotations + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("annotated.pdf")) + { + annotator.Remove(annotator.Get()); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/removing-annotations/remove-replies-by-id/_index.md b/content/english/net/removing-annotations/remove-replies-by-id/_index.md new file mode 100644 index 0000000..88ed2ba --- /dev/null +++ b/content/english/net/removing-annotations/remove-replies-by-id/_index.md @@ -0,0 +1,50 @@ +--- +title: Remove Replies by ID in .NET +linktitle: Remove Replies by ID in .NET +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 16 +url: /net/removing-annotations/remove-replies-by-id/ +--- + +## Complete Source Code +```csharp +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; +using System; +using System.Collections.Generic; +using System.IO; + + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage +{ + /// + /// This example demonstrates how to remove replies from annotated document by reply Id + /// + class RemoveRepliesById + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + // NOTE: Input document already contain annotations with replies + using (Annotator annotator = new Annotator("annotated_with_replies.pdf")) + { + // Obtain annotations collection from document + List annotations = annotator.Get(); + + // Remove reply with Id = 4 + annotations[0].Replies.RemoveAll(x => x.Id == 4); + + // Save changes + annotator.Update(annotations); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/removing-annotations/remove-replies-by-username/_index.md b/content/english/net/removing-annotations/remove-replies-by-username/_index.md new file mode 100644 index 0000000..d9c09d8 --- /dev/null +++ b/content/english/net/removing-annotations/remove-replies-by-username/_index.md @@ -0,0 +1,49 @@ +--- +title: Remove Replies by User Name in .NET +linktitle: Remove Replies by User Name in .NET +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 17 +url: /net/removing-annotations/remove-replies-by-username/ +--- + +## Complete Source Code +```csharp +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; +using System; +using System.Collections.Generic; +using System.IO; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage +{ + /// + /// This example demonstrates how to remove replies from annotated document by user name + /// + class RemoveRepliesByUserName + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + // NOTE: Input document already contain annotations with replies + using (Annotator annotator = new Annotator("annotated_with_replies.pdf")) + { + // Obtain annotations collection from document + List annotations = annotator.Get(); + + // Remove all replies where author name is "Tom" + annotations[0].Replies.RemoveAll(x => x.User.Name == "Tom"); + + // Save changes + annotator.Update(annotations); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/removing-annotations/remove-replies-to-annotations/_index.md b/content/english/net/removing-annotations/remove-replies-to-annotations/_index.md new file mode 100644 index 0000000..cb2ac27 --- /dev/null +++ b/content/english/net/removing-annotations/remove-replies-to-annotations/_index.md @@ -0,0 +1,49 @@ +--- +title: Remove Replies to Annotations in .NET +linktitle: Remove Replies to Annotations in .NET +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 15 +url: /net/removing-annotations/remove-replies-to-annotations/ +--- + +## Complete Source Code +```csharp +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; +using System; +using System.Collections.Generic; +using System.IO; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage +{ + /// + /// This example demonstrates how to remove replies from annotated document + /// + class RemoveReplies + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + // NOTE: Input document already contain annotations with replies + using (Annotator annotator = new Annotator("annotated_with_replies.pdf")) + { + // Obtain annotations collection from document + List annotations = annotator.Get(); + + // Remove first reply by index + annotations[0].Replies.RemoveAt(0); + + // Save changes + annotator.Update(annotations); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/_index.md b/content/english/net/unlocking-annotation-power/_index.md new file mode 100644 index 0000000..d046861 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/_index.md @@ -0,0 +1,30 @@ +--- +title: Unlocking Annotation Power +linktitle: Unlocking Annotation Power +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 23 +url: /net/unlocking-annotation-power/ +--- + +## Unlocking Annotation Power Tutorials +### [Add Area Annotation to Document](./add-area-annotation/) +### [Add Arrow Annotation to Document](./add-arrow-annotation/) +### [Add Distance Annotation to Document](./add-distance-annotation/) +### [Add Ellipse Annotation to Document](./add-ellipse-annotation/) +### [Add Image Annotation to Document (Local Path)](./add-image-annotation-local-path/) +### [Add Image Annotation to Document (Remote Path)](./add-image-annotation-remote-path/) +### [Add Link Annotation to Document](./add-link-annotation/) +### [Add Point Annotation to Document](./add-point-annotation/) +### [Add Polyline Annotation to Document](./add-polyline-annotation/) +### [Add Resources Redaction Annotation to Document](./add-resources-redaction-annotation/) +### [Add Search Text Fragment Annotation to Document](./add-search-text-fragment-annotation/) +### [Add Text Field Annotation to Document](./add-text-field-annotation/) +### [Add Text Highlight Annotation to Document](./add-text-highlight-annotation/) +### [Add Text Redaction Annotation to Document](./add-text-redaction-annotation/) +### [Add Text Replacement Annotation to Document](./add-text-replacement-annotation/) +### [Add Text Squiggly Annotation to Document](./add-text-squiggly-annotation/) +### [Add Text Strikeout Annotation to Document](./add-text-strikeout-annotation/) +### [Add Text Underline Annotation to Document](./add-text-underline-annotation/) +### [Add Watermark Annotation to Document](./add-watermark-annotation/) \ No newline at end of file diff --git a/content/english/net/unlocking-annotation-power/add-area-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-area-annotation/_index.md new file mode 100644 index 0000000..7548024 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-area-annotation/_index.md @@ -0,0 +1,66 @@ +--- +title: Add Area Annotation to Document +linktitle: Add Area Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 10 +url: /net/unlocking-annotation-power/add-area-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding area annotation. + /// + class AddAreaAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + AreaAnnotation area = new AreaAnnotation + { + BackgroundColor = 65535, + Box = new Rectangle(100, 100, 100, 100), + CreatedOn = DateTime.Now, + Message = "This is area annotation", + Opacity = 0.7, + PageNumber = 0, + PenColor = 65535, + PenStyle = PenStyle.Dot, + PenWidth = 3, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(area); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-arrow-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-arrow-annotation/_index.md new file mode 100644 index 0000000..aa2ef52 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-arrow-annotation/_index.md @@ -0,0 +1,65 @@ +--- +title: Add Arrow Annotation to Document +linktitle: Add Arrow Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 11 +url: /net/unlocking-annotation-power/add-arrow-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding arrow annotation. + /// + class AddArrowAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + ArrowAnnotation arrow = new ArrowAnnotation + { + Box = new Rectangle(100, 100, 100, 100), + CreatedOn = DateTime.Now, + Message = "This is arrow annotation", + Opacity = 0.7, + PageNumber = 0, + PenColor = 65535, + PenStyle = PenStyle.Dot, + PenWidth = 3, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(arrow); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-distance-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-distance-annotation/_index.md new file mode 100644 index 0000000..c6aad12 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-distance-annotation/_index.md @@ -0,0 +1,65 @@ +--- +title: Add Distance Annotation to Document +linktitle: Add Distance Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 12 +url: /net/unlocking-annotation-power/add-distance-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding distance annotation. + /// + class AddDistanceAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + DistanceAnnotation distance = new DistanceAnnotation + { + Box = new Rectangle(200, 150, 200, 30), + CreatedOn = DateTime.Now, + Message = "This is distance annotation", + Opacity = 0.7, + PageNumber = 0, + PenColor = 65535, + PenStyle = PenStyle.Dot, + PenWidth = 3, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(distance); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-ellipse-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-ellipse-annotation/_index.md new file mode 100644 index 0000000..a6bcf4d --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-ellipse-annotation/_index.md @@ -0,0 +1,66 @@ +--- +title: Add Ellipse Annotation to Document +linktitle: Add Ellipse Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 13 +url: /net/unlocking-annotation-power/add-ellipse-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding ellipse annotation. + /// + class AddEllipseAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + EllipseAnnotation ellipse = new EllipseAnnotation + { + BackgroundColor = 65535, + Box = new Rectangle(100, 100, 100, 100), + CreatedOn = DateTime.Now, + Message = "This is ellipse annotation", + Opacity = 0.7, + PageNumber = 0, + PenColor = 65535, + PenStyle = PenStyle.Dot, + PenWidth = 3, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(ellipse); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-image-annotation-local-path/_index.md b/content/english/net/unlocking-annotation-power/add-image-annotation-local-path/_index.md new file mode 100644 index 0000000..c37c1ba --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-image-annotation-local-path/_index.md @@ -0,0 +1,47 @@ +--- +title: Add Image Annotation to Document (Local Path) +linktitle: Add Image Annotation to Document (Local Path) +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 14 +url: /net/unlocking-annotation-power/add-image-annotation-local-path/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding image annotation with local path. + /// + class AddImageAnnotationLocalPath + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + ImageAnnotation image = new ImageAnnotation + { + Box = new Rectangle(100, 100, 100, 100), + CreatedOn = DateTime.Now, + Opacity = 0.7, + PageNumber = 0, + ImagePath = "image.png" + }; + annotator.Add(image); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-image-annotation-remote-path/_index.md b/content/english/net/unlocking-annotation-power/add-image-annotation-remote-path/_index.md new file mode 100644 index 0000000..45f7a6a --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-image-annotation-remote-path/_index.md @@ -0,0 +1,47 @@ +--- +title: Add Image Annotation to Document (Remote Path) +linktitle: Add Image Annotation to Document (Remote Path) +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 15 +url: /net/unlocking-annotation-power/add-image-annotation-remote-path/ +--- + +## Complete Source Code +```csharp +using System; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding image annotation with remote path. + /// + class AddImageAnnotationRemotePath + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + ImageAnnotation image = new ImageAnnotation + { + Box = new Rectangle(100, 100, 100, 100), + CreatedOn = DateTime.Now, + Opacity = 0.7, + PageNumber = 0, + ImagePath = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png" + }; + annotator.Add(image); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-link-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-link-annotation/_index.md new file mode 100644 index 0000000..b5c1fe6 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-link-annotation/_index.md @@ -0,0 +1,67 @@ +--- +title: Add Link Annotation to Document +linktitle: Add Link Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 16 +url: /net/unlocking-annotation-power/add-link-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding link annotation. + /// + class AddLinkAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + LinkAnnotation link = new LinkAnnotation + { + CreatedOn = DateTime.Now, + Message = "This is link annotation", + Opacity = 0.7, + PageNumber = 0, + BackgroundColor = 16761035, + Points = new List + { + new Point(80, 730), new Point(240, 730), new Point(80, 650), new Point(240, 650) + }, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + }, + Url = "https://www.google.com" + }; + annotator.Add(link); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-point-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-point-annotation/_index.md new file mode 100644 index 0000000..2ec04a4 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-point-annotation/_index.md @@ -0,0 +1,61 @@ +--- +title: Add Point Annotation to Document +linktitle: Add Point Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 17 +url: /net/unlocking-annotation-power/add-point-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding point annotation. + /// + class AddPointAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + PointAnnotation point = new PointAnnotation + { + Box = new Rectangle(100, 100, 0, 0), + CreatedOn = DateTime.Now, + Message = "This is point annotation", + PageNumber = 0, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(point); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-polyline-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-polyline-annotation/_index.md new file mode 100644 index 0000000..c89c684 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-polyline-annotation/_index.md @@ -0,0 +1,66 @@ +--- +title: Add Polyline Annotation to Document +linktitle: Add Polyline Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 18 +url: /net/unlocking-annotation-power/add-polyline-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding polyline annotation. + /// + class AddPolylineAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + PolylineAnnotation polyline = new PolylineAnnotation + { + Box = new Rectangle(250, 35, 102, 12), + CreatedOn = DateTime.Now, + Message = "This is polyline annotation", + Opacity = 0.7, + PageNumber = 0, + PenColor = 65535, + PenStyle = PenStyle.Dot, + PenWidth = 3, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + }, + SvgPath = "M250.8280751173709,48.209295774647885l0.6986854460093896,0l0.6986854460093896,-1.3973708920187793l0.6986854460093896,0l0.6986854460093896,-1.3973708920187793l1.3973708920187793,-0.6986854460093896l0.6986854460093896,-0.6986854460093896l0.6986854460093896,0l2.096056338028169,-1.3973708920187793l3.493427230046948,-1.3973708920187793l0.6986854460093896,-0.6986854460093896l1.3973708920187793,-1.3973708920187793l0.6986854460093896,0l1.3973708920187793,-0.6986854460093896l0.6986854460093896,0l0.6986854460093896,-0.6986854460093896l0.6986854460093896,0l0.6986854460093896,0l0,-0.6986854460093896l0.6986854460093896,0l0.6986854460093896,0l1.3973708920187793,0l0,-0.6986854460093896l0.6986854460093896,0l1.3973708920187793,0l0.6986854460093896,0l1.3973708920187793,0l0.6986854460093896,0l2.096056338028169,-0.6986854460093896l1.3973708920187793,0l0.6986854460093896,0l0.6986854460093896,0l1.3973708920187793,0l1.3973708920187793,0l1.3973708920187793,0l2.096056338028169,0l5.589483568075117,0l1.3973708920187793,0l2.096056338028169,0l0.6986854460093896,0l1.3973708920187793,0l0.6986854460093896,0l1.3973708920187793,0l1.3973708920187793,0l0.6986854460093896,0.6986854460093896l1.3973708920187793,0l2.096056338028169,1.3973708920187793l0.6986854460093896,0l0.6986854460093896,0l0,0.6986854460093896l1.3973708920187793,0l0.6986854460093896,0.6986854460093896l1.3973708920187793,0.6986854460093896l0,0.6986854460093896l0.6986854460093896,0l1.3973708920187793,0.6986854460093896l1.3973708920187793,0.6986854460093896l3.493427230046948,0.6986854460093896l1.3973708920187793,0.6986854460093896l2.096056338028169,0.6986854460093896l1.3973708920187793,0.6986854460093896l1.3973708920187793,0l1.3973708920187793,0.6986854460093896l0.6986854460093896,0l0.6986854460093896,0.6986854460093896l1.3973708920187793,0l0.6986854460093896,0l0.6986854460093896,0l2.7947417840375586,0l1.3973708920187793,0l0.6986854460093896,0l1.3973708920187793,0l0.6986854460093896,0l0.6986854460093896,0l1.3973708920187793,0l0.6986854460093896,0l2.7947417840375586,0l0.6986854460093896,0l2.7947417840375586,0l1.3973708920187793,0l0.6986854460093896,0l0.6986854460093896,0l0.6986854460093896,0l0.6986854460093896,0l0.6986854460093896,0l0.6986854460093896,0l0.6986854460093896,-0.6986854460093896l0.6986854460093896,0" + }; + annotator.Add(polyline); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-resources-redaction-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-resources-redaction-annotation/_index.md new file mode 100644 index 0000000..dd59d50 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-resources-redaction-annotation/_index.md @@ -0,0 +1,64 @@ +--- +title: Add Resources Redaction Annotation to Document +linktitle: Add Resources Redaction Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 19 +url: /net/unlocking-annotation-power/add-resources-redaction-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding resources redaction annotation. + /// + class AddResourcesRedactionAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + ResourcesRedactionAnnotation resourcesRedaction = new ResourcesRedactionAnnotation + { + Box = new Rectangle(100, 100, 100, 100), + CreatedOn = DateTime.Now, + Message = "This is resources redaction annotation", + PageNumber = 0, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(resourcesRedaction); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-search-text-fragment-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-search-text-fragment-annotation/_index.md new file mode 100644 index 0000000..d8a21e4 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-search-text-fragment-annotation/_index.md @@ -0,0 +1,50 @@ +--- +title: Add Search Text Fragment Annotation to Document +linktitle: Add Search Text Fragment Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 20 +url: /net/unlocking-annotation-power/add-search-text-fragment-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding search text fragment annotation. + /// + class AddSearchTextFragmentAnnotation + { + public static void Run() + { + + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + SearchTextFragment searchText = new SearchTextFragment() + { + Text = "Welcome to GroupDocs", //here should be the text that is contained in your document, otherwise nothing will be highlighted + FontSize = 10, + FontFamily = "Calibri", + FontColor = 65535, + BackgroundColor = 16761035, + }; + annotator.Add(searchText); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-text-field-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-text-field-annotation/_index.md new file mode 100644 index 0000000..3e9662b --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-text-field-annotation/_index.md @@ -0,0 +1,68 @@ +--- +title: Add Text Field Annotation to Document +linktitle: Add Text Field Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 21 +url: /net/unlocking-annotation-power/add-text-field-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding text field annotation. + /// + class AddTextFieldAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + TextFieldAnnotation textField = new TextFieldAnnotation + { + BackgroundColor = 65535, + Box = new Rectangle(100, 100, 100, 100), + CreatedOn = DateTime.Now, + Text = "Some text", + FontColor = 65535, + FontSize = 12, + Message = "This is text field annotation", + Opacity = 0.7, + PageNumber = 0, + PenStyle = PenStyle.Dot, + PenWidth = 3, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(textField); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-text-highlight-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-text-highlight-annotation/_index.md new file mode 100644 index 0000000..3df1c95 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-text-highlight-annotation/_index.md @@ -0,0 +1,67 @@ +--- +title: Add Text Highlight Annotation to Document +linktitle: Add Text Highlight Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 22 +url: /net/unlocking-annotation-power/add-text-highlight-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding text highlight annotation. + /// + class AddTextHighlightAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + HighlightAnnotation highlight = new HighlightAnnotation + { + BackgroundColor = 65535, + CreatedOn = DateTime.Now, + FontColor = 0, + Message = "This is highlight annotation", + Opacity = 0.5, + PageNumber = 0, + Points = new List + { + new Point(80, 730), new Point(240, 730), new Point(80, 650), new Point(240, 650) + }, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(highlight); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-text-redaction-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-text-redaction-annotation/_index.md new file mode 100644 index 0000000..aa17490 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-text-redaction-annotation/_index.md @@ -0,0 +1,65 @@ +--- +title: Add Text Redaction Annotation to Document +linktitle: Add Text Redaction Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 23 +url: /net/unlocking-annotation-power/add-text-redaction-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding text redaction annotation. + /// + class AddTextRedactionAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + TextRedactionAnnotation textRedaction = new TextRedactionAnnotation + { + CreatedOn = DateTime.Now, + Message = "This is text redaction annotation", + PageNumber = 0, + FontColor = 16761035, + Points = new List + { + new Point(80, 730), new Point(240, 730), new Point(80, 650), new Point(240, 650) + }, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(textRedaction); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-text-replacement-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-text-replacement-annotation/_index.md new file mode 100644 index 0000000..2448492 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-text-replacement-annotation/_index.md @@ -0,0 +1,70 @@ +--- +title: Add Text Replacement Annotation to Document +linktitle: Add Text Replacement Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 24 +url: /net/unlocking-annotation-power/add-text-replacement-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; +using Point = GroupDocs.Annotation.Models.Point; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding text replacement annotation. + /// + class AddTextReplacementAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + ReplacementAnnotation replacement = new ReplacementAnnotation + { + CreatedOn = DateTime.Now, + FontColor = Color.Blue.ToArgb(), + Message = "This is replacement annotation", + Opacity = 0.7, + PageNumber = 0, + BackgroundColor = Color.Red.ToArgb(), + Points = new List + { + new Point(80, 730), new Point(240, 730), new Point(80, 650), new Point(240, 650) + }, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + }, + TextToReplace = "replaced text" + }; + annotator.Add(replacement); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-text-squiggly-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-text-squiggly-annotation/_index.md new file mode 100644 index 0000000..9c9ea4f --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-text-squiggly-annotation/_index.md @@ -0,0 +1,68 @@ +--- +title: Add Text Squiggly Annotation to Document +linktitle: Add Text Squiggly Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 25 +url: /net/unlocking-annotation-power/add-text-squiggly-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding text squiggly annotation. + /// + class AddTextSquigglyAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + SquigglyAnnotation squiggly = new SquigglyAnnotation + { + CreatedOn = DateTime.Now, + FontColor = 65535, + Message = "This is squiggly annotation", + Opacity = 0.7, + PageNumber = 0, + BackgroundColor = 16761035, + SquigglyColor = 1422623, // works supported only Word and PDF documents + Points = new List + { + new Point(80, 730), new Point(240, 730), new Point(80, 650), new Point(240, 650) + }, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(squiggly); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-text-strikeout-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-text-strikeout-annotation/_index.md new file mode 100644 index 0000000..8cd713f --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-text-strikeout-annotation/_index.md @@ -0,0 +1,67 @@ +--- +title: Add Text Strikeout Annotation to Document +linktitle: Add Text Strikeout Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 26 +url: /net/unlocking-annotation-power/add-text-strikeout-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding text strikeout annotation. + /// + class AddTextStrikeoutAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + StrikeoutAnnotation strikeout = new StrikeoutAnnotation + { + CreatedOn = DateTime.Now, + FontColor = 65535, + Message = "This is strikeout annotation", + Opacity = 0.7, + PageNumber = 0, + BackgroundColor = 16761035, + Points = new List + { + new Point(80, 730), new Point(240, 730), new Point(80, 650), new Point(240, 650) + }, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(strikeout); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-text-underline-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-text-underline-annotation/_index.md new file mode 100644 index 0000000..c195f55 --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-text-underline-annotation/_index.md @@ -0,0 +1,68 @@ +--- +title: Add Text Underline Annotation to Document +linktitle: Add Text Underline Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 27 +url: /net/unlocking-annotation-power/add-text-underline-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; +using GroupDocs.Annotation.Options; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding text underline annotation. + /// + class AddTextUnderlineAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + UnderlineAnnotation underline = new UnderlineAnnotation + { + CreatedOn = DateTime.Now, + FontColor = 65535, + Message = "This is underline annotation", + Opacity = 0.7, + PageNumber = 0, + BackgroundColor = 16761035, + UnderlineColor = 1422623, // works supported only Word and PDF documents + Points = new List + { + new Point(80, 730), new Point(240, 730), new Point(80, 650), new Point(240, 650) + }, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(underline); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +``` diff --git a/content/english/net/unlocking-annotation-power/add-watermark-annotation/_index.md b/content/english/net/unlocking-annotation-power/add-watermark-annotation/_index.md new file mode 100644 index 0000000..4d3cf1b --- /dev/null +++ b/content/english/net/unlocking-annotation-power/add-watermark-annotation/_index.md @@ -0,0 +1,68 @@ +--- +title: Add Watermark Annotation to Document +linktitle: Add Watermark Annotation to Document +second_title: GroupDocs.Annotation .NET API +description: +type: docs +weight: 28 +url: /net/unlocking-annotation-power/add-watermark-annotation/ +--- + +## Complete Source Code +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using GroupDocs.Annotation.Models; +using GroupDocs.Annotation.Models.AnnotationModels; + +namespace GroupDocs.Annotation.Examples.CSharp.BasicUsage.AddAnnotationToTheDocument +{ + /// + /// This example demonstrates adding watermark annotation. + /// + class AddWatermarkAnnotation + { + public static void Run() + { + string outputPath = Path.Combine(Constants.GetOutputDirectoryPath(), "result" + Path.GetExtension("input.pdf")); + + using (Annotator annotator = new Annotator("input.pdf")) + { + WatermarkAnnotation watermark = new WatermarkAnnotation + { + Angle = 75, + Box = new Rectangle(200, 200, 100, 50), + CreatedOn = DateTime.Now, + Text = "Watermark", + FontColor = 65535, + FontSize = 12, + Message = "This is watermark annotation", + Opacity = 0.7, + PageNumber = 0, + AutoScale = true, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + Replies = new List + { + new Reply + { + Comment = "First comment", + RepliedOn = DateTime.Now + }, + new Reply + { + Comment = "Second comment", + RepliedOn = DateTime.Now + } + } + }; + annotator.Add(watermark); + annotator.Save(outputPath); + } + Console.WriteLine($"\nDocument saved successfully.\nCheck output in {outputPath}."); + } + } +} + +```