diff --git a/_config.yml b/_config.yml index ed840bfe..49139e36 100644 --- a/_config.yml +++ b/_config.yml @@ -49,7 +49,7 @@ navigation: title: Troubleshooting position: 99 common-information: - title: Common Information + title: Common position: 98 security: title: Security diff --git a/common-information/device-independent-pixels.md b/common-information/device-independent-pixels.md index 6be9340f..038df39b 100644 --- a/common-information/device-independent-pixels.md +++ b/common-information/device-independent-pixels.md @@ -48,23 +48,23 @@ Most of the methods follow the same pattern for converting units: __Example 1__ shows how to obtain row height as DIPs and convert it to Points. -#### __[C#] Example 1: Convert from DIP to Point__ +#### __Example 1: Convert from DIP to Point__ -{{region dips_1}} +```csharp var rowHeightInDips = worksheet.Rows[0].GetHeight().Value.Value; var rowHeightInPoints = UnitHelper.DipToPoint(rowHeightInDips); -{{endregion}} +``` except the **DipToUnit** and **UnitToDip** methods which accepts not only the units but the [UnitType](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.media.unittype) as well as a parameter: __Example 2__ shows how to convert from Point to DIP and set the row height. -#### __[C#] Example 2: Convert from Point to DIP__ +#### __Example 2: Convert from Point to DIP__ -{{region dips_2}} +```csharp double dips = UnitHelper.UnitToDip(60, UnitType.Point); RowHeight newRowHeight = new RowHeight(dips, isCustom: true); worksheet.Rows[0].SetHeight(newRowHeight); -{{endregion}} +``` diff --git a/common-information/fileformatdetector.md b/common-information/fileformatdetector.md new file mode 100644 index 00000000..cdb6155b --- /dev/null +++ b/common-information/fileformatdetector.md @@ -0,0 +1,57 @@ +--- +title: FileFormatDetector +description: Detect file formats automatically using the FileFormatDetector of the Telerik Document Processing libraries. +page_title: FileFormatDetector +slug: fileformatdetector +position: 1 +published: True +tags: file, format, detection, detector, pdf, docx, xlsx, zip, doc, xls, xlsm, txt, document, processing, libraries +--- + +# FileFormatDetector + +The **FileFormatDetector** API provides automatic file format detection capabilities for various document types supported by Telerik Document Processing libraries. This utility enables you to programmatically identify the format of a document stream before attempting to process it, making it easier to handle documents of unknown types and providing better error handling in your applications. + +The detector analyzes file signatures, headers, and content patterns to accurately identify document formats including PDF, DOCX, XLSX, RTF, and other supported formats. This is particularly useful when working with user-uploaded files or when processing documents from external sources where the file format might not be immediately known. + +## Key Features + +* **Automatic Format Detection**: Identifies document formats from a stream without requiring file extensions +* **Multiple Format Support**: Detects PDF, DOCX, XLSX, PPTX, RTF, and other document formats +* **Stream-Based**: Works directly with streams, making it compatible with various input sources +* **Error Handling**: Provides detailed error messages when detection fails +* **Lightweight**: Minimal overhead with efficient signature and header analysis + +## API + +**Namespace:** Telerik.Documents.Utilities.Detectors.FileFormat + +### FileFormatDetector + +The main class for detecting file formats. + +| Member | Type | Description | +|--------|------|-------------| +| **Detect(Stream stream)** | Method | Detects the format of a file from a stream. Returns a **FileFormatDetectionResult** containing the detection outcome. | + +### FileFormatDetectionResult + +Represents the result of a file format detection operation. + +| Member | Type | Description | +|--------|------|-------------| +| **IsSuccessful** | Property (bool) | Gets a value indicating whether a specific file format was successfully detected. Returns false if the format is unknown or detection failed. | +| **Format** | Property (DocumentFormatType) | Gets the detected document format type. Returns **DocumentFormatType.Unknown** if detection was unsuccessful. | +| **ErrorMessage** | Property (string) | Gets the error message if detection failed, or null if successful. | + +## Using FileFormatDetector + +The following example demonstrates how to detect the format of a document from a file stream: + + + +## See Also + +* [RadPdfProcessing Overview]({%slug radpdfprocessing-overview%}) +* [RadWordsProcessing Overview]({%slug radwordsprocessing-overview%}) +* [RadSpreadProcessing Overview]({%slug radspreadprocessing-overview%}) diff --git a/distribution-and-licensing/redistributing-telerik-document-processing.md b/distribution-and-licensing/redistributing-telerik-document-processing.md index 27bfca58..f351ad50 100644 --- a/distribution-and-licensing/redistributing-telerik-document-processing.md +++ b/distribution-and-licensing/redistributing-telerik-document-processing.md @@ -38,40 +38,40 @@ For the sake of the example it is assumed that the source distribution ZIP file 2\. Uncomment the following line: -#### __[C#] Before +#### __Before -{{region cs-documentprocessing-protect-source_0}} +```csharp public static bool IsValid() { // Uncomment the following line // return ValidatePassPhrase(); return true; } -{{endregion}} +``` -#### __[C#] After +#### __After -{{region cs-documentprocessing-protect-source_1}} +```csharp public static bool IsValid() { // Uncomment the following line return ValidatePassPhrase(); } -{{endregion}} +``` 3\. Change the ApplicationName constant to match the name of your application: -#### __[C#] Before +#### __Before -{{region cs-documentprocessing-protect-source_2}} +```csharp internal const string ApplicationName = "MyApp"; -{{endregion}} +``` -#### __[C#] After +#### __After -{{region cs-documentprocessing-protect-source_3}} +```csharp internal const string ApplicationName = "Sample Application Name v2.0 (tm)"; -{{endregion}} +``` 4\. Save __AssemblyProtection.cs__ and rebuild. diff --git a/docfx/filterConfig.yml b/docfx/filterConfig.yml new file mode 100644 index 00000000..1a0b81b4 --- /dev/null +++ b/docfx/filterConfig.yml @@ -0,0 +1,4 @@ +apiRules: +- exclude: + type: Method + uidRegex: ^System\.Object\..*$ \ No newline at end of file diff --git a/docfx/metadata-config.json b/docfx/metadata-config.json new file mode 100644 index 00000000..fc7d5498 --- /dev/null +++ b/docfx/metadata-config.json @@ -0,0 +1,32 @@ +{ + "metadata": [{ + "src": [ + { + "files": [ + "src/Telerik.Windows.Documents.Core.dll", + "src/Telerik.Windows.Documents.Fixed.dll", + "src/Telerik.Windows.Documents.Fixed.FormatProviders.Ocr.dll", + "src/Telerik.Windows.Documents.TesseractOcr.dll", + "src/Telerik.Windows.Documents.CMapUtils.dll", + "src/Telerik.Windows.Documents.Flow.dll", + "src/Telerik.Windows.Documents.DrawingML.dll", + "src/Telerik.Windows.Documents.Flow.FormatProviders.Doc.dll", + "src/Telerik.Windows.Documents.Flow.FormatProviders.Pdf.dll", + "src/Telerik.Windows.Documents.Spreadsheet.dll", + "src/Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.dll", + "src/Telerik.Windows.Documents.Spreadsheet.FormatProviders.Xls.dll", + "src/Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.dll", + "src/Telerik.Windows.Documents.Spreadsheet.FormatProviders.Json.dll", + "src/Telerik.Documents.SpreadsheetStreaming.dll", + "src/Telerik.Windows.Documents.AIConnector.dll", + "src/Telerik.Documents.AI.Core.dll", + "src/Telerik.Documents.AI.RAG.dll", + "src/Telerik.Windows.Zip.dll", + "src/Telerik.Windows.Zip.Extensions.dll" + ] + } + ], + "dest": "metadata", + "filter": "filterConfig.yml" + }] +} \ No newline at end of file diff --git a/docs-builder.yml b/docs-builder.yml new file mode 100644 index 00000000..23294935 --- /dev/null +++ b/docs-builder.yml @@ -0,0 +1,463 @@ +top-navigation-product: document-processing +path-prefix: /document-processing-libraries/documentation +default-title-prefix: document-processing-libraries + +primary-color: "#27A306" +product-id: 1886 +product-code: TDP +product-name: Telerik Document Processing +product-url: https://www.telerik.com/document-processing-libraries +product-trial-url: https://www.telerik.com/try/devcraft-ultimate +contribute-url: https://github.com/telerik/document-processing-docs/edit/master +search-engine-id: 001595215763381649090:dzdv3_di-fm +avatar-path: ./images/avatar-ninja.svg +no-results-image-path: ./images/ninja-no-results.svg +enable-tabbed-code-blocks: true +pdf-cover-png-path: ./images/pdf-cover.png +img-max-width: 100% +table-layout: fixed +external-snippets-path: ../dpl-snippets +gitLastCommitDateEnabled: true + +cta-overview: The @Subject is part of @ProductLink, a professional grade .NET library for creating and manipulating PDF, Word, XLSX and HTML files. To try it out sign up for a free 30-day trial. +cta-intro: "Telerik Document Processing is a professional grade .NET library for creating and manipulating PDF, Word, XLSX and HTML files. To try it out sign up for a free 30-day trial." + +# liquid variables +liquid-output-delimiter-left: "{{" +liquid-output-delimiter-right: "}}" +liquid: + mindotnetversion: "8" + maxdotnetversion: "10" + dotnetversions: ".NET 8, .NET 9 and .NET 10" + skiasharpversion: "3.119.1" + harfbuzzsharp: "8.3.1.2" + cryptographypkcs: "9.0.9" + +excluded-files: +- "**/README.md" +- "**/copyright.md" + +meta: + knowledge-base: + title: Knowledge Base + position: 100 + res_type: kb + relativeUrl: /knowledge-base + hideChildren: true + libraries/radziplibrary/features: + title: Features + position: 5 + '*radziplibrary': + title: RadZipLibrary + libraries/radpdfprocessing/editing/table: + title: Table + position: 2 + libraries/radpdfprocessing/model/formsource: + title: FormSource + position: 8 + libraries/radpdfprocessing/model/annotations: + title: Annotations + position: 7 + libraries/radpdfprocessing/concepts: + title: Concepts + position: 5 + libraries/radpdfprocessing/editing: + title: Editing + position: 9 + libraries/radpdfprocessing/formats-and-conversion/convert-to-image: + title: Convert to Image + position: 3 + libraries/radpdfprocessing/formats-and-conversion/plain-text: + title: Plain Text + position: 0 + libraries/radpdfprocessing/formats-and-conversion/pdf/expandablememorystream: + title: ExpandableMemoryStream + position: 3 + libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter: + title: PdfStreamWriter + position: 2 + libraries/radpdfprocessing/formats-and-conversion/pdf/pdfformatprovider: + title: PdfFormatProvider + position: 1 + libraries/radpdfprocessing/formats-and-conversion/pdf: + title: Pdf + position: 0 + libraries/radpdfprocessing/formats-and-conversion/ocr: + title: OCR + position: 2 + libraries/radpdfprocessing/formats-and-conversion: + title: Formats and Conversion + position: 8 + libraries/radpdfprocessing/model/actions/js-actions: + title: Javascript Actions + position: 1 + libraries/radpdfprocessing/model/actions: + title: Actions + position: 7 + libraries/radpdfprocessing/model/interactive-forms/form-fields: + title: Form Fields + libraries/radpdfprocessing/model/interactive-forms: + title: Interactive Forms + libraries/radpdfprocessing/features/gen-ai-powered-document-insights/custom-partialcontextquestionprocessor: + title: Custom PartialContextQuestionProcessor + position: 6 + libraries/radpdfprocessing/features/gen-ai-powered-document-insights/partial-context-question-processor: + title: PartialContextQuestionProcessor + position: 5 + libraries/radpdfprocessing/features/gen-ai-powered-document-insights: + title: GenAI-powered Document Insights + position: 6 + libraries/radpdfprocessing/features/embedded-file-streams: + title: Embedded File Streams + position: 5 + libraries/radpdfprocessing/features/accessibility-support: + title: Accessibility Support + position: 0 + libraries/radpdfprocessing/features/digital-signature: + title: Digital Signature + position: 2 + libraries/radpdfprocessing/features: + title: Features + position: 6 + libraries/radpdfprocessing/model: + title: Model + position: 4 + libraries/radpdfprocessing/cross-platform: + title: Cross-Platform Support + position: 2 + '*radpdfprocessing': + title: RadPdfProcessing + libraries/radspreadprocessing/features/styling: + title: Styling + position: 4 + libraries/radspreadprocessing/features/protection: + title: Protection + position: 3 + libraries/radspreadprocessing/features/formulas: + title: Formulas + position: 2 + libraries/radspreadprocessing/features/fill-data-automatically: + title: Fill Data Automatically + position: 1 + libraries/radspreadprocessing/features/charts: + title: Charts + position: 0 + libraries/radspreadprocessing/features/gen-ai-powered-document-insights/custom-partialcontextquestionprocessor: + title: Custom PartialContextQuestionProcessor + position: 6 + libraries/radspreadprocessing/features/gen-ai-powered-document-insights/partial-context-question-processor: + title: PartialContextQuestionProcessor + position: 5 + libraries/radspreadprocessing/features/gen-ai-powered-document-insights: + title: GenAI-powered Document Insights + position: 7 + libraries/radspreadprocessing/formats-and-conversion/json/jsonexportsettings: + title: JsonExportSettings + position: 2 + libraries/radspreadprocessing/formats-and-conversion/json/jsonformatprovider: + title: JsonFormatProvider + position: 1 + libraries/radspreadprocessing/formats-and-conversion/json: + title: Json + position: 7 + libraries/radspreadprocessing/formats-and-conversion/data-table: + title: DataTable + position: 6 + libraries/radspreadprocessing/formats-and-conversion/txt: + title: Txt + position: 5 + libraries/radspreadprocessing/formats-and-conversion/csv: + title: Csv + position: 4 + libraries/radspreadprocessing/formats-and-conversion/pdf: + title: Pdf + position: 3 + libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsm: + title: Xlsm + position: 3 + libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsx: + title: Xlsx + position: 2 + libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xls: + title: Xls + position: 1 + libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats: + title: Excel File Formats + position: 2 + libraries/radspreadprocessing/formats-and-conversion: + title: Formats and Conversion + position: 10 + libraries/radspreadprocessing/helpers: + title: Helpers + position: 9 + libraries/radspreadprocessing/features: + title: Features + position: 7 + libraries/radspreadprocessing/working-with-cells: + title: Cells + position: 6 + libraries/radspreadprocessing/working-with-rows-and-columns: + title: Rows and Columns + position: 5 + libraries/radspreadprocessing/working-with-worksheets: + title: Worksheets + position: 4 + libraries/radspreadprocessing/working-with-workbooks: + title: Workbooks + position: 3 + libraries/radspreadprocessing/cross-platform-support: + title: Cross-Platform Support + position: 2 + '*radspreadprocessing': + title: RadSpreadProcessing + libraries/radspreadstreamprocessing/features/styling: + title: Styling + position: 0 + libraries/radspreadstreamprocessing/features: + title: Features + position: 4 + libraries/radspreadstreamprocessing/model: + title: Model + position: 3 + '*radspreadstreamprocessing': + title: RadSpreadStreamProcessing + libraries/radwordsprocessing/model/shapes: + title: Shapes + position: 18 + libraries/radwordsprocessing/model/content-controls: + title: Content Controls + position: 17 + libraries/radwordsprocessing/concepts/fields: + title: Fields + position: 0 + libraries/radwordsprocessing/formats-and-conversion/plain-text: + title: Plain text + position: 5 + libraries/radwordsprocessing/formats-and-conversion/pdf: + title: Pdf + position: 4 + libraries/radwordsprocessing/formats-and-conversion/html: + title: Html + position: 3 + libraries/radwordsprocessing/formats-and-conversion/rtf: + title: Rtf + position: 2 + libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx: + title: Docx + position: 2 + libraries/radwordsprocessing/formats-and-conversion/word-file-formats/doc: + title: Doc + position: 1 + libraries/radwordsprocessing/formats-and-conversion/word-file-formats: + title: Word File Formats + position: 1 + libraries/radwordsprocessing/concepts: + title: Concepts + position: 6 + libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/custom-partialcontextquestionprocessor: + title: Custom PartialContextQuestionProcessor + position: 6 + libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/partial-context-question-processor: + title: PartialContextQuestionProcessor + position: 5 + libraries/radwordsprocessing/editing/gen-ai-powered-document-insights: + title: GenAI-powered Document Insights + position: 7 + libraries/radwordsprocessing/editing/find-and-replace: + title: Find and Replace + position: 6 + libraries/radwordsprocessing/editing: + title: Features + position: 5 + libraries/radwordsprocessing/formats-and-conversion: + title: Formats and Conversion + position: 7 + libraries/radwordsprocessing/model: + title: Model + position: 4 + '*radwordsprocessing': + title: RadWordsProcessing + '*howto': + title: How To + position: 100 + '*changes-and-backwards-compatibility': + title: Changes and Backward Compatibility + position: 3 + '*changes-and-backward-compatibility': + title: Changes and Backward Compatibility + position: 3 + '*general-information': + title: General Information + position: 2 + '*getting-started': + title: Getting Started + position: 2 + '*overview': + title: Overview + position: 1 + security: + title: Security + position: 97 + common-information: + title: Common Information + position: 98 + troubleshooting: + title: Troubleshooting + position: 99 + for-more-help: + title: For More Help + position: 10 + libraries: + title: Libraries + position: 8 + integration: + title: Integration + position: 7 + distribution-and-licensing/license-key: + title: License Key + position: 1 + distribution-and-licensing: + title: Distribution and Licensing + position: 6 + upgrade: + title: Upgrade + position: 5 + installation-and-deployment: + title: Installation and Deployment + position: 4 + ai-coding-assistant: + title: AI Coding Assistant + position: 10 + release-notes/2024: + title: "2024" + position: 100 + release-notes/2025: + title: "2025" + position: 99 + release-notes: + title: Release Notes + position: 110 + api: + title: API Reference + position: 100 + +redirects: +- from: "^/?$" + to: "/introduction" + type: Permanent + + +- from: "^/licensing/copyright" + to: "/distribution-and-licensing/license-agreement" + type: Permanent + +- from: "^/licensing/license-agreement" + to: "/distribution-and-licensing/license-agreement" + type: Permanent + +- from: "^/personal-data-collection" + to: "/distribution-and-licensing/license-agreement" + type: Permanent + +- from: "/installation-and-deployment/redistributing-telerik-document-processing" + to: "/distribution-and-licensing/redistributing-telerik-document-processing" + type: Permanent + +- from: "^/licensing/trial-license-limitations" + to: "/distribution-and-licensing/trial-license-limitations" + type: Permanent + +- from: "^/installation/installing-on-your-computer" + to: "/getting-started/installation/installing-on-your-computer" + type: Permanent + +- from: "^/installation-and-deployment/installing-on-your-computer" + to: "/getting-started/installation/installing-on-your-computer" + type: Permanent + +- from: "^/getting-started/installing-on-your-computer" + to: "/getting-started/installation/installing-on-your-computer" + type: Permanent + +- from: "^/pdf-export" + to: "/getting-started/installation/pdf-export" + type: Permanent + +- from: "/installation-and-deployment/system-requirements" + to: "/getting-started/installation/system-requirements" + type: Permanent + +- from: "/installation-and-deployment/integration-with-visual-studio" + to: "/integration/integration-with-visual-studio" + type: Permanent + +- from: "/installation-and-deployment/upgrade-instructions" + to: "/upgrade/upgrade-instructions" + type: Permanent + +- from: "/for-more-help" + to: "/introduction" + type: Permanent + +- from: "/radspreadprocessing/formats-and-conversion/xls/(.*)" + to: "/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xls/$1" + type: Permanent + +- from: "/radspreadprocessing/formats-and-conversion/xlsx/(.*)" + to: "/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsx/$1" + type: Permanent + +- from: "/radwordsprocessing/formats-and-conversion/docx/(.*)" + to: "/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx/$1" + type: Permanent + +- from: "/concepts/hyperlinks" + to: "/libraries/radwordsprocessing/concepts/fields/hyperlink-field" + type: Permanent + +- from: "/libraries/radspreadprocessing/cross-platform$" + to: "/libraries/radspreadprocessing/cross-platform-support/cross-platform" + type: Permanent + +- from: "/libraries/radpdfprocessing/cross-platform$" + to: "/libraries/radpdfprocessing/cross-platform/overview" + type: Permanent + +- from: "/libraries/radpdfprocessing/features/digital-signature$" + to: "/libraries/radpdfprocessing/features/digital-signature/overview" + type: Permanent + +- from: "/libraries/radpdfprocessing/model/interactive-forms/widgets$" + to: "/libraries/radpdfprocessing/model/annotations/widgets" + type: Permanent + +- from: "^/distribution-and-licensing/license-key$" + to: "/distribution-and-licensing/license-key/setting-up-license-key" + type: Permanent + +- from: "^/libraries/radpdfprocessing/model/formsource$" + to: "/libraries/radpdfprocessing/model/formsource/overview" + type: Permanent + +- from: "^/libraries/radpdfprocessing/editing/tablerow$" + to: "/libraries/radpdfprocessing/editing/table/tablerow" + type: Permanent + +- from: "^/libraries/radpdfprocessing/editing/tablecell$" + to: "/libraries/radpdfprocessing/editing/table/tablecell" + type: Permanent + +- from: "^/libraries/radpdfprocessing/editing/table$" + to: "/libraries/radpdfprocessing/editing/table/overview" + type: Permanent + +- from: "^/libraries/radpdfprocessing/features/digital-signature$" + to: "/libraries/radpdfprocessing/features/digital-signature/overview" + type: Permanent + +- from: "^/libraries/radpdfprocessing/howto/comply-with-pdfa-standard$" + to: "/libraries/radpdfprocessing/concepts/comply-with-pdfa-standard" + type: Permanent + + + diff --git a/getting-started/Installation/pdf-export.md b/getting-started/Installation/pdf-export.md index e3b5d4df..6a88d29f 100644 --- a/getting-started/Installation/pdf-export.md +++ b/getting-started/Installation/pdf-export.md @@ -43,9 +43,9 @@ In order to use the **PdfFormatProvider** of **RadWordsProcessing**, you should **Example 1** demonstrates how you can convert an HTML string to a PDF document. The [HtmlFormatProvider]({%slug radwordsprocessing-formats-and-conversion-html-htmlformatprovider%}) and [PdfFormatProvider]({%slug radwordsprocessing-formats-and-conversion-pdf-pdfformatprovider%}) classes of [RadWordsProcessing]({%slug radwordsprocessing-overview%}) are used to import/export the [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}) instance. -#### [C#] Example 1: HTML to PDF conversion +#### Example 1: HTML to PDF conversion -{{region radwordsprocessing-pdf-export_0}} +```csharp string htmlContent = "

Hello, world!

"; @@ -57,7 +57,7 @@ In order to use the **PdfFormatProvider** of **RadWordsProcessing**, you should // Export the document. The different overloads enables you to export to a byte[] or to a Stream. byte[] pdfBytes = pdfProvider.Export(document, TimeSpan.FromSeconds(10)); -{{endregion}} +``` ## Convert a Spreadsheet Document to PDF diff --git a/getting-started/Installation/telerik-nuget-source.md b/getting-started/Installation/telerik-nuget-source.md index 5a5a394d..e447caf3 100644 --- a/getting-started/Installation/telerik-nuget-source.md +++ b/getting-started/Installation/telerik-nuget-source.md @@ -187,7 +187,7 @@ The NuGet v2 server at `https://nuget.telerik.com/nuget` was sunset in November ### Troubleshooting -See the [NuGet Troubleshooting](slug:troubleshooting-nuget) article for tips about common pitfalls when working with the Telerik NuGet feed. +See the [NuGet Troubleshooting]({%slug dpl-troubleshooting-nuget%}) article for tips about common pitfalls when working with the Telerik NuGet feed. ## See Also diff --git a/getting-started/first-steps.md b/getting-started/first-steps.md index e35c97c3..85eb75d5 100644 --- a/getting-started/first-steps.md +++ b/getting-started/first-steps.md @@ -72,21 +72,21 @@ This sample application will use [RadWordsProcessing]({%slug radwordsprocessing- ## Step 4: Create a Document -#### __[C#] Example 1: Create RadFlowDocument__ +#### __Example 1: Create RadFlowDocument__ -{{region cs-radwordsprocessing-getting-started_0}} +```csharp Telerik.Windows.Documents.Flow.Model.RadFlowDocument document = new Telerik.Windows.Documents.Flow.Model.RadFlowDocument(); Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor editor = new Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor(document); editor.InsertText("Hello world!"); -{{endregion}} +``` -#### __[VB.NET] Example 1: Create RadFlowDocument__ +#### __Example 1: Create RadFlowDocument__ -{{region cs-radwordsprocessing-getting-started_0}} +```csharp Dim document As Telerik.Windows.Documents.Flow.Model.RadFlowDocument = New Telerik.Windows.Documents.Flow.Model.RadFlowDocument() Dim editor As Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor = New Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor(document) editor.InsertText("Hello world!") -{{endregion}} +``` ## Step 5: Export the Generated Document @@ -95,48 +95,48 @@ This sample application will use [RadWordsProcessing]({%slug radwordsprocessing- To export the document as a docx file, use [DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%}). Using the below code will create a provider instance and save a document with it. The document will be exported in the bin folder of your current project. -#### __[C#] Example 2: Export RadFlowDocument to DOCX__ +#### __Example 2: Export RadFlowDocument to DOCX__ -{{region cs-radwordsprocessing-getting-started_1}} +```csharp using (Stream output = new FileStream("output.docx", FileMode.OpenOrCreate)) { Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider docxProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider(); docxProvider.Export(document, output); } -{{endregion}} +``` -#### __[VB.NET] Example 2: Export RadFlowDocument to DOCX__ +#### __Example 2: Export RadFlowDocument to DOCX__ -{{region cs-radwordsprocessing-getting-started_0}} +```csharp Using output As Stream = New FileStream("output.docx", FileMode.OpenOrCreate) Dim docxProvider As Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider = New Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider() docxProvider.Export(document, output, TimeSpan.FromSeconds(10)) End Using -{{endregion}} +``` ### Export the RadFlowDocument to PDF To export the document as a PDF file, use [PdfFormatProvider]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfformatprovider%}). __Example 3__ shows how to export the __RadFlowDocument__ created in Examples 1 to a file. -#### __[C#] Example 3: Export RadFlowDocument to PDF__ +#### __Example 3: Export RadFlowDocument to PDF__ -{{region cs-radpdfprocessing-getting-started_2}} +```csharp using (Stream output = File.OpenWrite("Output.pdf")) { Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider flowPdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider(); flowPdfProvider.Export(document, output); } -{{endregion}} +``` -#### __[VB.NET] Example 2: Export RadFlowDocument to PDF__ +#### __Example 2: Export RadFlowDocument to PDF__ -{{region cs-radwordsprocessing-getting-started_0}} +```csharp Using output As Stream = File.OpenWrite("Output.pdf") Dim flowPdfProvider As Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider = New Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider() flowPdfProvider.Export(document, output, TimeSpan.FromSeconds(10)) End Using -{{endregion}} +``` Run the project and you should see something like this: diff --git a/images/avatar-ninja.svg b/images/avatar-ninja.svg new file mode 100644 index 00000000..d98c1b20 --- /dev/null +++ b/images/avatar-ninja.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/ninja-no-results.svg b/images/ninja-no-results.svg new file mode 100644 index 00000000..5d84ade5 --- /dev/null +++ b/images/ninja-no-results.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/pdf-cover.png b/images/pdf-cover.png new file mode 100644 index 00000000..ce9967ef Binary files /dev/null and b/images/pdf-cover.png differ diff --git a/introduction.md b/introduction.md index 3e6c5491..cc5d76e2 100644 --- a/introduction.md +++ b/introduction.md @@ -36,13 +36,36 @@ img[alt$="><"] { Telerik Document Processing features the following libraries: -|Library|Description| -|----|----| -|![Pdf](images/dpl-pdf.png) [RadPdfProcessing]({%slug radpdfprocessing-overview%})|A processing library that allows you to create, import, and export PDF documents from your code. You can use it in any web or desktop .NET application without relying on third-party software like Adobe Acrobat.| -|![Spread](images/dpl-spread.png) [RadSpreadProcessing]({%slug radspreadprocessing-overview%})|A powerful library that enables you to create applications with native support for spreadsheet documents. With RadSpreadProcessing, you can create spreadsheets from scratch, modify existing documents or convert between the most common spreadsheet formats. You can save the generated workbook to a local file, stream, or stream it to the client browser.| -|![SpreadStream](images/dpl-spread.png) [RadSpreadStreamProcessing]({%slug radspreadstreamprocessing-overview%})|Spread streaming is a document processing paradigm that allows you to create or read big spreadsheet documents with great performance and minimal memory footprint. The key for the memory efficiency is that the spread streaming library writes the spreadsheet content directly to a stream without creating and preserving the spreadsheet document model in memory.| -|![Words](images/dpl-words.png) [RadWordsProcessing]({%slug radwordsprocessing-overview%})|A processing library that allows you to create, modify and export documents to a variety of formats. Through the API, you can access each element in the document and modify, remove it or add a new one. The generated content you can save as a stream, as a file, or sent it to the client browser.| -|![Zip](images/dpl-zip.png) [RadZipLibrary]({%slug radziplibrary-overview%})| It allows you to compress and combine files in ZIP archives, browse and extract files from existing ZIP archives and compress streams for easy file shipping and reduced storage space.| +* [RadPdfProcessing]({%slug radpdfprocessing-overview%}) + + ||| + |----|----| + |![Pdf](images/dpl-pdf.png)|A processing library that allows you to create, import, and export PDF documents from your code. You can use it in any web or desktop .NET application without relying on third-party software like Adobe Acrobat.| + +* [RadSpreadProcessing]({%slug radspreadprocessing-overview%}) + + ||| + |----|----| + |![Spread](images/dpl-spread.png)| A powerful library that enables you to create applications with native support for spreadsheet documents. With RadSpreadProcessing, you can create spreadsheets from scratch, modify existing documents or convert between the most common spreadsheet formats. You can save the generated workbook to a local file, stream, or stream it to the client browser.| + +* [RadSpreadStreamProcessing]({%slug radspreadstreamprocessing-overview%}) + + ||| + |----|----| + |![SpreadStream](images/dpl-spread.png)|Spread streaming is a document processing paradigm that allows you to create or read big spreadsheet documents with great performance and minimal memory footprint. The key for the memory efficiency is that the spread streaming library writes the spreadsheet content directly to a stream without creating and preserving the spreadsheet document model in memory. | + +* [RadWordsProcessing]({%slug radwordsprocessing-overview%}) + + ||| + |----|----| + |![Words](images/dpl-words.png)|A processing library that allows you to create, modify and export documents to a variety of formats. Through the API, you can access each element in the document and modify, remove it or add a new one. The generated content you can save as a stream, as a file, or sent it to the client browser.| + + +* [RadZipLibrary]({%slug radziplibrary-overview%}) + + ||| + |----|----| + |![Zip](images/dpl-zip.png)|It allows you to compress and combine files in ZIP archives, browse and extract files from existing ZIP archives and compress streams for easy file shipping and reduced storage space.| ## Key Features diff --git a/knowledge-base/add-html-to-pdf-document.md b/knowledge-base/add-html-to-pdf-document.md index a0a0c6ff..7028841f 100644 --- a/knowledge-base/add-html-to-pdf-document.md +++ b/knowledge-base/add-html-to-pdf-document.md @@ -33,11 +33,7 @@ You have an HTML that needs to be converted to PDF or added to an existing docum ## Solution You can use the WordsProcessing library to convert the content to a RadFlowDocument and then insert it to the existing document along with other content. -#### __C#__ - -{{region kb-convert-html-to-pdf}} - -```c# +```csharp HtmlFormatProvider provider = new HtmlFormatProvider(); var htmlConteont = provider.Import(File.ReadAllText(@"..\..\HtmlPage1.html")); @@ -58,8 +54,6 @@ var pdfBytes = pdfFProvider.Export(document); File.WriteAllBytes("result.pdf", pdfBytes); ``` -{{endregion}} - # See Also * [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}) diff --git a/knowledge-base/archive-a-list-of-files.md b/knowledge-base/archive-a-list-of-files.md index 502ceeff..72cce4d5 100644 --- a/knowledge-base/archive-a-list-of-files.md +++ b/knowledge-base/archive-a-list-of-files.md @@ -21,9 +21,7 @@ You need to create an archive from a list of files. Use [RadZipLibrary]({%slug radziplibrary-overview%}) to create and export the archive. -#### __C#__ - -{{region kb-archive-a-list-of-files1}} +```csharp List fileNames = new List(); fileNames.Add("text.txt"); @@ -52,4 +50,4 @@ Use [RadZipLibrary]({%slug radziplibrary-overview%}) to create and export the ar } } -{{endregion}} \ No newline at end of file +``` \ No newline at end of file diff --git a/knowledge-base/before-q2-2025.md b/knowledge-base/before-q2-2025.md index bc1f0afd..c413a789 100644 --- a/knowledge-base/before-q2-2025.md +++ b/knowledge-base/before-q2-2025.md @@ -9,7 +9,7 @@ published: True position: 4 --- -# Licensing before 2025 +## Licensing before 2025 [Telerik Document Processing]({%slug introduction%}) used to come in separate **Trial** and **Developer** (or commercial) assets distribution until Q2 2025. diff --git a/knowledge-base/change-cells-contennt.md b/knowledge-base/change-cells-contennt.md index 13b11539..9436b4aa 100644 --- a/knowledge-base/change-cells-contennt.md +++ b/knowledge-base/change-cells-contennt.md @@ -20,9 +20,9 @@ You have a template that contains a table and you need to get this particular ta To get all tables you can use the __EnumerateChildrenOfType__ method, then you can iterate the table and populate the cells with data. -#### __C# Iterate table Cells and add content__ +#### __Iterate table Cells and add content__ -{{region kb-change-cells-content_0}} +```csharp var provider = new DocxFormatProvider(); var document = provider.Import(File.ReadAllBytes("template.docx")); @@ -60,4 +60,4 @@ To get all tables you can use the __EnumerateChildrenOfType__ method, then you c var bytes = provider.Export(document); File.WriteAllBytes("result.docx", bytes); -{{endregion}} \ No newline at end of file +``` \ No newline at end of file diff --git a/knowledge-base/change-properties-when-converting-flow-to-pdf.md b/knowledge-base/change-properties-when-converting-flow-to-pdf.md index 8d232393..5f9bb950 100644 --- a/knowledge-base/change-properties-when-converting-flow-to-pdf.md +++ b/knowledge-base/change-properties-when-converting-flow-to-pdf.md @@ -21,9 +21,9 @@ The [RadWordsProcessing]({%slug radwordsprocessing-overview%}) library allows yo Change the properties of the RadFlowDocument. -#### __C# Change the RadFlowDocument properties while exporting.__ +#### __Change the RadFlowDocument properties while exporting.__ -{{region change-properties-when-converting-flow-to-pdf1}} +```csharp HtmlFormatProvider htmlProvider = new HtmlFormatProvider(); RadFlowDocument document = htmlProvider.Import(html); @@ -40,7 +40,5 @@ Change the properties of the RadFlowDocument. { pdfProvider.Export(document, output); } - - -{{endregion}} +``` diff --git a/knowledge-base/convert-csv-to-xlsx.md b/knowledge-base/convert-csv-to-xlsx.md index 63507d06..ac2d7b2f 100644 --- a/knowledge-base/convert-csv-to-xlsx.md +++ b/knowledge-base/convert-csv-to-xlsx.md @@ -21,9 +21,9 @@ The below example shows how you can easily convert a CSV file to XLSX format. Use the [SpreadProcessing]({%slug radspreadprocessing-overview%}) library to convert the file. -#### __C# Convert CSV to XLSX__ +#### __Convert CSV to XLSX__ -{{region kb-convert-to-xlsx1}} +```csharp static void Main(string[] args) { string fileName = @"..\\..\FileName.csv"; @@ -53,5 +53,5 @@ Use the [SpreadProcessing]({%slug radspreadprocessing-overview%}) library to con System.Diagnostics.Process.Start(resultFile); } -{{endregion}} +``` diff --git a/knowledge-base/convert-docx-to-pdf.md b/knowledge-base/convert-docx-to-pdf.md index 5d4ca9c8..b779dbbc 100644 --- a/knowledge-base/convert-docx-to-pdf.md +++ b/knowledge-base/convert-docx-to-pdf.md @@ -21,9 +21,9 @@ This article demonstrates how you can convert a Docx file to a PDF with the [Wor The solution is to import the file with the DocxFormatProvider and export it with the PdfFormatProvider. -#### [C#] Convert Docx to PDF +#### Convert Docx to PDF -{{region kb-convert-docx-topdf1}}. +```csharp. public static void ConverDocxToPdf(string path, string resultPath) { @@ -37,5 +37,5 @@ The solution is to import the file with the DocxFormatProvider and export it wit File.WriteAllBytes(resultPath, resultBytes); } -{{endregion}} +``` diff --git a/knowledge-base/convert-excel-content-to-word-document.md b/knowledge-base/convert-excel-content-to-word-document.md index 02074cfa..31dfe245 100644 --- a/knowledge-base/convert-excel-content-to-word-document.md +++ b/knowledge-base/convert-excel-content-to-word-document.md @@ -7,7 +7,7 @@ slug: convert-excel-content-to-word-document tags: conversion, excel, word, snippet, image, insert, SpreadProcessing, WordsProcessing, xlsx, docx res_type: kb --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2024.1.124 | Document Processing Libraries (.NET Standard)|[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| diff --git a/knowledge-base/convert-to-pdf.md b/knowledge-base/convert-to-pdf.md index 303bd654..c9e3c2e8 100644 --- a/knowledge-base/convert-to-pdf.md +++ b/knowledge-base/convert-to-pdf.md @@ -48,7 +48,7 @@ In scenarios where you need to convert a document from another file format to PD ### Convert DOCX to PDF -````C# +```csharp Telerik.Windows.Documents.Flow.Model.RadFlowDocument flowDocument; using (Stream input = File.OpenRead("sample.docx")) { @@ -61,13 +61,13 @@ In scenarios where you need to convert a document from another file format to PD // Export the document. The different overloads enables you to export to a byte[] or to a Stream. byte[] pdfBytes = pdfProvider.Export(flowDocument); -```` +``` ### Convert DOC to PDF -````C# +```csharp Telerik.Windows.Documents.Flow.Model.RadFlowDocument flowDocument; using (Stream input = File.OpenRead("sample.doc")) { @@ -80,13 +80,13 @@ In scenarios where you need to convert a document from another file format to PD // Export the document. The different overloads enables you to export to a byte[] or to a Stream. byte[] pdfBytes = pdfProvider.Export(flowDocument); -```` +``` ### Convert HTML to PDF -````C# +```csharp string htmlContent = "

Hello, world!

"; Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider htmlProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider(); @@ -97,11 +97,11 @@ In scenarios where you need to convert a document from another file format to PD // Export the document. The different overloads enables you to export to a byte[] or to a Stream. byte[] pdfBytes = pdfProvider.Export(flowDocument); -```` +``` ### Convert RTF to PDF -````C# +```csharp Telerik.Windows.Documents.Flow.Model.RadFlowDocument flowDocument; using (Stream input = File.OpenRead("sample.rtf")) { @@ -114,12 +114,12 @@ In scenarios where you need to convert a document from another file format to PD // Export the document. The different overloads enables you to export to a byte[] or to a Stream. byte[] pdfBytes = pdfProvider.Export(flowDocument); -```` +``` ### Convert Plain text to PDF -````C# +```csharp Telerik.Windows.Documents.Flow.Model.RadFlowDocument flowDocument; string text = "Hello, WordsProcessing!"; Telerik.Windows.Documents.Flow.FormatProviders.Txt.TxtFormatProvider provider = new Telerik.Windows.Documents.Flow.FormatProviders.Txt.TxtFormatProvider(); @@ -130,7 +130,7 @@ In scenarios where you need to convert a document from another file format to PD // Export the document. The different overloads enables you to export to a byte[] or to a Stream. byte[] pdfBytes = pdfProvider.Export(flowDocument); -```` +``` ## Convert a Spreadsheet Document to PDF @@ -143,7 +143,7 @@ While the so far discussed libraries allow working with text documents, with **S ### Convert XLSX to PDF -````C# +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook; using (Stream input = File.OpenRead("sample.xlsx")) { @@ -156,11 +156,11 @@ While the so far discussed libraries allow working with text documents, with **S // Export the document. The different overloads enables you to export to a byte[] or to a Stream. byte[] pdfBytes = pdfProvider.Export(workbook); -```` +``` ### Convert XLS to PDF -````C# +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook; using (Stream input = File.OpenRead("sample.xls")) { @@ -174,11 +174,11 @@ While the so far discussed libraries allow working with text documents, with **S // Export the document. The different overloads enables you to export to a byte[] or to a Stream. byte[] pdfBytes = pdfProvider.Export(workbook); -```` +``` ### Convert CSV to PDF -````C# +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook; using (Stream input = File.OpenRead("sample.csv")) { @@ -191,11 +191,11 @@ While the so far discussed libraries allow working with text documents, with **S // Export the document. The different overloads enables you to export to a byte[] or to a Stream. byte[] pdfBytes = pdfProvider.Export(workbook); -```` +``` ### Convert DataTable to PDF -````C# +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook; using (Stream input = File.OpenRead("sample.csv")) { @@ -209,7 +209,7 @@ While the so far discussed libraries allow working with text documents, with **S // Export the document. The different overloads enables you to export to a byte[] or to a Stream. byte[] pdfBytes = pdfProvider.Export(workbook); -```` +``` ## See Also diff --git a/knowledge-base/convert-xlsx-to-pdf.md b/knowledge-base/convert-xlsx-to-pdf.md index 2dc2f0fc..c2ef184b 100644 --- a/knowledge-base/convert-xlsx-to-pdf.md +++ b/knowledge-base/convert-xlsx-to-pdf.md @@ -21,9 +21,9 @@ This article demonstrates how you can convert a Xlsx file to a PDF with the [Sp The solution is to import the file with the XlsxFormatProvider and export it with the PdfFormatProvider. -#### [C#] Convert Xlsx to PDF +#### Convert Xlsx to PDF -{{region kb-convert-xlsx-topdf1}} +```csharp public static void ConvertXlsxToPdf(string path, string resultPath) { @@ -37,5 +37,5 @@ The solution is to import the file with the XlsxFormatProvider and export it wit File.WriteAllBytes(resultPath, resultBytes); } -{{endregion}} +``` diff --git a/knowledge-base/create-custom-image-bullets.md b/knowledge-base/create-custom-image-bullets.md index 5b988b12..7666a88c 100644 --- a/knowledge-base/create-custom-image-bullets.md +++ b/knowledge-base/create-custom-image-bullets.md @@ -34,9 +34,7 @@ How to create a custom [ListLevel](https://docs.telerik.com/devtools/document-pr This functionality could be achieved by creating a custom class implementing [IBulletNumberingFormat](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Lists.IBulletNumberingFormat.html) and passing it to [BulletNumberingFormat](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Lists.ListLevel.html#collapsible-Telerik_Windows_Documents_Fixed_Model_Editing_Lists_ListLevel_BulletNumberingFormat) property of the [ListLevel](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Lists.ListLevel.html) class. -#### __[C#]__ - -{{region kb-create-custom-image-bullets1}} +```csharp RadFixedDocument document = new RadFixedDocument(); @@ -61,11 +59,11 @@ This functionality could be achieved by creating a custom class implementing [IB RadFixedDocumentEditor editor = new RadFixedDocumentEditor(document); editor.InsertTable(table); -{{endregion}} +``` -#### __[C#] Create custom image numbering bullet__ +#### __Create custom image numbering bullet__ -{{region kb-create-custom-image-bullets2}} +```csharp private List GetCustomBullet() { @@ -98,11 +96,11 @@ This functionality could be achieved by creating a custom class implementing [IB return list; } -{{endregion}} +``` -#### __[C#] Creating a custom class implementing IBulletNumberingFormat__ +#### __Creating a custom class implementing IBulletNumberingFormat__ -{{region kb-create-custom-image-bullets2}} +```csharp internal class CustomBullet : IBulletNumberingFormat { @@ -120,4 +118,4 @@ This functionality could be achieved by creating a custom class implementing [IB } } -{{endregion}} +``` diff --git a/knowledge-base/create-custom-image-properties-resolver-net-standard.md b/knowledge-base/create-custom-image-properties-resolver-net-standard.md index f3b5eaee..14b96158 100644 --- a/knowledge-base/create-custom-image-properties-resolver-net-standard.md +++ b/knowledge-base/create-custom-image-properties-resolver-net-standard.md @@ -41,7 +41,7 @@ res_type: kb The following code snippets demonstrate how to create a custom implementation of the ImagePropertiesResolver abstract class using the [SixLabors.ImageSharp](https://github.com/SixLabors/ImageSharp) (2.0.0) library and set it to the **ImagePropertiesResolver** property of the **FixedExtensibilityManager**. -#### __[C#] Create a custom implementation inheriting the ImagePropertiesResolverBase abstract class__ +#### __Create a custom implementation inheriting the ImagePropertiesResolverBase abstract class__ ```csharp @@ -186,7 +186,7 @@ public class ImagePropertiesResolver : ImagePropertiesResolverBase ``` -#### __[C#] Set the custom implementation to the ImagePropertiesResolver property of the FixedExtensibilityManager__ +#### __Set the custom implementation to the ImagePropertiesResolver property of the FixedExtensibilityManager__ ```csharp diff --git a/knowledge-base/create-custom-jpeg-image-converter-net-standard.md b/knowledge-base/create-custom-jpeg-image-converter-net-standard.md index 98e75b8d..96583be9 100644 --- a/knowledge-base/create-custom-jpeg-image-converter-net-standard.md +++ b/knowledge-base/create-custom-jpeg-image-converter-net-standard.md @@ -40,9 +40,9 @@ res_type: kb The following code snippets demonstrate how to create a custom implementation of the JpegImageConverterBase abstract class using the [SixLabors.ImageSharp](https://github.com/SixLabors/ImageSharp) library and set it to the JpegImageConverter property of the FixedExtensibilityManager. We are using the ImageSharp library to convert the images from one of the library's supported formats to Jpeg and to change their quality if it is set. Note that this approach is valid up to version 2023.1.410 of RadPdfProcessing. -#### __[C#] Create a custom implementation inheriting the JpegImageConverterBase abstract class__ +#### __Create a custom implementation inheriting the JpegImageConverterBase abstract class__ -{{region kb-create-custom-jpeg-image-converter1}} +```csharp public class CustomJpegImageConverter : JpegImageConverterBase { @@ -89,11 +89,11 @@ The following code snippets demonstrate how to create a custom implementation of } } -{{endregion}} +``` -#### __[C#] Set the custom implementation to the JpegImageConverter property of the FixedExtensibilityManager__ +#### __Set the custom implementation to the JpegImageConverter property of the FixedExtensibilityManager__ -{{region kb-create-custom-jpeg-image-converter2}} +```csharp JpegImageConverterBase customJpegImageConverter = new CustomJpegImageConverter(); FixedExtensibilityManager.JpegImageConverter = customJpegImageConverter; @@ -123,7 +123,7 @@ The following code snippets demonstrate how to create a custom implementation of Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true }); -{{endregion}} +``` # See Also diff --git a/knowledge-base/create-custom-predefined-cmaps-provider.md b/knowledge-base/create-custom-predefined-cmaps-provider.md index d2a80fee..b7c0f018 100644 --- a/knowledge-base/create-custom-predefined-cmaps-provider.md +++ b/knowledge-base/create-custom-predefined-cmaps-provider.md @@ -35,9 +35,9 @@ How to create a custom implementation of the [PredefinedCMapsProviderBase](https This functionality could be achieved by creating a custom class inheriting the [PredefinedCMapsProviderBase](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.extensibility.predefinedcmapsproviderbase) and passing it to [PredefinedCMapsProvider](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.cmaputils.predefinedcmapsprovider) property of the [FixedExtensibilityManager](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.extensibility.fixedextensibilitymanager) class. -#### __[C#] Creating a custom class inheriting PredefinedCMapsProviderBase__ +#### __Creating a custom class inheriting PredefinedCMapsProviderBase__ -{{region kb-create-custom-predefined-cmaps-provider1}} +```csharp internal class CustomPredefinedCMapsProvider : PredefinedCMapsProviderBase { @@ -64,12 +64,12 @@ This functionality could be achieved by creating a custom class inheriting the [ } } -{{endregion}} +``` -#### __[C#] Set the custom PredefinedCMapsProvider the FixedExtensibilityManager.PredefinedCMapsProvider__ +#### __Set the custom PredefinedCMapsProvider the FixedExtensibilityManager.PredefinedCMapsProvider__ -{{region kb-create-custom-predefined-cmaps-provider2}} +```csharp FixedExtensibilityManager.PredefinedCMapsProvider = new CustomPredefinedCMapsProvider(new PredefinedCMapsProvider()); -{{endregion}} +``` diff --git a/knowledge-base/create-custom-text-measurer-net-standard.md b/knowledge-base/create-custom-text-measurer-net-standard.md index fa8f6345..baa74164 100644 --- a/knowledge-base/create-custom-text-measurer-net-standard.md +++ b/knowledge-base/create-custom-text-measurer-net-standard.md @@ -34,9 +34,9 @@ Due to **.NET Standard** APIs limitations, the _SimpleTextMeasurer_ provides bas In the example below, we are demonstrating how to create a custom [TextMeasurer](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.core.textmeasurer) inheriting the _SpreadTextMeasurerBase_ abstract class and set it to the _TextMeasurer_ property of the _SpreadExtensibilityManager_. -#### __[C#] Creating a CustomTextMeasurer__ +#### __Creating a CustomTextMeasurer__ -{{region kb-create-custom-text-measurer-net-standard1}} +```csharp public class CustomTextMeasurer : SpreadTextMeasurerBase { @@ -79,17 +79,17 @@ In the example below, we are demonstrating how to create a custom [TextMeasurer] }; } } -{{endregion}} +``` The following example shows how to set the custom implementation inheriting the SpreadTextMeasurerBase abstract class to the TextMeasurer property of the SpreadExtensibilityManager. -#### __[C#] Setting the CustomTextMeasurer__ +#### __Setting the CustomTextMeasurer__ -{{region kb-create-custom-text-measurer-net-standard2}} +```csharp SpreadTextMeasurerBase customTextMeasurer = new CustomTextMeasurer(SpreadExtensibilityManager.TextMeasurer); SpreadExtensibilityManager.TextMeasurer = customTextMeasurer; -{{endregion}} +``` ## See Also * [How to Measure Text in WordsProcessing .NET Framework]({%slug wordsprocessing-measure-text-netframework%}) diff --git a/knowledge-base/create-dashed-line-border-table-radpdfprocessing.md b/knowledge-base/create-dashed-line-border-table-radpdfprocessing.md index 7f34e9a5..a7bfeb55 100644 --- a/knowledge-base/create-dashed-line-border-table-radpdfprocessing.md +++ b/knowledge-base/create-dashed-line-border-table-radpdfprocessing.md @@ -7,17 +7,17 @@ slug: create-dashed-line-border-table-radpdfprocessing tags: pdfprocessing, table, border, dash, line res_type: kb --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2024.1.124 | RadPdfProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| -# Description +## Description Learn how to add a dashed line border in a table using [RadPdfProcessing]({%slug radpdfprocessing-overview%}). -# Solution +## Solution To create a dashed line border for a [Table]({%slug radpdfprocessing-editing-table-overview%}) in RadPdfProcessing, you can follow these steps: 1. Set the desired font style properties for the table. @@ -26,7 +26,7 @@ To create a dashed line border for a [Table]({%slug radpdfprocessing-editing-tab 4. Set the `Padding` property of the table's `DefaultCellProperties` to the desired padding values. 5. Add rows and cells to the table and set the preferred width for each cell. 6. Insert text into each cell using the desired font style properties. -7. Use a [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}}) to draw the table on the document page. +7. Use a [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) to draw the table on the document page. 8. Specify the desired dashed line style by setting the `StrokeDashArray` property of the `GraphicProperties` of the `FixedContentEditor`. Here is a sample code snippet that demonstrates how to create a dashed line border for a table in RadPdfProcessing: diff --git a/knowledge-base/create-pdf-document-with-logo-and-text-using-fixedcontenteditor.md b/knowledge-base/create-pdf-document-with-logo-and-text-using-fixedcontenteditor.md index e2c65364..a6d3c3d6 100644 --- a/knowledge-base/create-pdf-document-with-logo-and-text-using-fixedcontenteditor.md +++ b/knowledge-base/create-pdf-document-with-logo-and-text-using-fixedcontenteditor.md @@ -7,16 +7,16 @@ slug: create-pdf-document-with-logo-and-text-using-fixedcontenteditor tags: pdf, fixedcontenteditor, editor, logo, image, text res_type: kb --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2024.1.124 | RadPdfProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| -# Description +## Description This tutorial demonstrates a sample approach how to create a PDF document from scratch that contains a logo and text. -# Solution +## Solution The powerful [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) allows you draw any element at the desired [Position]({%slug radpdfprocessing-concepts-position%}): diff --git a/knowledge-base/creating-colored-squares-radflowdocument.md b/knowledge-base/creating-colored-squares-radflowdocument.md index 0903178e..de0dd710 100644 --- a/knowledge-base/creating-colored-squares-radflowdocument.md +++ b/knowledge-base/creating-colored-squares-radflowdocument.md @@ -7,7 +7,7 @@ slug: creating-colored-squares-radflowdocument tags: radflowdocument, colored-square, border, telerik-document-processing res_type: kb --- -# Environment +## Environment | Version | Product | Author | | ---- | ---- | ---- | diff --git a/knowledge-base/cs0104-error-pdf-format-provider.md b/knowledge-base/cs0104-error-pdf-format-provider.md index c4240ec7..3c233dcf 100644 --- a/knowledge-base/cs0104-error-pdf-format-provider.md +++ b/knowledge-base/cs0104-error-pdf-format-provider.md @@ -24,13 +24,13 @@ When using the **PdfFormatProvider** in your project, you may encounter one of t Usually, such an error may occur when the following **using** statements are imported: -````C# +```csharp using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf; using Telerik.Windows.Documents.Flow.FormatProviders.Pdf; using Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf; PdfFormatProvider provider = PdfFormatProvider(); -```` +``` ## Solution @@ -45,21 +45,21 @@ Telerik Document Processing Libraries offer PdfFormatProvider which makes it eas Explicitly specify the namespace when declaring the **PdfFormatProvider** object based on your specific requirement: - If you are working with **RadSpreadProcessing**, use the following namespace: -````C# +```csharp Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider provider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider(); -```` +``` - If you are working with **RadWordsProcessing**, use the following namespace: -````C# +```csharp Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider provider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider(); -```` +``` - If you are working with **RadPdfProcessing**, use the following namespace: -````C# +```csharp Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider provider = new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider(); -```` +``` By explicitly specifying the namespace, you ensure that the correct `PdfFormatProvider` is used and avoid ambiguous reference errors. diff --git a/knowledge-base/dpl-troubleshooting-nuget.md b/knowledge-base/dpl-troubleshooting-nuget.md index e6a9d3cb..3cc83b89 100644 --- a/knowledge-base/dpl-troubleshooting-nuget.md +++ b/knowledge-base/dpl-troubleshooting-nuget.md @@ -15,7 +15,7 @@ ticketid: 1671187 | --- | --- | ---- | | N/A| Telerik Document Processing Libraries|[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| -# Troubleshooting Telerik NuGet +## Troubleshooting Telerik NuGet This article provides solutions to common issues that you may observe when working with the Telerik NuGet server and the NuGet packages that it provides. diff --git a/knowledge-base/draw-chart-with-fixedcontenteditor.md b/knowledge-base/draw-chart-with-fixedcontenteditor.md index 2824cf7c..54458c67 100644 --- a/knowledge-base/draw-chart-with-fixedcontenteditor.md +++ b/knowledge-base/draw-chart-with-fixedcontenteditor.md @@ -7,16 +7,16 @@ slug: draw-chart-with-fixedcontenteditor tags: pdfprocessing, chart, draw, pdf, fixedcontenteditor res_type: kb --- -# Environment +## Environment | Version | Product | Author | | ---- | ---- | ---- | | 2024.1.124 | RadPdfProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| -# Description +## Description This article demonstrates a sample solution how to draw a chart in PdfProcessing. -# Solution +## Solution The powerful [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) allows you to draw a simulation of a chart element at the desired [Position]({%slug radpdfprocessing-concepts-position%}): diff --git a/knowledge-base/export-radfixedpage-to-image.md b/knowledge-base/export-radfixedpage-to-image.md index 3ed25f4e..33d85549 100644 --- a/knowledge-base/export-radfixedpage-to-image.md +++ b/knowledge-base/export-radfixedpage-to-image.md @@ -42,8 +42,8 @@ To achieve this we can use the [RadPdfViewer](https://docs.telerik.com/devtools/ q >note The COM threading model for the application has to be a single-threaded apartment (STA). A STAThreadAttribute tag "[STAThread]" should be placed on the class. -#### __[C#] Assemblies version bellow 2020.2.513__ -{{region kb-export-radfixedpage-to-image1}} +#### __Assemblies version bellow 2020.2.513__ +```csharp [STAThread] private static void Main(string[] args) @@ -85,10 +85,10 @@ To achieve this we can use the [RadPdfViewer](https://docs.telerik.com/devtools/ } } -{{endregion}} +``` -#### __[C#] Assemblies version 2020.2.513 or above__ -{{region kb-export-radfixedpage-to-image2}} +#### __Assemblies version 2020.2.513 or above__ +```csharp [STAThread] private static void Main(string[] args) @@ -123,4 +123,4 @@ To achieve this we can use the [RadPdfViewer](https://docs.telerik.com/devtools/ } } -{{endregion}} +``` diff --git a/knowledge-base/extract-text-specific-rectangle-pdf-radpdfprocessing.md b/knowledge-base/extract-text-specific-rectangle-pdf-radpdfprocessing.md index cc29af3f..3f19b6fc 100644 --- a/knowledge-base/extract-text-specific-rectangle-pdf-radpdfprocessing.md +++ b/knowledge-base/extract-text-specific-rectangle-pdf-radpdfprocessing.md @@ -65,6 +65,6 @@ The detected text is printed in the Output console: ## See Also -- [RadPdfProcessing Documentation]({%slug radpdfprocessing-overview%}}) -- [TextFragment]({%slug radpdfprocessing-model-textfragment%}}) +- [RadPdfProcessing Documentation]({%slug radpdfprocessing-overview%}) +- [TextFragment]({%slug radpdfprocessing-model-textfragment%}) - [MatrixPosition]({%slug radpdfprocessing-concepts-position%}) diff --git a/knowledge-base/fit-multiline-text-stamp-annotation-radpdfprocessing.md b/knowledge-base/fit-multiline-text-stamp-annotation-radpdfprocessing.md index c586652e..f0f64603 100644 --- a/knowledge-base/fit-multiline-text-stamp-annotation-radpdfprocessing.md +++ b/knowledge-base/fit-multiline-text-stamp-annotation-radpdfprocessing.md @@ -36,7 +36,7 @@ To fit multiline text inside a stamp rectangle: Below is a complete example demonstrating these steps. -#### [C#] Measure and Fit Multiline Text in a StampAnnotation +#### Measure and Fit Multiline Text in a StampAnnotation ```csharp using System; diff --git a/knowledge-base/fix-winforms-runtime-dpi-aware-application.md b/knowledge-base/fix-winforms-runtime-dpi-aware-application.md index ba1bd449..4949a6c3 100644 --- a/knowledge-base/fix-winforms-runtime-dpi-aware-application.md +++ b/knowledge-base/fix-winforms-runtime-dpi-aware-application.md @@ -33,7 +33,7 @@ With this approach your app will look smaller when started. It will not look blu This approach works only on Windows 10. If you intend to use your application on machines where the DPI scaling is larger than 100 percent, you should explicitly set the application to be DPI-unaware -#### [C#] Force process DPI unaware before using a Document Processing type +#### Force process DPI unaware before using a Document Processing type ```csharp private void workbookTestButton_Click(object sender, EventArgs e) diff --git a/knowledge-base/flatten-form-fields.md b/knowledge-base/flatten-form-fields.md index 32cd58fb..e454b626 100644 --- a/knowledge-base/flatten-form-fields.md +++ b/knowledge-base/flatten-form-fields.md @@ -36,9 +36,7 @@ How to flatten [Form Fields]({%slug radpdfprocessing-model-interactive-forms-for This could be achieved by iterating the [RadFixedPage]({%slug radpdfprocessing-model-radfixedpage%})`s [Annotations]({%slug radpdfprocessing-model-annotations-overview%}) and if the type of the annotation is [Widget]({%slug radpdfprocessing-model-annotations-widgets%}) to flatten its appearance. -#### __C#__ - -{{region kb-flatten-form-fields1}} +```csharp public static void FlattenFormFields(RadFixedDocument document) { @@ -139,4 +137,4 @@ This could be achieved by iterating the [RadFixedPage]({%slug radpdfprocessing-m return widgetAppearance; } -{{endregion}} +``` diff --git a/knowledge-base/generate-table-with-images-pdf-processing.md b/knowledge-base/generate-table-with-images-pdf-processing.md index ac95ca25..9e997115 100644 --- a/knowledge-base/generate-table-with-images-pdf-processing.md +++ b/knowledge-base/generate-table-with-images-pdf-processing.md @@ -8,16 +8,16 @@ tags: radpdfprocessing, radfixeddocument, image, height, width, retain res_type: kb --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2024.1.124 | RadPdfProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| -# Description +## Description Learn how to create a PDF document containing a [Table]({%slug radpdfprocessing-editing-table-overview%}) with [images]({%slug radpdfprocessing-model-image%}). -# Solution +## Solution [RadPdfProcessing]({%slug radpdfprocessing-overview%}) is suitable for such a requirement and it allows a convenient API for creating a RadFixedDocument from scratch and populating a table with image content: @@ -81,7 +81,7 @@ Here is an example of how to implement this solution: ![Table with Images](images/pdf-table-with-images.png) # See Also -- [RadPdfProcessing]({%slug radpdfprocessing-overview%}}) +- [RadPdfProcessing]({%slug radpdfprocessing-overview%}) - [Table]({%slug radpdfprocessing-editing-table-overview%}) - [Images]({%slug radpdfprocessing-model-image%}) diff --git a/knowledge-base/how-to-fit-graphics-to-frames.md b/knowledge-base/how-to-fit-graphics-to-frames.md index 0b327e45..ec334b45 100644 --- a/knowledge-base/how-to-fit-graphics-to-frames.md +++ b/knowledge-base/how-to-fit-graphics-to-frames.md @@ -40,9 +40,9 @@ This functionality could be achieved by using the [FixedContentEditor](https://d * Fit Frame to Content The following example demonstrates how to fit the image in a square without changing the image sides aspect ratio. -#### __[C#] Fit Content Proportionally__ +#### __Fit Content Proportionally__ -{{region kb-how-to-fit-graphics-to-frames1}} +```csharp double squareSide = 90; @@ -63,12 +63,12 @@ The following example demonstrates how to fit the image in a square without chan } } -{{endregion}} +``` The following example demonstrates how to stretch the image in a square (the image aspect ratio is changed). -#### __[C#] Fit Content To Frame__ +#### __Fit Content To Frame__ -{{region kb-how-to-fit-graphics-to-frames2}} +```csharp double squareSide = 90; @@ -82,12 +82,12 @@ The following example demonstrates how to stretch the image in a square (the ima editor.DrawBlock(block); } -{{endregion}} +``` The following example demonstrates how to crop the image in order to fill a square without changing the image aspect ratio. -#### __[C#] Fill Frame Proportionally__ +#### __Fill Frame Proportionally__ -{{region kb-how-to-fit-graphics-to-frames3}} +```csharp double squareSide = 90; @@ -126,15 +126,15 @@ The following example demonstrates how to crop the image in order to fill a squa } } -{{endregion}} +``` In the last scenario, we are finding the smallest side of the image and use it to calculate the factor which we are using to scale the position. After that, we are calculating the offset that we are going to use to create an image [Clipping](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/concepts/clipping) with the desired size. The following example demonstrates how to insert an image in its original size. -#### __[C#] Fit Frame to Content__ +#### __Fit Frame to Content__ -{{region kb-how-to-fit-graphics-to-frames4}} +```csharp FixedContentEditor editor = new FixedContentEditor(document.Pages.AddPage()); editor.DrawText("Fit Frame To Content"); @@ -147,4 +147,4 @@ The following example demonstrates how to insert an image in its original size. editor.DrawBlock(block); } -{{endregion}} +``` diff --git a/knowledge-base/how-to-identify-document-type.md b/knowledge-base/how-to-identify-document-type.md index 008da324..ba2063ad 100644 --- a/knowledge-base/how-to-identify-document-type.md +++ b/knowledge-base/how-to-identify-document-type.md @@ -35,9 +35,9 @@ This article describes how to identify the actual document type when the filenam The following example demonstrates how to read two documents with ".doc" filename extensions but actually different document types. Using the [`StringBuilder`](https://docs.microsoft.com/en-us/dotnet/api/system.text.stringbuilder?view=net-6.0) class we are creating the document signature (header) string, which later to compare with predefined values. Once having the right document type we can determine which format provider to use to import the document. -#### __[C#] Example__ +#### __Example__ -{{region how-to-identify-document-type1}} +```csharp List documents = new List(); documents.Add(File.ReadAllBytes("rtf.doc")); @@ -61,10 +61,10 @@ Once having the right document type we can determine which format provider to us RadFlowDocument docDocument = docFormatProvider.Import(document); } } -{{endregion}} +``` -#### __[C#] Getting document header__ -{{region how-to-identify-document-type1}} +#### __Getting document header__ +```csharp private static string GetHeaderInfo(byte[] documentData) { @@ -78,4 +78,4 @@ Once having the right document type we can determine which format provider to us return sb.ToString(); } -{{endregion}} +``` diff --git a/knowledge-base/import-export-save-load-workbook.md b/knowledge-base/import-export-save-load-workbook.md index f2abb50f..34a92bfc 100644 --- a/knowledge-base/import-export-save-load-workbook.md +++ b/knowledge-base/import-export-save-load-workbook.md @@ -66,7 +66,7 @@ Note that the code snippets in the [Examples section](#examples) use the **XLSX ### Load workbook from Byte[] array -````C# +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook; // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IBinaryWorkbookFormatProvider interface IBinaryWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); @@ -77,11 +77,11 @@ var path = "MyWorkbook.xlsx"; //https://docs.microsoft.com/en-us/dotnet/api/system.io.file.readallbytes?view=net-5.0 byte[] fileAsByteArray = File.ReadAllBytes(path); workbook = formatProvider.Import(fileAsByteArray); -```` +``` ### Save workbook as Byte[] array -````C# +```csharp // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IBinaryWorkbookFormatProvider interface IBinaryWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); @@ -93,13 +93,13 @@ var path = "MyWorkbook.xlsx"; // var path = Server.MapPath("~/Resources/FromWorkbook.pdf"); // applicable only for ASP.NET project File.WriteAllBytes(path, bytesFromWorkbook); -```` +``` ## FileStream or MemoryStream ### Load Workbook from file as FileStream or MemoryStream -````C# +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook; // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IWorkbookFormatProvider interface IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); @@ -110,12 +110,12 @@ using (Stream input = new MemoryStream(fileAsByteArray)) workbook = formatProvider.Import(input); } -```` +``` ### Save Workbook to FileStream or MemoryStream -````C# +```csharp // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IWorkbookFormatProvider interface IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); var path = "MyWorkbook.pdf"; @@ -127,12 +127,12 @@ using (MemoryStream output = new MemoryStream()) // use your own Workbook instance here formatProvider.Export(workbook, output); } -```` +``` ## Save Workbook as PDF -````C# +```csharp var pdfFormatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider(); // var path = Server.MapPath("~/Resources/FromWorkbook.pdf"); // applicable only for ASP.NET project var path = "MyWorkbook.pdf"; @@ -151,7 +151,7 @@ var path = "MyWorkbook.xlsx"; byte[] pdfBytes = pdfFormatProvider.Export(workbook); File.WriteAllBytes(path, pdfBytes); -```` +``` ## Uploaded file @@ -159,7 +159,7 @@ File.WriteAllBytes(path, pdfBytes); _* Web application specific example_ -````C# +```csharp //public Workbook LoadFromUploadedFile(HttpPostedFile uploadedFile) // General upload file type public Workbook LoadFromUploadedFile(UploadedFile uploadedFile) // Telerik RadAsyncUpload for ASP.NET AJAX specific upload file type { @@ -171,7 +171,7 @@ public Workbook LoadFromUploadedFile(UploadedFile uploadedFile) // Telerik RadAs return workbook; } -```` +``` ## DataBase @@ -179,7 +179,7 @@ public Workbook LoadFromUploadedFile(UploadedFile uploadedFile) // Telerik RadAs The SQL table used for the example below has the `FileContent` column as `varbinary(MAX)`. -````C# +```csharp // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IBinaryWorkbookFormatProvider interface IBinaryWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); @@ -188,9 +188,9 @@ var fileAsByteArray = ReadFileFromDatabaseAsByteArray(id); Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook; workbook = formatProvider.Import(fileAsByteArray); -```` +``` -````C# +```csharp public static byte[] ReadFileFromDatabaseAsByteArray(string id) { var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["WorkbookTestsConnectionString"].ConnectionString; @@ -229,21 +229,21 @@ public static byte[] ReadFileFromDatabaseAsByteArray(string id) } } } -```` +``` ### Save Workbook to SQL DataBase -````C# +```csharp // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IBinaryWorkbookFormatProvider interface IBinaryWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); byte[] bytesFromWorkbookForSqlSave = formatProvider.Export(workbook); // InsertFileAsByteArrayInDatabase is a demo method declared in the snippet below bool isSuccessful = InsertFileAsByteArrayInDatabase(bytesFromWorkbookForSqlSave, "WorkbookForSqlSave.xlsx"); -```` +``` -````C# +```csharp public bool InsertFileAsByteArrayInDatabase(byte[] fileBytes, string fileName) { var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["WorkbookTestsConnectionString"].ConnectionString; @@ -266,13 +266,13 @@ public bool InsertFileAsByteArrayInDatabase(byte[] fileBytes, string fileName) } } } -```` +``` ## Web service ### Load Workbook from the Web -````C# +```csharp public Workbook LoadFromWeb(string url) { Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbookFromWebService; @@ -287,24 +287,24 @@ public Workbook LoadFromWeb(string url) return workbookFromWebService; } -```` +``` ## Base64 string ### Load Workbook from Base64 string -````C# +```csharp // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IBinaryWorkbookFormatProvider interface IBinaryWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); byte[] fileAsByteArray = Convert.FromBase64String(fileAsBase64String); Workbook workbook = formatProvider.Import(fileAsByteArray); -```` +``` ### Save Workbook to Base64 string -````C# +```csharp // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IBinaryWorkbookFormatProvider interface IBinaryWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); string base64FromByteArray; @@ -312,13 +312,13 @@ string base64FromByteArray; // use your own Workbook instance here byte[] bytesFromWorkbook = formatProvider.Export(workbook); string base64FromByteArray = Convert.ToBase64String(bytesFromWorkbook); -```` +``` ## DataTable ### Load Workbook from DataTable -````C# +```csharp public Workbook LoadFromDataTable(DataTable dataTable) { // Convert a DataTable to Workbook @@ -331,21 +331,21 @@ public Workbook LoadFromDataTable(DataTable dataTable) return workbook; } -```` +``` ### Save Workbook to DataTable -````C# +```csharp DataTableFormatProvider provider = new DataTableFormatProvider(); // use your own Workbook instance here and choose the desired worksheet DataTable dataTableFromWorkbook = provider.Export(workbook.Worksheets[0]); -```` +``` ## Download -````C# +```csharp // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IBinaryWorkbookFormatProvider interface IBinaryWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); @@ -354,9 +354,9 @@ byte[] fileToDownloadAsByteArray = formatProvider.Export(workbook); // Demo method declared in the snippet below WriteFileToResponse(fileToDownloadAsByteArray); -```` +``` -````C# +```csharp private void WriteFileToResponse(byte[] content) { var fileName = "MyWorkbook.xlsx"; @@ -373,13 +373,13 @@ private void WriteFileToResponse(byte[] content) Response.BinaryWrite(content); Response.End(); } -```` +``` ## OpenFileDialog _*Desktop application specific example_ -````C# +```csharp OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog(); openFileDialog.Filter = Telerik.Windows.Controls.Spreadsheet.Utilities.FileDialogsHelper.GetOpenFileDialogFilter(); // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IWorkbookFormatProvider interface @@ -398,14 +398,14 @@ if (openFileDialog.ShowDialog() == true) throw new IOException("The file cannot be opened. It might be locked by another application.", ex); } } -```` +``` ## SaveFileDialog _*Desktop application specific example_ -````C# +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook(); workbook.Worksheets.Add(); @@ -421,22 +421,13 @@ if (saveFileDialog.ShowDialog() == true) formatProvider.Export(workbook, output); } } -```` - -## Related resources - -- [Getting Started with Telerik Document Processing]({%slug getting-started%}) -- [Installing Telerik Document Processing on Your Computer]({%slug installation-installing-on-your-computer%}) -- [Telerik Document Processing Developer Focused examples repository](https://github.com/telerik/document-processing-sdk) -- [RadSpreadProcessing - Formats and conversion]({%slug radspreadprocessing-formats-and-conversion-general-information%}}) -- [RadSpreadProcessing - Format Providers Manager]({%slug radspreadprocessing-formats-and-conversion-format-providers-manager%}) -- [RadSpreadProcessing Workbook Overview]({%slug radspreadprocessing-working-with-workbooks-what-is-workbook%}) +``` ## See Also - [Getting Started with Telerik Document Processing]({%slug getting-started%}) - [Installing Telerik Document Processing on Your Computer]({%slug installation-installing-on-your-computer%}) - [Telerik Document Processing Developer Focused examples repository](https://github.com/telerik/document-processing-sdk) -- [RadSpreadProcessing - Formats and conversion]({%slug radspreadprocessing-formats-and-conversion-general-information%}}) +- [RadSpreadProcessing - Formats and conversion]({%slug radspreadprocessing-formats-and-conversion-general-information%}) - [RadSpreadProcessing - Format Providers Manager]({%slug radspreadprocessing-formats-and-conversion-format-providers-manager%}) - [RadSpreadProcessing Workbook Overview]({%slug radspreadprocessing-working-with-workbooks-what-is-workbook%}) diff --git a/knowledge-base/insert_field_in_header.md b/knowledge-base/insert_field_in_header.md index 8c7abdc2..819ae31c 100644 --- a/knowledge-base/insert_field_in_header.md +++ b/knowledge-base/insert_field_in_header.md @@ -21,9 +21,9 @@ You need to add a field in the header for example to display page numbering. This can be achieved by adding a paragraph to the header and then moving the editor position to this paragraph. Once this is done you can insert the field and move the position to another paragraph in the document. -#### __C# Insert page numbering in he header__ +#### __Insert page numbering in he header__ -{{region insert_field_in_header}} +```csharp RadFlowDocument document = new RadFlowDocument(); @@ -46,4 +46,4 @@ This can be achieved by adding a paragraph to the header and then moving the edi document.UpdateFields(); -{{endregion}} \ No newline at end of file +``` \ No newline at end of file diff --git a/knowledge-base/load-fonts-with-net-standard.md b/knowledge-base/load-fonts-with-net-standard.md index 7b39ef13..fde51c59 100644 --- a/knowledge-base/load-fonts-with-net-standard.md +++ b/knowledge-base/load-fonts-with-net-standard.md @@ -13,17 +13,15 @@ res_type: kb |----|----|----| |2020.1.114|RadPdfProcessing for Net Standard|[Dimitar Karamfilov](https://www.telerik.com/blogs/author/dimitar-karamfilov)| -# Problem +## Problem The __RadPdfProcessing__ version for .NET standard does not look for the fonts on the operating system and falls back to the [standard fonts](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/concepts/fonts#standard-fonts). -# Solution +## Solution Manually register the fonts in your application. -#### __C#__ - -{{region kb-load-fonts-with-net-standard1}} +```csharp var fontData = File.ReadAllBytes(@"..\..\..\Roboto-Bold.TTF"); FontsRepository.RegisterFont(new FontFamily("Roboto"), FontStyles.Normal, FontWeights.Bold, fontData); @@ -34,7 +32,7 @@ Manually register the fonts in your application. editor.DrawBlock(block); -{{endregion}} +``` diff --git a/knowledge-base/merge-pdfs-with-annotations.md b/knowledge-base/merge-pdfs-with-annotations.md index 166240e2..680a781f 100644 --- a/knowledge-base/merge-pdfs-with-annotations.md +++ b/knowledge-base/merge-pdfs-with-annotations.md @@ -21,9 +21,9 @@ This article describes how to merge PDF documents without loss of supported anno The following approach takes a collection of paths, creates a new [RadFixedDocument]({%slug radpdfprocessing-model-radfixeddocument%}) instance, appends the documents from those paths to the newly created [RadFixedDocument]({%slug radpdfprocessing-model-radfixeddocument%}) and returns it as a result. -#### __[C#] Merge PDF files +#### __Merge PDF files -{{region kb-merge-pdf-files-while-preserving-their-annotations_0}} +```csharp public static RadFixedDocument MergeDocuments(string[] pathsCollection) { @@ -56,4 +56,4 @@ The following approach takes a collection of paths, creates a new [RadFixedDocum return resultFile; } -{{endregion}} +``` diff --git a/knowledge-base/merge-xlsx-files-in-a-single-worksheet.md b/knowledge-base/merge-xlsx-files-in-a-single-worksheet.md index 41b36850..e8b252cd 100644 --- a/knowledge-base/merge-xlsx-files-in-a-single-worksheet.md +++ b/knowledge-base/merge-xlsx-files-in-a-single-worksheet.md @@ -21,9 +21,9 @@ You have a multiple Xlsx files and you want to merge them in single file. You can iterate all files, import them, and copy their worksheets in a new Workbook. -#### __[C#] Merge multiple worksheet in a single Workbook__ +#### __Merge multiple worksheet in a single Workbook__ -{{region kb-merge-xlsx-files-in-a-single-worksheet_0}} +```csharp List files = new List(); files.Add("Book1.xlsx"); @@ -45,4 +45,4 @@ You can iterate all files, import them, and copy their worksheets in a new Workb var resultXlsx = provider.Export(workbook); File.WriteAllBytes("result.xlsx", resultXlsx); -{{endregion}} +``` diff --git a/knowledge-base/missing-symbols-in-pdf.md b/knowledge-base/missing-symbols-in-pdf.md index 9bb701e6..e15c10ba 100644 --- a/knowledge-base/missing-symbols-in-pdf.md +++ b/knowledge-base/missing-symbols-in-pdf.md @@ -20,9 +20,7 @@ This can happen when the characters cannot be found in a specific font. In this To ensure that these symbols are available you need to embed a font that contains them to the document. -#### __C#__ - -{{region kb-missing-symbols-in-pdf1}} +```csharp var fontData = File.ReadAllBytes(@"..\\..\SegoeUI.ttf"); FontsRepository.RegisterFont(new FontFamily("Segoe UI"), FontStyles.Normal, FontWeights.Normal, fontData); @@ -30,4 +28,4 @@ To ensure that these symbols are available you need to embed a font that contain FontBase font; FontsRepository.TryCreateFont(new FontFamily("Segoe UI"), FontStyles.Normal, FontWeights.Normal, out font); -{{endregion}} \ No newline at end of file +``` \ No newline at end of file diff --git a/knowledge-base/modify-form-fields.md b/knowledge-base/modify-form-fields.md index e7a630d9..34016fcc 100644 --- a/knowledge-base/modify-form-fields.md +++ b/knowledge-base/modify-form-fields.md @@ -21,8 +21,7 @@ You have a document that has many form fields and you want to populate them with You can import the document and iterate all fields. This will allow you to set their value. -#### __C#__ -{{region kb-modify-form-fields_0}} +```csharp var provider = new PdfFormatProvider(); @@ -50,5 +49,5 @@ You can import the document and iterate all fields. This will allow you to set t File.WriteAllBytes("result.pdf", provider.Export(document)); -{{endregion}} +``` diff --git a/knowledge-base/pdf-from-images-with-fixedcontenteditor.md b/knowledge-base/pdf-from-images-with-fixedcontenteditor.md index 9d19e312..05908200 100644 --- a/knowledge-base/pdf-from-images-with-fixedcontenteditor.md +++ b/knowledge-base/pdf-from-images-with-fixedcontenteditor.md @@ -7,17 +7,17 @@ slug: pdf-from-images-with-fixedcontenteditor tags: pdf,images,editor res_type: kb --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2024.1.124 | RadPdfProcessing|[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| -# Description +## Description This tutorial demonstrates a sample approach how to generate a PDF document from a collection of images located in a local folder. ![Folder with images](images/images-folder.png) -# Solution +## Solution To create the PDF document, we will use a [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) which is always associated with a single [RadFixedPage]({%slug radpdfprocessing-model-radfixedpage%}). The editor maintains an internal [Position]({%slug radpdfprocessing-concepts-position%}) inside the page at which the image block element will be inserted and drawn. The Position is adjusted after the image is rendered. If there is no remaining space on the page to draw the next image, a new page will be created and the editor's position will be moved to the beginning of the new page. ```csharp diff --git a/knowledge-base/pdf-from-images-with-radfixeddocumenteditor.md b/knowledge-base/pdf-from-images-with-radfixeddocumenteditor.md index 2eb1842e..0eb48c6d 100644 --- a/knowledge-base/pdf-from-images-with-radfixeddocumenteditor.md +++ b/knowledge-base/pdf-from-images-with-radfixeddocumenteditor.md @@ -7,17 +7,17 @@ slug: pdf-from-images-with-radfixeddocumenteditor tags: pdf,images,editor res_type: kb --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2024.1.124 | RadPdfProcessing|[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| -# Description +## Description This tutorial demonstrates a sample approach how to generate a PDF document from a collection of images located in a local folder. ![Folder with images](images/images-folder.png) -# Solution +## Solution To create the PDF document, we will use a [RadFixedDocumentEditor]({%slug radpdfprocessing-editing-radfixeddocumenteditor%}) which generates the document in a flow-like manner. The editor provides methods that enable the generation of documents, which automatically flows to pages. ```csharp diff --git a/knowledge-base/pdf-processing-draw-figures-arcsegment.md b/knowledge-base/pdf-processing-draw-figures-arcsegment.md index be235c6a..12f0d0af 100644 --- a/knowledge-base/pdf-processing-draw-figures-arcsegment.md +++ b/knowledge-base/pdf-processing-draw-figures-arcsegment.md @@ -7,7 +7,7 @@ slug: pdf-processing-draw-figures-arcsegment tags: arcsegment, draw, circle, lines, RadPdfProcessing --- -# How to Draw Figures in PDF documents +## How to Draw Figures in PDF documents ## Environment diff --git a/knowledge-base/pdfprocessing-create-pdf-from-image.md b/knowledge-base/pdfprocessing-create-pdf-from-image.md index b6dfc6e7..5e8ff966 100644 --- a/knowledge-base/pdfprocessing-create-pdf-from-image.md +++ b/knowledge-base/pdfprocessing-create-pdf-from-image.md @@ -22,9 +22,7 @@ The example is showing how to create a PDF file by using an image. In this example you will create a brand new PDF document, add a page to it, and draw the image using the [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}). -#### __C#__ - -{{region kb-radpdfprocessing-editing-fixedcontenteditor}} +```csharp // If you are working in a .NET Core application, you will need to also provide an image resolver. You can use the default implementation provided in Telerik.Documents.ImageUtils: // Telerik.Documents.ImageUtils.ImagePropertiesResolver defaultImagePropertiesResolver = new Telerik.Documents.ImageUtils.ImagePropertiesResolver(); @@ -43,7 +41,7 @@ In this example you will create a brand new PDF document, add a page to it, and File.WriteAllBytes(@"result.pdf", provider.Export(doc)); -{{endregion}} +``` diff --git a/knowledge-base/pdfprocessing-create-repeat-header-row.md b/knowledge-base/pdfprocessing-create-repeat-header-row.md index d7011c7e..6944adfd 100644 --- a/knowledge-base/pdfprocessing-create-repeat-header-row.md +++ b/knowledge-base/pdfprocessing-create-repeat-header-row.md @@ -21,9 +21,7 @@ This example demonstrates how one can create the repeating row functionality. Wh The solution would be to split the table on each page and draw a second table that contains only the headers. The bellow example looks complex but I believe that it can be easily pugged in a real application. -#### __C#__ - -{{region kb-pdfprocessing-create-repeat-header-row}} +```csharp class Program { @@ -170,6 +168,6 @@ The solution would be to split the table on each page and draw a second table th } } -{{endregion}} +``` diff --git a/knowledge-base/pdfprocessing-create-table-of-contents-page.md b/knowledge-base/pdfprocessing-create-table-of-contents-page.md index 9a1f8e25..d9ddaf94 100644 --- a/knowledge-base/pdfprocessing-create-table-of-contents-page.md +++ b/knowledge-base/pdfprocessing-create-table-of-contents-page.md @@ -38,9 +38,9 @@ The following code snippets shows how to: 3. Create a Table of Contents (TOC) using [Link]({%slug radpdfprocessing-model-annotations-links%}#link) annotations pointing to the merged document pages; 4. Export the merged document to a single PDF file. -#### __[C#] Example__ +#### __Example__ -{{region pdfprocessing-create-table-of-contents-page1}} +```csharp PdfFormatProvider provider = new PdfFormatProvider(); @@ -52,11 +52,11 @@ The following code snippets shows how to: CreateTOC(document1); ExportToPdf(provider, document1); -{{endregion}} +``` -#### __[C#] Import PDF files__ +#### __Import PDF files__ -{{region pdfprocessing-create-table-of-contents-page2}} +```csharp private static void ImportDocuments(PdfFormatProvider provider, out RadFixedDocument document1, out RadFixedDocument document2) { @@ -70,11 +70,11 @@ The following code snippets shows how to: document2 = provider.Import(stream); } } -{{endregion}} +``` -#### __[C#] Create the Table of Contents__ +#### __Create the Table of Contents__ -{{region pdfprocessing-create-table-of-contents-page3}} +```csharp private static void CreateTOC(RadFixedDocument document1) { @@ -117,11 +117,11 @@ The following code snippets shows how to: } } } -{{endregion}} +``` -#### __[C#] Export to PDF file__ +#### __Export to PDF file__ -{{region pdfprocessing-create-table-of-contents-page4}} +```csharp private static void ExportToPdf(PdfFormatProvider provider, RadFixedDocument document1) { @@ -136,4 +136,4 @@ The following code snippets shows how to: provider.Export(document1, output); } } -{{endregion}} +``` diff --git a/knowledge-base/pdfprocessing-creating-tablecells-with-gotoaction-and-uriaction.md b/knowledge-base/pdfprocessing-creating-tablecells-with-gotoaction-and-uriaction.md index 2065b3fd..d522d76b 100644 --- a/knowledge-base/pdfprocessing-creating-tablecells-with-gotoaction-and-uriaction.md +++ b/knowledge-base/pdfprocessing-creating-tablecells-with-gotoaction-and-uriaction.md @@ -29,9 +29,7 @@ The following example demonstrates how to create TableCells with GoToAction and 3.After that for creating Links to URLs or Locations within the document, we use Actions - UriAction or GoToAction. - -````C# -{{region kb-create-table-cells}} +```csharp RadFixedDocument document = new RadFixedDocument(); using (RadFixedDocumentEditor editor = new RadFixedDocumentEditor(document)) @@ -110,9 +108,7 @@ The following example demonstrates how to create TableCells with GoToAction and Process.Start(new ProcessStartInfo() { FileName = outputPath, UseShellExecute = true }); -{{endregion}} - -```` +``` ## See Also diff --git a/knowledge-base/pdfprocessing-implement-fontsprovider.md b/knowledge-base/pdfprocessing-implement-fontsprovider.md index e27bd8e1..4ed91274 100644 --- a/knowledge-base/pdfprocessing-implement-fontsprovider.md +++ b/knowledge-base/pdfprocessing-implement-fontsprovider.md @@ -27,8 +27,8 @@ In the validation, each font name (FontFamilyName) must be explicitly specified >important If the **FontsProvider** property is not set, a default font will be used when exporting the document. -#### **[C#] Creating custom implementation by inheriting the FontsProviderBase abstract class** - {{region kb-radpdfprocessing-fontsprovider_0}} +#### **Creating custom implementation by inheriting the FontsProviderBase abstract class** + ```csharp public class FontsProvider : Telerik.Windows.Documents.Extensibility.FontsProviderBase { public override byte[] GetFontData(Telerik.Windows.Documents.Core.Fonts.FontProperties fontProperties) @@ -107,14 +107,14 @@ In the validation, each font name (FontFamilyName) must be explicitly specified return null; } } - {{endregion}} + ``` -#### **[C#] Set the custom implementation inheriting the FontsProviderBase abstract class** - {{region kb-radpdfprocessing-fontsprovider_1}} +#### **Set the custom implementation inheriting the FontsProviderBase abstract class** + ```csharp Telerik.Windows.Documents.Extensibility.FontsProviderBase fontsProvider = new FontsProvider(); Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.FontsProvider = fontsProvider; - {{endregion}} + ``` ## See Also * [Standard Fonts]({%slug radpdfprocessing-concepts-fonts%}) diff --git a/knowledge-base/pdfprocessing-insert-hyperlink-into-radfixeddocument.md b/knowledge-base/pdfprocessing-insert-hyperlink-into-radfixeddocument.md index 01d4ad0c..9bd94681 100644 --- a/knowledge-base/pdfprocessing-insert-hyperlink-into-radfixeddocument.md +++ b/knowledge-base/pdfprocessing-insert-hyperlink-into-radfixeddocument.md @@ -34,9 +34,9 @@ This article describes how to insert a Hyperlink into the [RadFixedDocument]({%s The following example shows how to insert a Hyperlink using a [Link]({%slug radpdfprocessing-model-annotations-links%}#link) annotation with an associated [UriAction](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.fixed.model.actions.uriaction) in the RadFixedDocument. With the help of the [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}), we are drawing a block containing the text over the annotation. -#### __[C#] Insert Hyperlink into RadFixedDocument__ +#### __Insert Hyperlink into RadFixedDocument__ -{{region pdfprocessing-insert-hyperlink-into-radfixeddocument1}} +```csharp RadFixedDocument document = new RadFixedDocument(); RadFixedPage firstPage = document.Pages.AddPage(); @@ -55,4 +55,4 @@ The following example shows how to insert a Hyperlink using a [Link]({%slug radp Link uriLink = firstPage.Annotations.AddLink(uriAction); uriLink.Rect = new Rect(70, 10, blockSize.Width, blockSize.Height); -{{endregion}} +``` diff --git a/knowledge-base/pdfprocessing-invert-pdf-document-colors.md b/knowledge-base/pdfprocessing-invert-pdf-document-colors.md index ed4c8c09..a2be9e69 100644 --- a/knowledge-base/pdfprocessing-invert-pdf-document-colors.md +++ b/knowledge-base/pdfprocessing-invert-pdf-document-colors.md @@ -34,9 +34,9 @@ This article describes how to invert the background and text colors within a PDF The provided code snippets demonstrates how to import a PDF document and invert its background and text color by iterating its content. -#### __[C#] Import PDF file and Invert its Background and Content Color__ +#### __Import PDF file and Invert its Background and Content Color__ -{{region pdfprocessing-invert-pdf-document-colors1}} +```csharp RadFixedDocument document; PdfFormatProvider provider = new PdfFormatProvider(); @@ -61,13 +61,13 @@ The provided code snippets demonstrates how to import a PDF document and invert { provider.Export(document, output); } -{{endregion}} +``` As the PDF document has no background concept we are creating a [RectangleGeometry](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.fixed.model.graphics.rectanglegeometry) using the page size and setting the desired color to it. -#### __[C#] Invert Document's Background Color__ +#### __Invert Document's Background Color__ -{{region pdfprocessing-invert-pdf-document-colors2}} +```csharp private static void InvertBackgroundColor(RadFixedDocument document) { @@ -80,13 +80,13 @@ As the PDF document has no background concept we are creating a [RectangleGeomet page.Content.Insert(0, path); } } -{{endregion}} +``` The following methods show how to invert the document elements' color by recursively iterating their content and setting the desired color using the relevant Fill property. -#### __[C#] Invert Document Content`s Color__ +#### __Invert Document Content`s Color__ -{{region pdfprocessing-invert-pdf-document-colors3}} +```csharp private static void InvertContentColor(RadFixedDocument document) { @@ -114,4 +114,4 @@ The following methods show how to invert the document elements' color by recursi } } } -{{endregion}} +``` diff --git a/knowledge-base/pdfprocessing-merge-two-pages-from-different-documents-into-a-single-page.md b/knowledge-base/pdfprocessing-merge-two-pages-from-different-documents-into-a-single-page.md index 70e7bb81..35880339 100644 --- a/knowledge-base/pdfprocessing-merge-two-pages-from-different-documents-into-a-single-page.md +++ b/knowledge-base/pdfprocessing-merge-two-pages-from-different-documents-into-a-single-page.md @@ -34,9 +34,9 @@ This article describes how to import two PDF documents and merge their first pag The following example demonstrates how to use the [PdfStreamWriter]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdfstreamwriter%}) in order to import and merge the first pages of two different documents into a new single page. -#### __[C#] Example__ +#### __Example__ -{{region pdfprocessing-merge-two-pages-from-different-documents-into-a-single-page1}} +```csharp string firstDocument = "SampleDocument1.pdf"; string secondDocument = "SampleDocument2.pdf"; @@ -71,6 +71,6 @@ The following example demonstrates how to use the [PdfStreamWriter]({%slug radpd } } } -{{endregion}} +``` More information you can find in the [PdfPageStreamWriter]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdfpagestreamwriter%}), [PdfFileSource]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdffilesource%}), and [PdfPageSource]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdfpagesource%}) help articles. diff --git a/knowledge-base/pdfprocessing-merge-two-pdf-pages-into-a-single-page.md b/knowledge-base/pdfprocessing-merge-two-pdf-pages-into-a-single-page.md index 0a23f8eb..bcd6ba13 100644 --- a/knowledge-base/pdfprocessing-merge-two-pdf-pages-into-a-single-page.md +++ b/knowledge-base/pdfprocessing-merge-two-pdf-pages-into-a-single-page.md @@ -34,9 +34,9 @@ This article shows how to merge two pages from different documents into a single The provided code snippet demonstrates how to import two **PDF** documents using the [PdfFileSource]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdffilesource%}), get their first pages using the [PdfPageSource]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdfpagesource%}), and merge them on a single page using the [PdfStreamWriter]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdfstreamwriter%}). -#### __[C#] Merge two pages from different documents into a single page__ +#### __Merge two pages from different documents into a single page__ -{{region pdfprocessing-merge-two-pdf-pages-into-a-single-page1}} +```csharp string firstDocument = "SampleDocument1.pdf"; string secondDocument = "SampleDocument2.pdf"; @@ -66,4 +66,4 @@ The provided code snippet demonstrates how to import two **PDF** documents using } } } -{{endregion}} +``` diff --git a/knowledge-base/pdfprocessing-replace-text-with-image.md b/knowledge-base/pdfprocessing-replace-text-with-image.md index fadbbdc5..a0ce3750 100644 --- a/knowledge-base/pdfprocessing-replace-text-with-image.md +++ b/knowledge-base/pdfprocessing-replace-text-with-image.md @@ -19,9 +19,7 @@ A common scenario is to replace a temporary page content (a placeholder text) wi ## Solution The following example demonstrates the approach of iterating the page content and finding TextFragment elements matching the *$ImagePlaceholder* text. For each match, an Image instance is created and the TextFragment is replaced with it. The *Position* property is used to correctly position the image on the page. -#### __C#__ - -{{region kb-pdfprocessing-replace-text-with-image}} +```csharp foreach (RadFixedPage page in pdfDocument.Pages) { @@ -81,4 +79,4 @@ The following example demonstrates the approach of iterating the page content an } } } -{{endregion}} +``` diff --git a/knowledge-base/pdfprocessing-replace-text.md b/knowledge-base/pdfprocessing-replace-text.md index ea5f438b..a566acac 100644 --- a/knowledge-base/pdfprocessing-replace-text.md +++ b/knowledge-base/pdfprocessing-replace-text.md @@ -25,9 +25,7 @@ With PdfProcessing, you can import a PDF document and traverse the text inside t The following code iterates the TextFragments on each RadFixedPage and replaces the *"<%textfield,1234%>"* string with *"replaced text"*. -#### __C#__ - -{{region kb-pdfprocessing-replace-text_0}} +```csharp foreach (RadFixedPage page in document.Pages) { @@ -43,13 +41,11 @@ The following code iterates the TextFragments on each RadFixedPage and replaces } } } -{{endregion}} +``` And here is the implementation of the Replace method: -#### __C#__ - -{{region kb-pdfprocessing-replace-text_1}} +```csharp private static void Replace(TextFragment textFragment, string oldValue, string newValue) { @@ -58,7 +54,7 @@ And here is the implementation of the Replace method: textFragment.Text = newValue; } } -{{endregion}} +``` ## Notes diff --git a/knowledge-base/pdfprocessing-rotate-jpeg-with-orientation-set-in-metadata.md b/knowledge-base/pdfprocessing-rotate-jpeg-with-orientation-set-in-metadata.md index 3195dee1..4a0a8fcf 100644 --- a/knowledge-base/pdfprocessing-rotate-jpeg-with-orientation-set-in-metadata.md +++ b/knowledge-base/pdfprocessing-rotate-jpeg-with-orientation-set-in-metadata.md @@ -24,9 +24,9 @@ EXIF data is useful information about a JPEG image, hidden inside the file`s met In the following example, we are using the _System.Drawing._**Bitmap** class in order to load a rotated **JPEG** image and then pass it to a helper method to rotate the image according to the appropriate rotation angle. After the image is successfully rotated we are inserting it into the **RadFixedPage**. -#### __[C#] Insert a JPEG image with orientation set in its metadata into a RadFixedDocument using a helper method__ +#### __Insert a JPEG image with orientation set in its metadata into a RadFixedDocument using a helper method__ -{{region pdfprocessing-rotate-jpeg-with-orientation-set-in-metadata1}} +```csharp string imagePath = "Progress_DevCraft_rotated.jpg"; Image bitmap = new Bitmap(imagePath); @@ -45,13 +45,13 @@ After the image is successfully rotated we are inserting it into the **RadFixedP RadFixedDocument document = new RadFixedDocument(); RadFixedPage page = document.Pages.AddPage(); page.Content.Add(image); -{{endregion}} +``` Here is an example of rotating the image according to its EXIF orientation. -#### __[C#] The helper method__ +#### __The helper method__ -{{region pdfprocessing-rotate-jpeg-with-orientation-set-in-metadata2}} +```csharp public static Image ExifRotate(Image img) { @@ -91,4 +91,4 @@ Here is an example of rotating the image according to its EXIF orientation. return img; } -{{endregion}} +``` diff --git a/knowledge-base/populate-table-data-mail-merge.md b/knowledge-base/populate-table-data-mail-merge.md index 8b41357a..79727df2 100644 --- a/knowledge-base/populate-table-data-mail-merge.md +++ b/knowledge-base/populate-table-data-mail-merge.md @@ -8,17 +8,17 @@ tags: mail, merge, mailmerge, word, table, data, nested res_type: kb --- -# Environment +## Environment | Version | Product | Author | | ---- | ---- | ---- | | 2024.1.124 | RadWordsProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| -# Description +## Description Learn how to generate a Word (.DOCX) document that contains a [Table]({%slug radwordsprocessing-model-table%}) with a header row and an item row merge field. Then, passing a collection of records automatically creates and populates the data rows. -# Solution +## Solution To achieve the desired result, you can use the [Nested Mail Merge]({%slug radwordsprocessing-editing-mail-merge%}) functionality that [RadWordsProcessing]({%slug radwordsprocessing-overview%}) offers and populate the data rows automatically. diff --git a/knowledge-base/position-digital-signature-on-page.md b/knowledge-base/position-digital-signature-on-page.md index 1c46a997..7bc1685a 100644 --- a/knowledge-base/position-digital-signature-on-page.md +++ b/knowledge-base/position-digital-signature-on-page.md @@ -19,9 +19,7 @@ A common scenario is to replace a temporary page content (a templated text) with ## Solution The following example demonstrates the approach of iterating the page content and finding TextFragment elements matching the *$CollectSignature* text. For each found match, a Signature Field is created and the TextFragment is replaced with a Signature widget. The *Rect* property is used to position and outline the Signature widget on the page. -#### __C#__ - -{{region kb-position-digital-signature-on-page}} +```csharp foreach (RadFixedPage page in document.Pages) { @@ -52,4 +50,4 @@ The following example demonstrates the approach of iterating the page content an } } -{{endregion}} +``` diff --git a/knowledge-base/radwordsprocessing-change-bookmark-content-preserve-formatting.md b/knowledge-base/radwordsprocessing-change-bookmark-content-preserve-formatting.md index 86670679..6e35767e 100644 --- a/knowledge-base/radwordsprocessing-change-bookmark-content-preserve-formatting.md +++ b/knowledge-base/radwordsprocessing-change-bookmark-content-preserve-formatting.md @@ -29,7 +29,7 @@ This article shows how to change the content of an existing [Bookmark]({%slug ra * **Insert text**: Add the replacement content. * **Export DOCX**: Write the updated document using [DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%}). -#### [C#] Replace bookmark content but keep formatting +#### Replace bookmark content but keep formatting ```csharp RadFlowDocument document; diff --git a/knowledge-base/repair-simple-cross-reference-table.md b/knowledge-base/repair-simple-cross-reference-table.md index ecb0d092..89c2f0a8 100644 --- a/knowledge-base/repair-simple-cross-reference-table.md +++ b/knowledge-base/repair-simple-cross-reference-table.md @@ -36,9 +36,7 @@ The provided code snippets demonstrates how to repair an invalid XREF table offs > The provided solution, however, can handle only simple cases in which the document contains a single XREF table. -#### __C#__ - -{{region kb-repair-simple-cross-reference-table1}} +```csharp RadFixedDocument document; @@ -53,12 +51,12 @@ The provided code snippets demonstrates how to repair an invalid XREF table offs } } -{{endregion}} +``` -#### __[C#] Repair Document With Simple Cross-Reference Table__ +#### __Repair Document With Simple Cross-Reference Table__ -{{region kb-repair-simple-cross-reference-table2}} +```csharp public MemoryStream RepairDocumentWithSimpleCrossReferenceTable(Stream corruptedPdfFile) { @@ -99,11 +97,11 @@ The provided code snippets demonstrates how to repair an invalid XREF table offs return repairedDocument; } -{{endregion}} +``` -#### __[C#] Extensions class providing some static methods used in RepairDocumentWithSimpleCrossReferenceTable method__ +#### __Extensions class providing some static methods used in RepairDocumentWithSimpleCrossReferenceTable method__ -{{region kb-repair-simple-cross-reference-table3}} +```csharp public static class PdfStreamExtensions { @@ -212,5 +210,5 @@ The provided code snippets demonstrates how to repair an invalid XREF table offs } } -{{endregion}} +``` diff --git a/knowledge-base/replace-image-in-pdf-document.md b/knowledge-base/replace-image-in-pdf-document.md index 8a0a28f9..28b992b6 100644 --- a/knowledge-base/replace-image-in-pdf-document.md +++ b/knowledge-base/replace-image-in-pdf-document.md @@ -34,9 +34,9 @@ How to replace image in a **PDF** document. In the example below, we are demonstrating how to find a specific image in the imported into a [RadFixedDocument](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/model/radfixeddocument) PDF document, preserve its size and [Position](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/concepts/position) and replace it with another [Image](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/model/image). -#### __[C#] Replace Image in Imported PDF Document__ +#### __Replace Image in Imported PDF Document__ -{{region kb-replace-image-in-pdf-document1}} +```csharp RadFixedPage firstPage = document.Pages[0]; @@ -61,4 +61,4 @@ In the example below, we are demonstrating how to find a specific image in the i firstPage.Content.RemoveAt(imageIndex); firstPage.Content.Add(newImage); -{{endregion}} +``` diff --git a/knowledge-base/replace-text-with-inline-element.md b/knowledge-base/replace-text-with-inline-element.md index c77819af..0fd2331e 100644 --- a/knowledge-base/replace-text-with-inline-element.md +++ b/knowledge-base/replace-text-with-inline-element.md @@ -33,9 +33,7 @@ Introducing a way to replace text with other document elements. To achieve this we will iterate the document elements of type [Run]({%slug radwordsprocessing-model-run%}) and will compare their text with the desired string. If there is a match we will store the Run index and we will insert the desired element (in our example: [Break]({%slug radwordsprocessing-model-break%}) on this specific index in the **Inlines** collection. Finally we will remove the Run. -#### __C#__ - -{{region kb-replace-text-with-inline-element1}} +```csharp RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document); editor.InsertText("First line"); @@ -56,4 +54,4 @@ To achieve this we will iterate the document elements of type [Run]({%slug radwo } } -{{endregion}} +``` diff --git a/knowledge-base/replace-textboxfield-with-image-in-pdf-document.md b/knowledge-base/replace-textboxfield-with-image-in-pdf-document.md index c4b897e5..45195537 100644 --- a/knowledge-base/replace-textboxfield-with-image-in-pdf-document.md +++ b/knowledge-base/replace-textboxfield-with-image-in-pdf-document.md @@ -34,9 +34,9 @@ How to replace a [TextBoxField]({%slug radpdfprocessing-model-interactive-forms- In the example below, we are demonstrating how to find a specific [TextBoxField]({%slug radpdfprocessing-model-interactive-forms-form-fields-textboxfield%}) by its name in the imported into a [RadFixedDocument](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/model/radfixeddocument) PDF document, preserve its size and [Position]({%slug radpdfprocessing-concepts-position%}) and replace it with an [Image]({%slug radpdfprocessing-model-image%}). -#### __[C#] Replace TextBoxField with Image in Imported PDF Document__ +#### __Replace TextBoxField with Image in Imported PDF Document__ -{{region kb-replace-textboxfield-with-image-in-pdf-document1}} +```csharp RadFixedPage firstPage = document.Pages[0]; @@ -63,4 +63,4 @@ RadFixedPage firstPage = document.Pages[0]; firstPage.Annotations.Remove(field); firstPage.Content.Add(newImage); -{{endregion}} +``` diff --git a/knowledge-base/retrieve-cell-color-radspreadprocessing.md b/knowledge-base/retrieve-cell-color-radspreadprocessing.md index 24fb33dd..4a928144 100644 --- a/knowledge-base/retrieve-cell-color-radspreadprocessing.md +++ b/knowledge-base/retrieve-cell-color-radspreadprocessing.md @@ -73,7 +73,7 @@ This approach ensures that even when a cell's color is derived from the document ## See Also -- [Document Themes in RadSpreadProcessing]({%slug radspreadprocessing-features-styling-document-themes%}}) +- [Document Themes in RadSpreadProcessing]({%slug radspreadprocessing-features-styling-document-themes%}) - [Getting Actual Values](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/styling/document-themes#getting-actual-values) --- diff --git a/knowledge-base/saving-docx-to-pdf-removes-table-borders.md b/knowledge-base/saving-docx-to-pdf-removes-table-borders.md index cc3ea215..156264cf 100644 --- a/knowledge-base/saving-docx-to-pdf-removes-table-borders.md +++ b/knowledge-base/saving-docx-to-pdf-removes-table-borders.md @@ -8,12 +8,12 @@ tags: radwordsprocessing, docx, pdf, table, borders, pdfformatprovider res_type: kb --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2024.1.124 | RadWordsProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| -# Description +## Description Table borders are removed when saving a DOCX file to PDF using the PdfFormatProvider in RadWordsProcessing. The table in the DOCX file has standard Word border styles applied to all borders, including dotted lines. However, when using the PdfFormatProvider to save the document as PDF, the borders become invisible and are not displayed in the resulting PDF file. Even when setting the table border width to 3pt, the borders still do not appear in the PDF file. @@ -22,7 +22,7 @@ The table in the DOCX file has standard Word border styles applied to all border |----|----| |![DOCX with table borders](images/saving-docx-to-pdf-removes-table-borders001.png) |![PDF without table borders](images/saving-docx-to-pdf-removes-table-borders002.png) | -# Solution +## Solution Currently, there is a limitation in RadWordsProcessing where the PdfFormatProvider does not support all types of border styles. However, there is a workaround that can be used to apply a single border to the table elements in the RadFlowDocument before exporting it to PDF. Here is an example in C# that demonstrates the workaround: diff --git a/knowledge-base/set-value-using-named-range.md b/knowledge-base/set-value-using-named-range.md index 7338c5ab..2bcb1a4a 100644 --- a/knowledge-base/set-value-using-named-range.md +++ b/knowledge-base/set-value-using-named-range.md @@ -34,9 +34,9 @@ How to set the value to a [CellSelection](https://docs.telerik.com/devtools/docu The solution would be to iterate the imported [Workbook]({%slug radspreadprocessing-working-with-workbooks-what-is-workbook %})`s Names in order to find the desired one. Then to split its [RefersTo](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.spreadsheet.model.definedname#collapsible-Telerik_Windows_Documents_Spreadsheet_Model_DefinedName_RefersTo) property to use its elements to match the exact [Worksheet]({%slug radspreadprocessing-working-with-worksheets-what-is-worksheet%}) and to get the name of the indexes describing the **CellSelection**. We are using the [NameConverter]({%slug radspreadprocessing-name-converter%})._TryConvertCellNameToIndex()_ method to convert the already obtained cell name to an index. -#### __[C#] Set Value using Named Range__ +#### __Set Value using Named Range__ -{{region kb-set-value-using-named-range1}} +```csharp string namedRange = "test"; string newValue = "edited"; @@ -69,6 +69,6 @@ The solution would be to iterate the imported [Workbook]({%slug radspreadprocess } } } -{{endregion}} +``` There is an item logged in our backlog to provide an API to make this easier: [SpreadProcessing: Add API to get the list of ranges to which a defined name refers](https://feedback.telerik.com/document-processing/1356055-spreadprocessing-add-api-to-get-the-list-of-ranges-to-which-a-defined-name-refers). You can cast your vote for the implementation as well as subscribe to the task by clicking the _Follow_ button to receive updates when its status changes. diff --git a/knowledge-base/signing-a-document-with-digital-signature.md b/knowledge-base/signing-a-document-with-digital-signature.md index 5051cf7c..5747b90b 100644 --- a/knowledge-base/signing-a-document-with-digital-signature.md +++ b/knowledge-base/signing-a-document-with-digital-signature.md @@ -34,9 +34,7 @@ How to sign a document with a digital signature using [FixedContentEditor]({%slu In order to sign a **PDF** file with the [PdfProcessing]({%slug radpdfprocessing-overview%}) library, you need an instance of the _System.Security.Cryptography.X509Certificates.[X509Certificate2](https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2)_ class. One way to create such an instance is to provide the path to a PFX file and the password in an X509Certificate2 constructor, as in the provided example. -#### __C#__ - -{{region kb-signing-a-document-with-digital-signature1}} +```csharp PdfFormatProvider provider = new PdfFormatProvider(); RadFixedDocument document = ImportDocument(); @@ -78,13 +76,11 @@ In order to sign a **PDF** file with the [PdfProcessing]({%slug radpdfprocessing // Add Signature flags document.AcroForm.SignatureFlags = SignatureFlags.AppendOnly; -{{endregion}} +``` However, there are other approaches provided by the **.Net Framework API** that allow you to get an X509Certificate2 class instance. The following code snippet demonstrates a possible approach for getting an X509Certificate2 class instance from an external device (e.g. **USB token** or hardware security module (**HSM**)) using .Net Framework API: -#### __C#__ - -{{region kb-signing-a-document-with-digital-signature1}} +```csharp X509Store store = new X509Store(StoreLocation.CurrentUser); store.Open(OpenFlags.ReadOnly); @@ -92,7 +88,7 @@ However, there are other approaches provided by the **.Net Framework API** that X509Certificate2 cert = sel[0]; -{{endregion}} +``` ## See Also diff --git a/knowledge-base/spreadprocessing-export-worksheet-to-image-netstandard.md b/knowledge-base/spreadprocessing-export-worksheet-to-image-netstandard.md index 259561b1..98ec65cf 100644 --- a/knowledge-base/spreadprocessing-export-worksheet-to-image-netstandard.md +++ b/knowledge-base/spreadprocessing-export-worksheet-to-image-netstandard.md @@ -7,15 +7,15 @@ slug: spreadprocessing-export-worksheet-to-image-netstandard tags: spreadprocessing, export, worksheet, image, netstandard, xlsx, spread res_type: kb --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2024.1.305 | RadSpreadProcessing |[Yoan Karamanov](https://www.telerik.com/blogs/author/yoan-karamanov)| --- -# Description +## Description This article shows how to export a [Worksheet]({%slug radspreadprocessing-working-with-worksheets-what-is-worksheet%}) to image in .NET Standard using the [RadSpreadProcessing]({%slug radspreadprocessing-overview%}) library. Currently the [Document Processing libraries]({%slug introduction%}) provide image export only for PDF files. This is why the document must first be converted to PDF. -# Solution +## Solution 1. [Import the file as __Workbook__](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsx/xlsxformatprovider#import). 2. Set the desired [Worksheet Page Setup]({%slug radspreadprocessing-features-worksheetpagesetup%}) and [PDF Export Settings]({%slug radspreadprocessing-format-and-conversion-pdf-settings%}). @@ -25,7 +25,7 @@ This article shows how to export a [Worksheet]({%slug radspreadprocessing-workin 6. Make the PDF page the same size. 7. Export the __PDF__ file to image using the [SkiaImageFormatProvider]({%slug radpdfprocessing-formats-and-conversion-image-using-skiaimageformatprovider%}). -# Additional Requirements +## Additional Requirements ### .NET Standard requirements * [SpreadFixedTextMeasurer]({%slug radspreadprocessing-cross-platform-text-measure%}) diff --git a/knowledge-base/spreadprocessing-list-data-validation-cell-range.md b/knowledge-base/spreadprocessing-list-data-validation-cell-range.md index e522b739..7c0cca23 100644 --- a/knowledge-base/spreadprocessing-list-data-validation-cell-range.md +++ b/knowledge-base/spreadprocessing-list-data-validation-cell-range.md @@ -10,7 +10,7 @@ res_type: kb ticketid: 1695747 --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2025.3.806 | RadSpreadProcessing |[Yoan Karamanov](https://www.telerik.com/blogs/author/yoan-karamanov)| diff --git a/knowledge-base/table-header-row-in-pdf-processing.md b/knowledge-base/table-header-row-in-pdf-processing.md index 8382d52d..3dbf3d0a 100644 --- a/knowledge-base/table-header-row-in-pdf-processing.md +++ b/knowledge-base/table-header-row-in-pdf-processing.md @@ -7,7 +7,7 @@ slug: table-header-row-in-pdf-processing tags: pdf, table, header, row, bold res_type: kb --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | @@ -67,12 +67,12 @@ Table header row can be added as a standard TableRow with bold text. ![Table Row Header](images/pdf-table-header-row.png) ->note For .NET Standard projects, it is necessary to implement a FontsProvider to get the correct font: [Fonts]({%slug radpdfprocessing-cross-platform-fonts%}}). +>note For .NET Standard projects, it is necessary to implement a FontsProvider to get the correct font: [Fonts]({%slug radpdfprocessing-cross-platform-fonts%}). ## See Also -* [How to implement FontsProvider]({%slug pdfprocessing-implement-fontsprovider%}}) -* [Fonts]({%slug radpdfprocessing-cross-platform-fonts%}}) +* [How to implement FontsProvider]({%slug pdfprocessing-implement-fontsprovider%}) +* [Fonts]({%slug radpdfprocessing-cross-platform-fonts%}) * [TableCell]({%slug radpdfprocessing-editing-table-tablecell%}) * [Table]({%slug radpdfprocessing-editing-table-overview%}) -* [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}}) +* [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) diff --git a/knowledge-base/update-cell-range-used-in-charts.md b/knowledge-base/update-cell-range-used-in-charts.md index d50ec315..f6cec74e 100644 --- a/knowledge-base/update-cell-range-used-in-charts.md +++ b/knowledge-base/update-cell-range-used-in-charts.md @@ -7,17 +7,17 @@ slug: update-cell-range-used-in-charts tags: chart, cell, range, spread, worksheet, empty, blank res_type: kb --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2024.1.124 | RadSpreadProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)| --- -# Description +## Description When the CellRange used for generating the [chart object]({%slug radspreadprocessing-features-charts-using-charts%}) in a worksheet contains blank/empty values, they are converted to zero values which may change the chart line in an unexpected way. This article demonstrates how to update the chart's CellRange and update the range's end when such empty values are found. Thus, the range with null values is cut. ![Zero values](images/update-cell-range-used-in-charts01.png) -# Solution +## Solution After importing the XLSX document into a Workbook, iterate the chart shapes and limit the CellRange to the first found blank/empty value: diff --git a/knowledge-base/wordsprocessing-add-different-images-when-mailmerging.md b/knowledge-base/wordsprocessing-add-different-images-when-mailmerging.md index a6eff351..367cc5e0 100644 --- a/knowledge-base/wordsprocessing-add-different-images-when-mailmerging.md +++ b/knowledge-base/wordsprocessing-add-different-images-when-mailmerging.md @@ -34,9 +34,9 @@ This article describes how to populate a [RadFlowDocument]({%slug radwordsproces The following example demonstrates how to import a document template using the [DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%}). Then by iterating an array of custom Person elements to implement the logic for inserting differing images in the RadFlowDocument's header ([Headers and Footers]({%slug radspreadprocessing-features-headers-and-footers%})) according to the Person's Account type while performing a [Mail Merge]({%slug radwordsprocessing-editing-mail-merge%}). -#### __[C#] Add Different Images While Mailmerging__ +#### __Add Different Images While Mailmerging__ -{{region wordsprocessing-add-different-images-when-mailmerging1}} +```csharp private const string DevCraftUltimate = "DevCraft Ultimate"; private const string Trial = "Trial"; @@ -89,11 +89,11 @@ The following example demonstrates how to import a document template using the [ Process.Start(new ProcessStartInfo() { FileName = resultFileName, UseShellExecute = true }); } } -{{endregion}} +``` -#### __[C#] Person class__ +#### __Person class__ -{{region wordsprocessing-add-different-images-when-mailmerging2}} +```csharp public class Person { @@ -119,4 +119,4 @@ The following example demonstrates how to import a document template using the [ this.RenewalDate = renewalDate; } } -{{endregion}} +``` diff --git a/knowledge-base/wordsprocessing-fit-image.md b/knowledge-base/wordsprocessing-fit-image.md index 0c9134f3..d4c9dde2 100644 --- a/knowledge-base/wordsprocessing-fit-image.md +++ b/knowledge-base/wordsprocessing-fit-image.md @@ -24,9 +24,9 @@ This article illustrates how you can insert an image in a [RadFlowDocument]({%sl Create an image and compare its size with the size available on the page. If the image is bigger, decrease its size: -#### [C#] Insert and resize image +#### Insert and resize image -{{region kb-wordsprocessing-fit-image}} +```csharp RadFlowDocument document = new RadFlowDocument(); RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document); @@ -44,7 +44,7 @@ Create an image and compare its size with the size available on the page. If the } editor.InsertImageInline(image.ImageSource, image.Size); -{{endregion}} +``` ## See Also diff --git a/knowledge-base/wordsprocessing-preventing-table-row-splitting-html-pdf.md b/knowledge-base/wordsprocessing-preventing-table-row-splitting-html-pdf.md index 1aad64ae..b1ba09a2 100644 --- a/knowledge-base/wordsprocessing-preventing-table-row-splitting-html-pdf.md +++ b/knowledge-base/wordsprocessing-preventing-table-row-splitting-html-pdf.md @@ -10,7 +10,7 @@ res_type: kb ticketid: 1700721 --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2025.3.806 | RadWordsProcessing |[Yoan Karamanov](https://www.telerik.com/blogs/author/yoan-karamanov)| diff --git a/knowledge-base/wordsprocessing-styling-table-of-contents-multilevel-list-numbering.md b/knowledge-base/wordsprocessing-styling-table-of-contents-multilevel-list-numbering.md index 4d3a49f6..6048cb70 100644 --- a/knowledge-base/wordsprocessing-styling-table-of-contents-multilevel-list-numbering.md +++ b/knowledge-base/wordsprocessing-styling-table-of-contents-multilevel-list-numbering.md @@ -10,7 +10,7 @@ res_type: kb ticketid: 1698635 --- -# Environment +## Environment | Version | Product | Author | | --- | --- | ---- | | 2025.3.806 | RadWordsProcessing |[Yoan Karamanov](https://www.telerik.com/blogs/author/yoan-karamanov)| diff --git a/knowledge-base/zip-library-extract-files-from-archieve.md b/knowledge-base/zip-library-extract-files-from-archieve.md index b7e68e5f..0049edf8 100644 --- a/knowledge-base/zip-library-extract-files-from-archieve.md +++ b/knowledge-base/zip-library-extract-files-from-archieve.md @@ -23,9 +23,7 @@ The example is showing how to extract the contents of a zip file to a directory. The following code snippet is iterating all the files in the archive and extracts each file in the respected directory. -#### __C#__ - -{{region kb-zip-unzip-multiple-files-password}} +```csharp using (Stream stream = File.Open("test.zip", FileMode.Open)) { @@ -55,4 +53,4 @@ The following code snippet is iterating all the files in the archive and extract } } -{{endregion}} \ No newline at end of file +``` \ No newline at end of file diff --git a/knowledge-base/zip-unzip-multiple-files-password.md b/knowledge-base/zip-unzip-multiple-files-password.md index 4e976b90..3d2e38f6 100644 --- a/knowledge-base/zip-unzip-multiple-files-password.md +++ b/knowledge-base/zip-unzip-multiple-files-password.md @@ -32,9 +32,7 @@ The example is showing how to all files from a directory to a password-protected The following code snippet is traversing all the files in a directory then add the contents of each file to a new Entry in the ZipArchive. The password for the archive is passed through the DefaultEncryptionSettings class. After zipping all the files a new folder named TestZip is created and the contents of the ZipArchive are unzipped into the new folder. -#### __C#__ - -{{region kb-zip-unzip-multiple-files-password}} +```csharp DefaultEncryptionSettings protectionSettings = new DefaultEncryptionSettings() { Password = "test" }; @@ -81,5 +79,5 @@ The following code snippet is traversing all the files in a directory then add t } } -{{endregion}} +``` diff --git a/knowledge-base/ziplibrary-archive-directory.md b/knowledge-base/ziplibrary-archive-directory.md index 07e4fb1a..e2140e13 100644 --- a/knowledge-base/ziplibrary-archive-directory.md +++ b/knowledge-base/ziplibrary-archive-directory.md @@ -21,9 +21,7 @@ You need to create an archive from the files in a folder. Use [RadZipLibrary]({%slug radziplibrary-overview%}) to create and export the archive. -#### __C#__ - -{{region kb-archive-directory1}} +```csharp class Program { @@ -80,4 +78,4 @@ Use [RadZipLibrary]({%slug radziplibrary-overview%}) to create and export the ar public byte[] Data { get; set; } } -{{endregion}} \ No newline at end of file +``` \ No newline at end of file diff --git a/libraries/radpdfprocessing/concepts/clipping.md b/libraries/radpdfprocessing/concepts/clipping.md index 6915400c..cb3d333a 100644 --- a/libraries/radpdfprocessing/concepts/clipping.md +++ b/libraries/radpdfprocessing/concepts/clipping.md @@ -25,7 +25,7 @@ The __Clipping__ element exposes a single property. __Example 1__ demonstrates how you can create a Clipping element and assign a __RectangleGeometry__ to its Clip property. -#### __[C#] Example 1: Create clipping__ +#### __Example 1: Create clipping__ @@ -39,7 +39,7 @@ All inheritors of the __ContentElementBase__ class expose a __Clipping__ propert __Example 2__ demonstrates how to clip an image using the Clipping created in __Example 1__. -#### __[C#] Example 2: Use clipping__ +#### __Example 2: Use clipping__ diff --git a/libraries/radpdfprocessing/concepts/cmaps.md b/libraries/radpdfprocessing/concepts/cmaps.md index 6216cf61..301a2604 100644 --- a/libraries/radpdfprocessing/concepts/cmaps.md +++ b/libraries/radpdfprocessing/concepts/cmaps.md @@ -23,7 +23,7 @@ The **Telerik[.Windows].Documents.CMapUtils** package provides a default impleme >To use this functionality, you must add a reference to the **Telerik[.Windows].Documents.CMapUtils package**. -#### [C#] Example 1: Register default CMapsProvider +#### Example 1: Register default CMapsProvider After registering the **PredefinedCMapsProvider** class, you will be able to import any document containing a predefined CMap table. diff --git a/libraries/radpdfprocessing/concepts/colors-and-color-spaces.md b/libraries/radpdfprocessing/concepts/colors-and-color-spaces.md index 09f768b4..f1eb45d0 100644 --- a/libraries/radpdfprocessing/concepts/colors-and-color-spaces.md +++ b/libraries/radpdfprocessing/concepts/colors-and-color-spaces.md @@ -32,7 +32,7 @@ Represents an ARGB (alpha, red, green, blue) color. The RgbColor class exposes t __Example 1__ demonstrates how you can create an RgbColor and assign it as Fill of a [Path]({%slug radpdfprocessing-model-path%}) element. -#### __[C#] Example 1: Create RgbColor__ +#### __Example 1: Create RgbColor__ @@ -79,7 +79,7 @@ The __Gradient__ class is inherited by the following classes: __Example 2__ shows how to create a LinearGradient and assign it as the FillColor of a [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}). - #### __[C#] Example 2: Create LinearGradient__ + #### __Example 2: Create LinearGradient__ @@ -97,7 +97,7 @@ The gradient created in __Example 2__ is shown in __Figure 1__. __Example 3__ demonstrates how to create a RadialGradient and assing it as the FillColor of a [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}). - #### __[C#] Example 3: Create RadialGradient__ + #### __Example 3: Create RadialGradient__ @@ -141,7 +141,7 @@ The __TilingBase__ class is inherited from the following classes: Since the __TilingBase__ class implements the __IContentRootElement__ interface like [RadFixedPage]({%slug radpdfprocessing-model-radfixedpage%}), the content of the tiling can be modified using the __FixedContentEditor__ class. __Example 4__ shows how a tiling pattern can be created. -#### __[C#] Example 4: Create tiling__ +#### __Example 4: Create tiling__ diff --git a/libraries/radpdfprocessing/concepts/fonts.md b/libraries/radpdfprocessing/concepts/fonts.md index 662b1ec7..263828dd 100644 --- a/libraries/radpdfprocessing/concepts/fonts.md +++ b/libraries/radpdfprocessing/concepts/fonts.md @@ -104,11 +104,11 @@ If you want to use a font, that is not part of the standard ones, you can regist __Example 1__ demonstrates how you can use the RegisterFont() method. -#### __[C#] Example 1: Register font in .NET Framework application__ +#### __Example 1: Register font in .NET Framework application__ -#### __[C#] Example 1: Register font in .NET Standard application__ +#### __Example 1: Register font in .NET Standard application__ @@ -120,7 +120,7 @@ __Example 1__ demonstrates how you can use the RegisterFont() method. __Example 2__ shows how to create a font using the FontsRepository. -#### __[C#] Example 2: Create FontBase__ +#### __Example 2: Create FontBase__ diff --git a/libraries/radpdfprocessing/concepts/geometry.md b/libraries/radpdfprocessing/concepts/geometry.md index ce8ba299..0d95ef08 100644 --- a/libraries/radpdfprocessing/concepts/geometry.md +++ b/libraries/radpdfprocessing/concepts/geometry.md @@ -45,7 +45,7 @@ __RectangleGeometry__ represents a two-dimensional rectangle. The class exposes __Example 1__ shows how to create a RectangleGeometry. -#### __[C#] Example 1: Create RectangleGeometry__ +#### __Example 1: Create RectangleGeometry__ @@ -67,7 +67,7 @@ PathGeometry represents a complex shape that may be composed of curves and lines __Example 2__ shows how to create a PathGeometry, which consists of line segments and bezier segments. -#### __[C#] Example 2: Create PathGeometry__ +#### __Example 2: Create PathGeometry__ diff --git a/libraries/radpdfprocessing/concepts/imagequality.md b/libraries/radpdfprocessing/concepts/imagequality.md index b1db5ad3..ecea74f7 100644 --- a/libraries/radpdfprocessing/concepts/imagequality.md +++ b/libraries/radpdfprocessing/concepts/imagequality.md @@ -31,7 +31,7 @@ The quality of the images reflects the size of the PDF document. The higher the In order to specify the default **ImageQuality** value when exporting to PDF, you should use the [PdfExportSettings]({%slug radpdfprocessing-formats-and-conversion-pdf-settings%}). -#### __[C#] Example 1: Set a default value for all images in a document__ +#### __Example 1: Set a default value for all images in a document__ @@ -41,7 +41,7 @@ In order to specify the default **ImageQuality** value when exporting to PDF, yo If you need some particular image to be exported with a different **ImageQuality** value, you should specify this value in the constructor of [ImageSource]({%slug radpdfprocessing-model-imagesource%}) in order to override the default one. -#### __[C#] Example 2: Set the image quality of an image__ +#### __Example 2: Set the image quality of an image__ diff --git a/libraries/radpdfprocessing/concepts/position.md b/libraries/radpdfprocessing/concepts/position.md index 2c18c4ba..2bbaedc0 100644 --- a/libraries/radpdfprocessing/concepts/position.md +++ b/libraries/radpdfprocessing/concepts/position.md @@ -60,7 +60,7 @@ The __MatrixPosition__ class exposes a static __Default__ property, which repres __Example 1__ shows how transformations can be appended. -#### __[C#] Example 1: Trasform MatrixPosition__ +#### __Example 1: Trasform MatrixPosition__ @@ -85,7 +85,7 @@ The __SimplePosition__ class exposes a static __Default__ property which represe __Example 2__ shows how transformations overwrite the previous transformations of the same type. -#### __[C#] Example 2: Transform SimplePosition__ +#### __Example 2: Transform SimplePosition__ diff --git a/libraries/radpdfprocessing/cross-platform/images.md b/libraries/radpdfprocessing/cross-platform/images.md index 6f60f4d9..9ab39758 100644 --- a/libraries/radpdfprocessing/cross-platform/images.md +++ b/libraries/radpdfprocessing/cross-platform/images.md @@ -42,7 +42,7 @@ PdfProcessing comes with a default implementation for such resolver called `Imag >note View Implementation [Requirements](#requirements). -#### **[C#] Example 1: Set the default implementation of the ImagePropertiesResolver class** +#### **Example 1: Set the default implementation of the ImagePropertiesResolver class** @@ -68,7 +68,7 @@ The **Telerik.Documents.ImageUtils** package provides a default implementation o >note View Implementation [Requirements](#requirements). -#### **[C#] Example 2: Set the default implementation of the JpegImageConverter class** +#### **Example 2: Set the default implementation of the JpegImageConverter class** @@ -93,11 +93,11 @@ The following `using`/`imports` statements are required in the project: * using SixLabors.ImageSharp.Processing; -#### **[C#] Example 3: Create a custom implementation inheriting the JpegImageConverterBase abstract class** +#### **Example 3: Create a custom implementation inheriting the JpegImageConverterBase abstract class** -#### **[C#] Example 4: Set the custom implementation to the JpegImageConverter property of the FixedExtensibilityManager** +#### **Example 4: Set the custom implementation to the JpegImageConverter property of the FixedExtensibilityManager** diff --git a/libraries/radpdfprocessing/editing/block.md b/libraries/radpdfprocessing/editing/block.md index 4a673da6..38802768 100644 --- a/libraries/radpdfprocessing/editing/block.md +++ b/libraries/radpdfprocessing/editing/block.md @@ -23,7 +23,7 @@ The most common usage of __Block__ is to draw flowing content. Similarly to [Fix Inserting [TextFragments]({%slug radpdfprocessing-model-textfragment%}) is achieved with one of the overloads of the __Insert()__ method. __Example 1__ shows all the overloads which allow specifying the styles and font family. -#### __[C#] Example 1: Insert text__ +#### __Example 1: Insert text__ @@ -36,7 +36,7 @@ Inserting [TextFragments]({%slug radpdfprocessing-model-textfragment%}) is achie Inserting a line break results in the next element starting on a new line. The action is achieved with the __InsertLineBreak()__ method as shown in __Example 2__. -#### __[C#] Example 2: Break the line__ +#### __Example 2: Break the line__ @@ -51,7 +51,7 @@ __Block__ provides the following methods for inserting images: * block.InsertImage(imageSource, width, height); * block.InsertImage(stream, width, height); -#### __[C#] Example 3: Inserting an image__ +#### __Example 3: Inserting an image__ @@ -68,7 +68,7 @@ Information on images in the context of the library is available in the [ImageSo * block.**InsertPath**(geometry); * block.**InsertRectangle**(rectangle); -#### __[C#] Example 4: Inserting a geometry__ +#### __Example 4: Inserting a geometry__ @@ -76,7 +76,7 @@ Information on images in the context of the library is available in the [ImageSo The Form (or also known as Form-XObject) is an object that can contain PDF content and can be sheared among the document. The Block class exposes the **InsertForm()** method that allows you insert a FormSource object in the document. -#### __[C#] Example 5: Insert a form__ +#### __Example 5: Insert a form__ @@ -89,7 +89,7 @@ There are two more overloads of InsertForm() that enables you to pass the size t The following example shows how to insert a link inside the text: -#### __[C#] Example: Insert a text link__ +#### __Example: Insert a text link__ @@ -160,7 +160,7 @@ The __Block__ class has some properties and methods that affect how it will be r * __Clear():__ Clears all elements in the block. -#### __[C#] Example 6: Change Block properties__ +#### __Example 6: Change Block properties__ @@ -170,7 +170,7 @@ The __Block__ class has some properties and methods that affect how it will be r A Block can be drawn to the content using the __Draw()__ method. The method accepts as a parameter a __Rectangle__, specifying the desired size and position relatively to the editor of the element. -#### __[C#] Example 7: Draw block__ +#### __Example 7: Draw block__ @@ -207,7 +207,7 @@ The __Split()__ method of a Block returns a new Block with the same properties. The code in __Example 9__ splits a block in two. The first will contains text "Hello" and the second – "RadPdfProcessing!". -#### __[C#] Example 9: Split block__ +#### __Example 9: Split block__ diff --git a/libraries/radpdfprocessing/editing/fixedcontenteditor.md b/libraries/radpdfprocessing/editing/fixedcontenteditor.md index 2bb211eb..b1bc8a99 100644 --- a/libraries/radpdfprocessing/editing/fixedcontenteditor.md +++ b/libraries/radpdfprocessing/editing/fixedcontenteditor.md @@ -42,7 +42,7 @@ position: 4 __FixedContentEditor__ is always associated with a single [RadFixedPage]({%slug radpdfprocessing-model-radfixedpage%}) (also known as **IContentRootElement**) which it takes as a constructor parameter when it is created. __Example 1__ shows how you can create an editor. -#### __[C#] Example 1: Create FixedContentEditor__ +#### __Example 1: Create FixedContentEditor__ @@ -50,7 +50,7 @@ The editor maintains an internal [Position]({%slug radpdfprocessing-concepts-pos __Example 2__ demonstrates how you can create a FixedContentEditor with a specific initial [Position]({%slug radpdfprocessing-concepts-position%}). -#### __[C#] Example 2: Create FixedContentEditor with a specific position__ +#### __Example 2: Create FixedContentEditor with a specific position__ @@ -62,7 +62,7 @@ Composing a [RadFixedDocument]({%slug radpdfprocessing-model-radfixeddocument%}) Inserting a [TextFragment]({%slug radpdfprocessing-model-textfragment%}) can be done with the __public void DrawText(string text)__ method. __Example 3__ inserts a fragment with content "First text fragment.". -#### __[C#] Example 3: Insert TextFragment__ +#### __Example 3: Insert TextFragment__ @@ -78,7 +78,7 @@ __Figure 1__ shows the result of __Example 3__. __Example 4__ shows how you can use the __Block__ object to draw a paragraph. -#### __[C#] Example 4: Insert paragraph__ +#### __Example 4: Insert paragraph__ @@ -103,7 +103,7 @@ __FixedContentEditor__ provides several overloads for inserting an [Image]({%slu __Example 5__ shows how you can add an image created from a Stream. -#### __[C#] Example 5: Insert image__ +#### __Example 5: Insert image__ @@ -122,7 +122,7 @@ The following methods can be used to insert different [Geometries]({%slug radpdf __Example 6__ shows how you can add an ellipse using one of FixedContentEditor's methods. -#### __[C#] Example 6: Insert ellipse__ +#### __Example 6: Insert ellipse__ @@ -138,7 +138,7 @@ When the returned __IDisposable__ object from the __PushClipping()__ method is d When a new clipping is pushed, it is set as a clipping to the current clipping in the editor. __Example 7__ shows how a clipping can be pushed. -#### __[C#] Example 7: Push clipping__ +#### __Example 7: Push clipping__ @@ -153,7 +153,7 @@ __FixedContentEditor__ exposes __DrawTable()__ method, which allows you to easil __Example 8__ generates a table and draws it in some fixed size. -#### __[C#] Example 8: Insert table__ +#### __Example 8: Insert table__ @@ -167,7 +167,7 @@ More detailed information about tables is available in the [Table]({%slug radpdf With the FixedContentEditor class you can insert a Form (Form-XObject) element. -#### __[C#] Example 9: Insert a form__ +#### __Example 9: Insert a form__ There are two more overloads of DrawForm() that enable you to pass the size that should be used for the form. @@ -180,13 +180,13 @@ The Widget annotations allow you visualize the content of a FormField. With the * **DrawWidget(FormField parentField, Size annotationSize)**: Creates new [Widget]({%slug radpdfprocessing-model-annotations-widgets%}) representing the [FormField]({%slug radpdfprocessing-model-interactive-forms-form-fields%}) instance passed as a parameter and draws the widget with the specified annotation size. This method will add widget only in cases when the root of the FixedContentEditor supports annotations. - #### **[C#] Example 10: Insert PushButtonField with PushButtonWidget using DrawWidget** + #### **Example 10: Insert PushButtonField with PushButtonWidget using DrawWidget** * **DrawWidget(RadioButtonField parentField, RadioOption option, Size annotationSize)**: Creates new [RadioButtonWidget]({%slug radpdfprocessing-model-annotations-widgets%}#radiobuttonwidget-class) and draws the widget with the specified annotation size. This method will add widget only in cases when the root of the FixedContentEditor supports annotations. The second parameter represents the option that should be visualized by the widget. - #### **[C#] Example 11: Insert RadioButtonField with RadioButtonWidget using DrawWidget** + #### **Example 11: Insert RadioButtonField with RadioButtonWidget using DrawWidget** @@ -196,7 +196,7 @@ The [Position]({%slug radpdfprocessing-concepts-position%}) property exposed by The code in __Example 12__ shows how to manipulate the position of the inserted content elements and __Figure 5__ shows the result of the code. -#### __[C#] Example 12: Scale and rotate content__ +#### __Example 12: Scale and rotate content__ diff --git a/libraries/radpdfprocessing/editing/list.md b/libraries/radpdfprocessing/editing/list.md index aa12d7ef..69f6feef 100644 --- a/libraries/radpdfprocessing/editing/list.md +++ b/libraries/radpdfprocessing/editing/list.md @@ -34,7 +34,7 @@ Each List contains a __ListLevelCollection__ where the presentation of each list The code snippet from __Example 1__ shows how to create a list with NumberedParentheses template. -#### __[C#] Example 1: Create numbered parentheses list template type__ +#### __Example 1: Create numbered parentheses list template type__ @@ -65,7 +65,7 @@ When you need to create a custom List, you should define the presentation of eac __Example 2__ shows how to create an empty list and add two custom list levels to its __ListLevelsCollection__. Level 0 has a bullet which displays its current numbering as two digit number with a leading zero. Level 1 displays a checkbox as a bullet symbol for all of the corresponding list items. Additionally, each of the levels defines custom values for the __LeftIndent__, __ForegroundColor__ and __IndentAfterBullet__ properties. -#### __[C#] Example 2: Create custom list levels__ +#### __Example 2: Create custom list levels__ @@ -82,7 +82,7 @@ If you require using a text bullet, you may use __TextBulletNumberingFormat__ cl The following code snippet shows how to create the bullets of a numbered hierarchical list using __TextBulletNumberingFormat__ class: -#### __[C#] Example 3: Create custom text numbering bullet__ +#### __Example 3: Create custom text numbering bullet__ @@ -98,7 +98,7 @@ In order to use lists with __RadFixedDocumentEditor__, you should first add them __Example 4__ shows how to create a list with __RadFixedDocumentEditor__ and insert a single item for each of the list levels. The appearance of the list is from the values in the predefined __ListTemplateType__ enumeration -#### __[C#] Example 4: Using lists with RadFixedDocumentEditor__ +#### __Example 4: Using lists with RadFixedDocumentEditor__ @@ -115,7 +115,7 @@ As the __Block__ class has __Bullet__ and __IndentAfterBullet__ properties you c The following code snippet shows how to create __List__ with __BulletDefault__ template and set the bullet of the first list level to a Block: -#### __[C#] Example 5: Using lists with Block class__ +#### __Example 5: Using lists with Block class__ diff --git a/libraries/radpdfprocessing/editing/radfixeddocumenteditor.md b/libraries/radpdfprocessing/editing/radfixeddocumenteditor.md index 51b56473..18d0cae0 100644 --- a/libraries/radpdfprocessing/editing/radfixeddocumenteditor.md +++ b/libraries/radpdfprocessing/editing/radfixeddocumenteditor.md @@ -32,7 +32,7 @@ position: 6 __Example 1__ demonstrates how a RadFixedDocumentEditor instance can be created. -#### __[C#] Example 1: Create RadFixedDocumentEditor__ +#### __Example 1: Create RadFixedDocumentEditor__ @@ -59,7 +59,7 @@ The section properties are responsible for the page size, margins and orientatio * __Rotate180__: The page is rotated to 180°. * __Rotate270__: The page is rotated to 270°. -#### __[C#] Example 2: Setting section properties__ +#### __Example 2: Setting section properties__ @@ -69,7 +69,7 @@ The first section of a document starts as soon as a content is inserted to the e Adding an additional section is achieved with the __InsertSectionBreak()__ method as demonstrated in __Example 2__. -#### __[C#] Example 3: Start a section__ +#### __Example 3: Start a section__ @@ -78,7 +78,7 @@ Adding an additional section is achieved with the __InsertSectionBreak()__ metho ### Starting New Page All pages that have the same __SectionProperties__ are part of the current section. To start a new page, you can use the following code: -#### __[C#] Example 4: Start new page__ +#### __Example 4: Start new page__ @@ -114,7 +114,7 @@ Similar to the section properties, paragraph has its own properties that are res * __ListLevel__: The list level the paragraph belongs to. -#### __[C#] Example 5: Setting paragraph properties__ +#### __Example 5: Setting paragraph properties__ @@ -124,7 +124,7 @@ The first paragraph is created as soon as content is inserted in the editor. You In order to start a new paragraph, use the code in __Example 4__. -#### __[C#] Example 6: Start a paragraph__ +#### __Example 6: Start a paragraph__ @@ -169,7 +169,7 @@ The character properties that are responsible for the look of the runs are liste * __StrikethroughColor__: The color of the strikethrough. -#### __[C#] Example 7: Setting CharacterProperties__ +#### __Example 7: Setting CharacterProperties__ @@ -181,7 +181,7 @@ The character properties that are responsible for the look of the runs are liste There are a number of overloads that insert a run. The code snippet in __Example 5__ inserts new runs with specific font family, style and weight. -#### __[C#] Example 8: Insert run__ +#### __Example 8: Insert run__ @@ -192,7 +192,7 @@ There are a number of overloads that insert a run. The code snippet in __Example The code in __Example 9__ inserts a new run and a line break after it. -#### __[C#] Example 9: Insert run and line break__ +#### __Example 9: Insert run and line break__ @@ -204,7 +204,7 @@ Image inline is a combination of an [ImageSource]({%slug radpdfprocessing-model- You can insert image inline using one of the following methods: -#### __[C#] Example 10: Insert image__ +#### __Example 10: Insert image__ @@ -213,7 +213,7 @@ You can insert image inline using one of the following methods: The __Table__ class implements the __IBlockElement__ interface and an instance of this class can be easily inserted as a new block in the document. You could insert the table using the __InsertTable()__ method like illustrated in __Example 8__. __RadFixedDocumentEditor__ takes care for positioning, measuring and splitting the table onto pages. -#### __[C#] Example 11: Insert table__ +#### __Example 11: Insert table__ @@ -223,7 +223,7 @@ For more detailed information on tables, check the [Table]({%slug radpdfprocessi The [IBlockElement](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Flow.IBlockElement.html) interface allows you to easily draw and split some block content onto pages. The interface is implemented by [Block]({%slug radpdfprocessing-editing-block%}) and [Table]({%slug radpdfprocessing-editing-table-overview%}) classes. You can easily add some block element instance with RadFixedDocumentEditor using the InsertBlock() method like illustrated in __Example 9__. -#### __[C#] Example 12: Insert Block element__ +#### __Example 12: Insert Block element__ @@ -233,7 +233,7 @@ You can easily insert list items with __RadFixedDocumentEditor__. The first thin The following code snippet shows how to add a new list to __RadFixedDocumentEditor’s ListCollection__ and after that insert a paragraph with the corresponding list properties: -#### __[C#] Example 13: Insert list__ +#### __Example 13: Insert list__ @@ -243,7 +243,7 @@ More detailed information about lists is available in the [List documentation ar With the RadFixedDocumentEditor class you can insert a Form (Form-XObject) element. -#### __[C#] Example 14: Insert a form__ +#### __Example 14: Insert a form__ There is an additional overload of InsertFormInline() that enables you to pass the size that should be used for the form. diff --git a/libraries/radpdfprocessing/editing/table/overview.md b/libraries/radpdfprocessing/editing/table/overview.md index c03c7aa1..9320ab62 100644 --- a/libraries/radpdfprocessing/editing/table/overview.md +++ b/libraries/radpdfprocessing/editing/table/overview.md @@ -34,7 +34,7 @@ Each table contains a series of [TableRow]({%slug radpdfprocessing-editing-table __Example 1__ shows how to generate a simple table with two rows and three columns with some sample text in each table cell. -#### __[C#] Example 1: Create simple table__ +#### __Example 1: Create simple table__ @@ -57,7 +57,7 @@ If you want to apply default styling to all the cells in a table, you can use Ta __Example 2__ shows how to use the __DefaultCellProperties__ of a table -#### __[C#] Example 2: Use DefaultCellProperties of Table__ +#### __Example 2: Use DefaultCellProperties of Table__ @@ -93,21 +93,21 @@ There are several factors that affect tables measuring calculations. Some of the __Example 3__ demonstrates how border calculations occur with different __BorderCollapse__ option. The code in this example creates an empty table and sets default cell padding and red table border with thickness 10 to it. -#### __[C#] Example 3: Create table with red border__ +#### __Example 3: Create table with red border__ __Example 4__ adds a single row with two cells to the table from __Example 3__. The first cell has a green border with thickness 5 while the second cell has a blue border with thickness 3. -#### __[C#] Example 4: Add green and blue cells__ +#### __Example 4: Add green and blue cells__ __Figure 3__ shows the table from Example 3 and 4 with BorderCollapse property set to Collapse - all borders are drawn so that their middle lines coincide. -#### __[C#] Example 5: Collapse border__ +#### __Example 5: Collapse border__ @@ -117,7 +117,7 @@ __Figure 3__ shows the table from Example 3 and 4 with BorderCollapse property s __Figure 4__ shows the same table with BorderCollapse property set to Separate - all borders are drawn so that their outer contour coincide. -#### __[C#] Example 6: Separate border__ +#### __Example 6: Separate border__ @@ -132,14 +132,14 @@ When a table is generated, it could be inserted in the PDF document using the __ __Example 7__ generates a simple table with two cells. -#### __[C#] Example 7: Create table__ +#### __Example 7: Create table__ __Example 8__ inserts the table from __Example 7__ in a RadFixedDocumentEditor and specifies the table layout type to AutoFit. -#### __[C#] Example 8: Insert AutoFit table__ +#### __Example 8: Insert AutoFit table__ @@ -152,7 +152,7 @@ The result is that the table width is exactly as needed for fitting the cells co Specifying FixedWidth layout option produces different results. -#### __[C#] Example 9: Insert FixedWidth table__ +#### __Example 9: Insert FixedWidth table__ @@ -167,7 +167,7 @@ When in need of more customization options, you can use the __DrawTable()__ meth __Example 10__ shows how to draw a rotated table with the help of FixedContentEditor. -#### __[C#] Example 10: Draw rotated table__ +#### __Example 10: Draw rotated table__ diff --git a/libraries/radpdfprocessing/editing/table/tablecell.md b/libraries/radpdfprocessing/editing/table/tablecell.md index fbbd698b..3359a9e4 100644 --- a/libraries/radpdfprocessing/editing/table/tablecell.md +++ b/libraries/radpdfprocessing/editing/table/tablecell.md @@ -27,7 +27,7 @@ In order to add a cell to a __Table__, you should add it in the __TableCellColle The code snippet in __Example 1__ shows how to create a table with a single row and add a cell in the first row. -#### __[C#] Example 1: Create TableCell__ +#### __Example 1: Create TableCell__ @@ -39,7 +39,7 @@ Using __TableCell__'s __Blocks__ property you can easily add one or several __IB __Example 2__ shows how to create a cell with a single [Block]({%slug radpdfprocessing-editing-block%}) in it. -#### __[C#] Example 2: Add content to TableCell__ +#### __Example 2: Add content to TableCell__ @@ -69,7 +69,7 @@ You can easily change the cell's presentation by using the following properties: __Example 3__ demonstrates how to set locally the cell properties to a specific cell. This helps achieve different appearance for this cell by changing its borders and background. Additionally, the cell will span onto two rows and two columns. -#### __[C#] Example 1: Change TableCell appearance__ +#### __Example 1: Change TableCell appearance__ diff --git a/libraries/radpdfprocessing/editing/table/tablerow.md b/libraries/radpdfprocessing/editing/table/tablerow.md index 9f18341d..eaab4cf2 100644 --- a/libraries/radpdfprocessing/editing/table/tablerow.md +++ b/libraries/radpdfprocessing/editing/table/tablerow.md @@ -26,7 +26,7 @@ You can easily add a __TableRow__ instance by using the __AddTableRow()__ method The code snippet in __Example 1__ shows how to create a table and add a single row to it. -#### __[C#] Example 1: Create TableRow__ +#### __Example 1: Create TableRow__ @@ -38,7 +38,7 @@ In order to manipulate the cells in a row you can use TableRow's __Cells__ prope __Example 2__ shows how to add two cells in a row and get the cells count. -#### __[C#] Example 2: Access cells in a TableRow__ +#### __Example 2: Access cells in a TableRow__ @@ -56,7 +56,7 @@ Since **Q1 2025** you can easily configure the TablRow's height through its **He __Example 3__ creates a table with three single-cell rows, each with a different **HeightType**. -#### __[C#] Example 3: Set TableRow height__ +#### __Example 3: Set TableRow height__ diff --git a/libraries/radpdfprocessing/editing/text-and-graphic-properties.md b/libraries/radpdfprocessing/editing/text-and-graphic-properties.md index 8110820e..873fe14b 100644 --- a/libraries/radpdfprocessing/editing/text-and-graphic-properties.md +++ b/libraries/radpdfprocessing/editing/text-and-graphic-properties.md @@ -37,7 +37,7 @@ These properties are used to hold the current graphics control parameters. The f * __StrokeLineCap__: The stroke line cap for graphic elements. The property is of type [LineCap](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Graphics.LineCap.html). -#### [C#] Example 1: Using GraphicProperties with FixedContentEditor +#### Example 1: Using GraphicProperties with FixedContentEditor @@ -79,7 +79,7 @@ These properties hold the parameters used for text fragments. The following para * __VerticalAlignment__: The vertical positioning of the inserted text in the text block. The property is of type [VerticalAlignment](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Flow.VerticalAlignment.html). -#### [C#] Example 2: Using TextProperties with Block +#### Example 2: Using TextProperties with Block diff --git a/libraries/radpdfprocessing/features/digital-signature/external-digital-signing.md b/libraries/radpdfprocessing/features/digital-signature/external-digital-signing.md index d2f2a8c2..84689e11 100644 --- a/libraries/radpdfprocessing/features/digital-signature/external-digital-signing.md +++ b/libraries/radpdfprocessing/features/digital-signature/external-digital-signing.md @@ -26,7 +26,7 @@ The supported digest (hash) algorithms for producing CMS (PKCS #7) PDF signature The following example demonstrates how to implement the **IExternalSigner** interface producing an external CMS (PKCS #7) detached signature over a PDF byte range: -#### [C#] CMS External Signer +#### CMS External Signer @@ -41,7 +41,7 @@ The PdfProcessing library allows creating a base helper implementation for build The following example implements external RSA-based digital signing for PDF documents deriving the ExternalSignerBase class. **RSA** (Rivest–Shamir–Adleman) algorithm is a widely used asymmetric cryptographic algorithm. RSA generates a **private key** and a **public key** where the private key is used to sign the PDF and the public key is used to verify the signature. During the signing process a hash (digest) of the PDF content is created (e.g., using SHA-512). This hash is then encrypted with the RSA private key to create the digital signature. The signature is embedded in the PDF file, typically in a signature field. -#### [C#] RSA External Signer +#### RSA External Signer diff --git a/libraries/radpdfprocessing/features/digital-signature/getting-started.md b/libraries/radpdfprocessing/features/digital-signature/getting-started.md index eac22f41..9c07c126 100644 --- a/libraries/radpdfprocessing/features/digital-signature/getting-started.md +++ b/libraries/radpdfprocessing/features/digital-signature/getting-started.md @@ -29,7 +29,7 @@ To sign a document, follow the steps: The following example shows a full code snippet for a simple signing of a newly created document: -#### **[C#] Example: Sign a document** +#### **Example: Sign a document** @@ -61,7 +61,7 @@ RadPdfProcessing enables you to sign and validate signature fields using standar The signature flags were introduced in R2022 SP1. You can set the flags with the following code: -#### **[C#] Example: Set signature flags** +#### **Example: Set signature flags** diff --git a/libraries/radpdfprocessing/features/digital-signature/signature-validation.md b/libraries/radpdfprocessing/features/digital-signature/signature-validation.md index 49da13de..16694335 100644 --- a/libraries/radpdfprocessing/features/digital-signature/signature-validation.md +++ b/libraries/radpdfprocessing/features/digital-signature/signature-validation.md @@ -28,7 +28,7 @@ The Signature class exposes two methods that allow you to validate a signature: The following example shows how the validation can be used: -#### **[C#] Example: Validate a field** +#### **Example: Validate a field** diff --git a/libraries/radpdfprocessing/features/embedded-file-streams/embedded-file-streams.md b/libraries/radpdfprocessing/features/embedded-file-streams/embedded-file-streams.md index 5bbe2ef3..702e2a91 100644 --- a/libraries/radpdfprocessing/features/embedded-file-streams/embedded-file-streams.md +++ b/libraries/radpdfprocessing/features/embedded-file-streams/embedded-file-streams.md @@ -20,7 +20,7 @@ RadFixedDocument stores the integrated files in an **EmbeddedFilesCollection** a ### Creating an Embedded File Stream -#### **[C#] Creating an embedded file stream** +#### **Creating an embedded file stream** @@ -43,7 +43,7 @@ The **MergedEmbeddedFileNameResolving** event occurs when trying to resolve conf |**NewName**|Gets or sets the new embedded file name.| |**UsedNames**|Gets the names that are already used for embedded files in the same RadFixedDocument.| -#### **[C#] Resolving Duplicated Names** +#### **Resolving Duplicated Names** diff --git a/libraries/radpdfprocessing/features/embedded-file-streams/zugferd-invoices.md b/libraries/radpdfprocessing/features/embedded-file-streams/zugferd-invoices.md index bfcb7bbf..d64b421b 100644 --- a/libraries/radpdfprocessing/features/embedded-file-streams/zugferd-invoices.md +++ b/libraries/radpdfprocessing/features/embedded-file-streams/zugferd-invoices.md @@ -16,7 +16,7 @@ position: 1 ### Creating an Embedded Electronic (ZUGFeRD) Invoice -#### **[C#] Add ZUGFeRD invoice** +#### **Add ZUGFeRD invoice** @@ -24,7 +24,7 @@ position: 1 >important To comply with the PDF/A-3B standard all the fonts in the documents should be embedded, so please avoid using [Standard Fonts]({%slug radpdfprocessing-concepts-fonts%}) because they are not being embedded in the document. In **.NET Standard/.NET (Target OS: None)** environments, fonts beyond the [14 standard ones]({%slug radpdfprocessing-concepts-fonts%}#standard-fonts) require a [FontsProvider implementation]({%slug pdfprocessing-implement-fontsprovider%}) to be resolved correctly. -#### **[C#] Remove ZUGFeRD invoice** +#### **Remove ZUGFeRD invoice** diff --git a/libraries/radpdfprocessing/features/flatten-form-fields.md b/libraries/radpdfprocessing/features/flatten-form-fields.md index c862830b..0800c151 100644 --- a/libraries/radpdfprocessing/features/flatten-form-fields.md +++ b/libraries/radpdfprocessing/features/flatten-form-fields.md @@ -16,7 +16,7 @@ There are two methods that you can use for this. One to flatten all fields and o The __FlattenFormFields__ method does not take any parameters and will flatten all fields inside the document. -#### __[C#] Example 1: Flatten all fields__ +#### __Example 1: Flatten all fields__ @@ -24,7 +24,7 @@ The __FlattenFormFields__ method does not take any parameters and will flatten a The __FlattenFormField__ method takes the field that should be flattened as a parameter. The field must belong to the same document. -#### __[C#] Example 2: Flatten single field__ +#### __Example 2: Flatten single field__ diff --git a/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/complete-context-question-processor.md b/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/complete-context-question-processor.md index 8b7589f9..5c458839 100644 --- a/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/complete-context-question-processor.md +++ b/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/complete-context-question-processor.md @@ -56,7 +56,7 @@ The **CompleteContextProcessorSettings** class defines configuration options for The following example demonstrates how to use the **CompleteContextQuestionProcessor** to ask questions about a PDF document, including working with specific document pages. For setting up the AI client as shown in this example, see the [AI Provider Setup]({%slug radpdfprocessing-features-gen-ai-powered-document-insights-prerequisites%}#ai-provider-setup) section: -#### __[C#] Example 1: Using CompleteContextQuestionProcessor__ +#### __Example 1: Using CompleteContextQuestionProcessor__ diff --git a/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/getting-started.md b/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/getting-started.md index bd63f7af..50c721bd 100644 --- a/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/getting-started.md +++ b/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/getting-started.md @@ -16,7 +16,7 @@ The following example demonstrates how to use the GenAI-powered Document Insight >important For .NET {{site.mindotnetversion}}+ (Target OS Windows) with [Packages for .NET {{site.mindotnetversion}} and .NET {{site.maxdotnetversion}} for Windows]({%slug available-nuget-packages%}#packages-for-net-framework-and-net-{{site.mindotnetversion}}-and-net-{{site.maxdotnetversion}}-for-windows), an [IEmbedder]({%slug radpdfprocessing-features-gen-ai-powered-document-insights-partial-context-question-processor%}#implementing-custom-iembedder) implementation is required for the [PartialContextQuestionProcessor]({%slug radpdfprocessing-features-gen-ai-powered-document-insights-partial-context-question-processor%}). -#### __[C#] Example 1: Using GenAI-powered Document Insights__ +#### __Example 1: Using GenAI-powered Document Insights__ diff --git a/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/prerequisites.md b/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/prerequisites.md index cd9d8877..ac7c4661 100644 --- a/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/prerequisites.md +++ b/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/prerequisites.md @@ -69,7 +69,7 @@ Before using the GenAI-powered Document Insights functionality, you need to set >caution The following code snippet is valid for Microsoft.Extensions.AI.OpenAI 9.3. The specific **IChatClient** initialization may be different according to the specific version. -#### __[C#] Example 1: Setting up Azure OpenAI__ +#### __Example 1: Setting up Azure OpenAI__ @@ -78,7 +78,7 @@ Before using the GenAI-powered Document Insights functionality, you need to set 1. Create an OpenAI account. 2. Get your API key from the OpenAI dashboard. -#### __[C#] Example 2: Setting up OpenAI__ +#### __Example 2: Setting up OpenAI__ @@ -90,7 +90,7 @@ Ollama allows you to run AI models locally on your machine. This is useful for d 2. Pull the model you want to use. 3. Start the Ollama server. -#### __[C#] Example 3: Setting up Ollama__ +#### __Example 3: Setting up Ollama__ diff --git a/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/summarization-processor.md b/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/summarization-processor.md index d22084e8..8529c66d 100644 --- a/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/summarization-processor.md +++ b/libraries/radpdfprocessing/features/gen-ai-powered-document-insights/summarization-processor.md @@ -46,7 +46,7 @@ The **SummarizationProcessorSettings** class defines configuration options for t * **ModelMaxInputTokenLimit**: The maximum input token limit for the model. * **PromptAddition**: An addition for the prompt used for summarization. It can be used for clarification purposes. -#### __[C#] Example 1: Configuring SummarizationProcessorSettings__ +#### __Example 1: Configuring SummarizationProcessorSettings__ @@ -64,7 +64,7 @@ For large documents that exceed the token limit of the model, **SummarizationPro This approach allows the processor to efficiently handle documents of any size, but it increases the number of API calls required. The **SummaryResourcesCalculated** event provides information about the expected resource usage, allowing you to decide whether to proceed with the operation. -#### __[C#] Example 2: Using SummarizationProcessor__ +#### __Example 2: Using SummarizationProcessor__ diff --git a/libraries/radpdfprocessing/features/handling-document-exceptions.md b/libraries/radpdfprocessing/features/handling-document-exceptions.md index 48017ed2..d9de0821 100644 --- a/libraries/radpdfprocessing/features/handling-document-exceptions.md +++ b/libraries/radpdfprocessing/features/handling-document-exceptions.md @@ -31,7 +31,7 @@ To use this functionality you should handle the __PdfImportSettings.DocumentUnha When using the **OnDemand** reading mode you should handle the __RadFixedDocument.DocumentUnhandledException__ event. The __Handled__ option in the event arguments indicates if the exception is handled by the code in the event handler or the exception should be thrown. -#### __C# Example 2: Using the DocumentUnhandledException event while loading on demand__ +#### __Example 2: Using the DocumentUnhandledException event while loading on demand__ @@ -40,7 +40,7 @@ When using the **OnDemand** reading mode you should handle the __RadFixedDocumen As of **Q1 2025** the [PdfExportSettings]({%slug radpdfprocessing-formats-and-conversion-pdf-settings%}#export-settings) offers the **DocumentUnhandledException** event which allows you to handle exceptions while exporting a document. -#### __C# Example 3: Using the DocumentUnhandledException event while exporting__ +#### __Example 3: Using the DocumentUnhandledException event while exporting__ diff --git a/libraries/radpdfprocessing/features/search.md b/libraries/radpdfprocessing/features/search.md index 5332e534..53c0fa53 100644 --- a/libraries/radpdfprocessing/features/search.md +++ b/libraries/radpdfprocessing/features/search.md @@ -17,7 +17,7 @@ This feature allows you to search for a specific text in a PDF document. You can This class exposes methods for searching. You need to pass an instance of [RadFixedDocument]({%slug radpdfprocessing-model-radfixeddocument%}) when creating a new instance. This is the document that will be searched. -#### __[C#] Example 1: Create TextSearch Instance__ +#### __Example 1: Create TextSearch Instance__ @@ -40,7 +40,7 @@ All of the above methods return one or more instances of the **SearchResult** cl * **GetWordBoundingRect():** Gets the rectangle of the current match. * **GetResultPage():** Gets the page where the current result is. -#### __[C#] Example 2: Searching in a document__ +#### __Example 2: Searching in a document__ diff --git a/libraries/radpdfprocessing/features/viewer-preferences.md b/libraries/radpdfprocessing/features/viewer-preferences.md index 006352a7..73669286 100644 --- a/libraries/radpdfprocessing/features/viewer-preferences.md +++ b/libraries/radpdfprocessing/features/viewer-preferences.md @@ -34,7 +34,7 @@ The ViewerPreferences class provides the following properties: >important If a document is created with the PDF/A-1a, PDF/A-2a, PDF/A-3a, or PDF/UA-1 standard, the **ShouldDisplayDocumentTitle** setting is automatically set to **true** to comply with the standard's [accessability]({%slug create-accessible-pdf-documents%}) requirements. -#### **[C#] Example: Setting viewer preferences** +#### **Example: Setting viewer preferences** You can access and modify viewer preferences through the **ViewerPreferences** property of the **RadFixedDocument** class. diff --git a/libraries/radpdfprocessing/formats-and-conversion/convert-to-image/using-image-format-provider.md b/libraries/radpdfprocessing/formats-and-conversion/convert-to-image/using-image-format-provider.md index d04ccece..c5ac58f0 100644 --- a/libraries/radpdfprocessing/formats-and-conversion/convert-to-image/using-image-format-provider.md +++ b/libraries/radpdfprocessing/formats-and-conversion/convert-to-image/using-image-format-provider.md @@ -30,14 +30,14 @@ A [FontsProvider](https://docs.telerik.com/devtools/document-processing/librarie To convert your documents' pages to images, use the __Export__ method. Note that the export method does not accept a document but a page. This is why you need to iterate all pages. In this example, each page is saved in a separate file. -#### __[C#] Example 1: Export RadFixedDocument to Image__ +#### __Example 1: Export RadFixedDocument to Image__ ## Exporting Asynchronously The __ExportAsync__ method allows you to perform the conversion asynchronously. -#### __[C#] Example 2: Export RadFixedDocument to Image Async__ +#### __Example 2: Export RadFixedDocument to Image Async__ diff --git a/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfformatprovider/pdfformatprovider.md b/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfformatprovider/pdfformatprovider.md index bc2585bc..f47c9ca3 100644 --- a/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfformatprovider/pdfformatprovider.md +++ b/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfformatprovider/pdfformatprovider.md @@ -36,7 +36,7 @@ __Example 1__ shows how to use PdfFormatProvider to import a PDF document from a -#### __[C#] Example 1: Import PDF file__ +#### __Example 1: Import PDF file__ @@ -55,7 +55,7 @@ The result from the import method is a [__RadFixedDocument__]({%slug radpdfproce __Example 2__ shows how to use the __Export()__ method of __PdfFormatProvider__ to export __RadFixedDocument__ to a file. -#### __[C#] Example 2: Export PDF file__ +#### __Example 2: Export PDF file__ diff --git a/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdffilesource.md b/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdffilesource.md index c4ddb184..f8c7fe03 100644 --- a/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdffilesource.md +++ b/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdffilesource.md @@ -17,14 +17,14 @@ The **PdfFileSource** class represents the content of an existing PDF file. To create an instance of PdfFileSource, you should pass a **FileStream** object, containing the PDF document, to the constructor of the class. -#### **[C#] Example 1: Create a PdfFileSource** +#### **Example 1: Create a PdfFileSource** PdfFileSource exposes also an additional overload, which allows you to keep the stream you are working with open after disposing the PdfFileSource instance by passing **true** as a value for the second constructor parameter (*leaveStreamOpen*). An additional option you can use is the overload that accepts a parameter of type [**PdfImportSettings**]({%slug radpdfprocessing-formats-and-conversion-pdf-settings%}#import-settings). This overload enables you to handle password encrypted documents. -#### **[C#] Example 2: Open encrypted document** +#### **Example 2: Open encrypted document** >PdfFileSource inherits from [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx). Make sure the object is disposed when you are done with it. The best way to ensure this is handled properly is to wrap it in a using statement. @@ -33,7 +33,7 @@ An additional option you can use is the overload that accepts a parameter of typ PdfFileSource exposes the **Pages** property, which is of type [PdfPageSource]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdfpagesource%})[] and allows you access the pages of the imported document. -#### **[C#] Example 3: Iterate the pages of a document** +#### **Example 3: Iterate the pages of a document** >You can use the indexer of the Pages property to obtain a specific page of the document and split it. Then, you can save the separated page using [PdfStreamWriter]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdfstreamwriter%}). diff --git a/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfpagesource.md b/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfpagesource.md index 7966882a..c81ece0c 100644 --- a/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfpagesource.md +++ b/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfpagesource.md @@ -17,7 +17,7 @@ The **PdfPageSource** class represents the page content of an existing PDF file. An instance of the PdfPageSource class can be obtained using the **Pages** property of [PdfFileSource]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdffilesource%}). -#### **[C#] Example 1: Obtain an instance of PdfPageSource** +#### **Example 1: Obtain an instance of PdfPageSource** @@ -32,7 +32,7 @@ PdfPageSource exposes the following properties to give you information about the **Example 2** shows how you can use PdfPageSource to merge the pages of several documents into a single one. -#### **[C#] Example 2: Merge the pages of several documents** +#### **Example 2: Merge the pages of several documents** diff --git a/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfpagestreamwriter.md b/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfpagestreamwriter.md index 31b79990..98fa0877 100644 --- a/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfpagestreamwriter.md +++ b/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfpagestreamwriter.md @@ -18,7 +18,7 @@ The **PdfPageStreamWriter** class provides API allowing you to write and positio An instance of the PdfPageStreamWriter class can be obtained using the **BeginPage()** method of [PdfSteamWriter]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfstreamwriter-pdfstreamwriter%}). -#### **[C#] Example 1: Instantiate PdfPageStreamWriter** +#### **Example 1: Instantiate PdfPageStreamWriter** diff --git a/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfstreamwriter.md b/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfstreamwriter.md index 811ab071..95f11535 100644 --- a/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfstreamwriter.md +++ b/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfstreamwriter/pdfstreamwriter.md @@ -27,7 +27,7 @@ The **PdfStreamWriter** class enables you to write file content directly to a St To create an object of type PdfSteamWriter, you should pass it the Stream of the file, which you would like to work with, as a constructor parameter. -#### **[C#] Example 1: Instantiate PdfStreamWriter** +#### **Example 1: Instantiate PdfStreamWriter** @@ -45,7 +45,7 @@ The constructor of **PdfStreamWriter** enables you to use any class inheriting f >- All the data is flushed into the stream when disposing PdfStreamWriter. It is important to dispose the object prior to further processing the MemoryStream so you can ensure that all the required document data is saved inside; -#### **[C#] Example 2: Instantiate PdfStreamWriter with MemoryStream** +#### **Example 2: Instantiate PdfStreamWriter with MemoryStream** @@ -55,13 +55,13 @@ The members of the class allow you to set several properties of the document you * **BeginPage()**: The BeginPage() method returns an instance of the **PdfPageStreamWriter** class, which is responsible to draw the content of the page. More information about this class is available in the [PdfPageStreamWriter article](). The overloads of BeginPage() allow you to pass the size and the [Rotation](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Data.Rotation.html) of the page. - #### **[C#] Example 3: Insert a new page into a document** + #### **Example 3: Insert a new page into a document** * **WritePage()**: The WritePage() methods enable you to pass an already constructed page object. With the different overloads, you can pass an instance of [**RadFixedPage**]() and [**PdfPageStreamWriter**](). - #### **[C#] Example 4: Insert an already generated page into a document** + #### **Example 4: Insert an already generated page into a document** diff --git a/libraries/radpdfprocessing/formats-and-conversion/plain-text/settings.md b/libraries/radpdfprocessing/formats-and-conversion/plain-text/settings.md index a419242f..311b6bb2 100644 --- a/libraries/radpdfprocessing/formats-and-conversion/plain-text/settings.md +++ b/libraries/radpdfprocessing/formats-and-conversion/plain-text/settings.md @@ -30,7 +30,7 @@ The constructor of the **TextFormatProviderSettings** class has two overloads: **Example 1** shows how to create and specify a particular setting. -#### **[C#] Example 1: Create TextFormatProviderSettings** +#### **Example 1: Create TextFormatProviderSettings** @@ -39,7 +39,7 @@ The constructor of the **TextFormatProviderSettings** class has two overloads: The __Export()__ method of **TextFormatProvider** allows you to pass a **TextFormatProviderSettings** instance. **Example 2** illustrates how to apply the settings created in **Example 1**, when exporting a **RadFixedDocument** to string. -#### **[C#] Example 2: Apply TextFormatProviderSettings** +#### **Example 2: Apply TextFormatProviderSettings** diff --git a/libraries/radpdfprocessing/formats-and-conversion/plain-text/textformatprovider.md b/libraries/radpdfprocessing/formats-and-conversion/plain-text/textformatprovider.md index d1c9da6b..3b4e3301 100644 --- a/libraries/radpdfprocessing/formats-and-conversion/plain-text/textformatprovider.md +++ b/libraries/radpdfprocessing/formats-and-conversion/plain-text/textformatprovider.md @@ -27,7 +27,7 @@ In order to export a document to plain text, you need to use the __Export()__ me __Example 1__ shows how to use __TextFormatProvider__ to export __RadFixedDocument__ to a string. -#### __[C#] Example 1: Export RadFixedDocument to string__ +#### __Example 1: Export RadFixedDocument to string__ diff --git a/libraries/radpdfprocessing/getting-started.md b/libraries/radpdfprocessing/getting-started.md index 4cf8ee19..12d678ad 100644 --- a/libraries/radpdfprocessing/getting-started.md +++ b/libraries/radpdfprocessing/getting-started.md @@ -112,7 +112,7 @@ In order to use the __RadPdfProcessing__ library in your project, you need to ad [RadFixedDocument]({%slug radpdfprocessing-model-radfixeddocument%}) is the root element in the library. It consists of [RadFixedPage]({%slug radpdfprocessing-model-radfixedpage%}) objects and instructions for annotations and destinations in the document. __Example 1__ shows how to create a document and add a page to it. -#### __[C#] Example 1: Create RadFixedDocument__ +#### __Example 1: Create RadFixedDocument__ @@ -121,7 +121,7 @@ In order to use the __RadPdfProcessing__ library in your project, you need to ad The page can then be edited through a [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) instance. __Example 2__ creates an editor and adds a [TextFragment]({%slug radpdfprocessing-model-textfragment%}) to the page object created in __Example 1__. -#### __[C#] Example 2: Add text__ +#### __Example 2: Add text__ @@ -132,7 +132,7 @@ The page can then be edited through a [FixedContentEditor]({%slug radpdfprocessi Exporting to PDF format can be achieved with the __PdfFormatProvider__ class. __Example 3__ shows how to export the __RadFixedDocument__ created in __Examples 1 and 2__ to a file. -#### __[C#] Example 3: Export to PDF__ +#### __Example 3: Export to PDF__ diff --git a/libraries/radpdfprocessing/model/annotations/links.md b/libraries/radpdfprocessing/model/annotations/links.md index 4865e44e..895e9932 100644 --- a/libraries/radpdfprocessing/model/annotations/links.md +++ b/libraries/radpdfprocessing/model/annotations/links.md @@ -19,7 +19,7 @@ __Link__ exposes the following properties: * __Destination__: A destination to be displayed when the annotation is activated. __Example 1__ demonstrates how you can create a Link using a previously created __Destination__ and add the Link in RadFixedPage's Annotations collection. - #### __[C#] Example 1: Add link to destination__ + #### __Example 1: Add link to destination__ @@ -30,7 +30,7 @@ __Link__ exposes the following properties: - #### __[C#] Example 2: Add link with action__ + #### __Example 2: Add link with action__ @@ -79,7 +79,7 @@ The __Destination__ class itself only exposes a __Page__ property specifying the __Example 3__ shows how you can create a Location object, associate it with a Link and add it to a RadFixedPage. -#### __[C#] Example 3: Add link with location__ +#### __Example 3: Add link with location__ @@ -90,7 +90,7 @@ __Example 3__ shows how you can create a Location object, associate it with a Li __Example 4__ demonstrates how to create an action of type __GoToAction__, associate it with a Link and add it to a RadFixedPage. The *location* object can be of type Location like the one in __Example 3__. -#### __[C#] Example 4: Add link with action__ +#### __Example 4: Add link with action__ diff --git a/libraries/radpdfprocessing/model/annotations/widgets.md b/libraries/radpdfprocessing/model/annotations/widgets.md index 013fcfcb..281ee3de 100644 --- a/libraries/radpdfprocessing/model/annotations/widgets.md +++ b/libraries/radpdfprocessing/model/annotations/widgets.md @@ -52,7 +52,7 @@ All widgets are created using the Widgets collection of the [FormField]({%slug r -#### **[C#] Example 1: Creating a widget** +#### **Example 1: Creating a widget** @@ -60,7 +60,7 @@ All widgets are created using the Widgets collection of the [FormField]({%slug r **Example 2** demonstrates how to iterate the Widgets collection of a [TexBoxField]({%slug radpdfprocessing-model-interactive-forms-form-fields-textboxfield%}) instance. Additionally, the code shows you how to add a widget to the Annotations collection of a RadFixedPage. Note, that you must add each widget to this collection so it can be visualized on the PDF page. Otherwise, the element will not be shown on the page. -#### **[C#] Example 2: Iterating the widgets in the FormField's collection** +#### **Example 2: Iterating the widgets in the FormField's collection** diff --git a/libraries/radpdfprocessing/model/form.md b/libraries/radpdfprocessing/model/form.md index 8d11364d..5de33da4 100644 --- a/libraries/radpdfprocessing/model/form.md +++ b/libraries/radpdfprocessing/model/form.md @@ -42,7 +42,7 @@ The **Form** class exposes a default public constructor to allow you create inst __Example 1__ shows how to initialize a Form object and add it to a previously defined container. -#### __[C#] Example 1: Create a form and add it to an IContainerElement__ +#### __Example 1: Create a form and add it to an IContainerElement__ @@ -50,7 +50,7 @@ __Example 1__ shows how to initialize a Form object and add it to a previously d __Example 2__ demonstrates how to use one of the factory methods of the __ContentElementCollection__ to create a new form and insert it into the respective container. -#### __[C#] Example 2: Add a form to a container__ +#### __Example 2: Add a form to a container__ @@ -67,7 +67,7 @@ __Example 2__ demonstrates how to use one of the factory methods of the __Conten You can modify a __Form__ element using the properties the class exposes. The properties are listed in the [Public API](#public-api) section. -#### __[C#] Example 3: Modify Form properties__ +#### __Example 3: Modify Form properties__ diff --git a/libraries/radpdfprocessing/model/formsource/overview.md b/libraries/radpdfprocessing/model/formsource/overview.md index f7d55f88..d5d40f49 100644 --- a/libraries/radpdfprocessing/model/formsource/overview.md +++ b/libraries/radpdfprocessing/model/formsource/overview.md @@ -23,7 +23,7 @@ With **FormSource** you can add content to a [Form]({%slug radpdfprocessing-mode The FormSource class exposes a default constructor which you can use to create an empty instance. -#### __[C#] Example 1: Create FormSource__ +#### __Example 1: Create FormSource__ @@ -44,7 +44,7 @@ The FormSource class inherits from the IContentRootElement interface. This inher >There’s no nesting limit for [Form XObjects]({%slug radpdfprocessing-model-form%}), but PDF viewers may restrict depth to avoid memory or performance issues and improve responsiveness, which can affect rendering depending on the viewer. -#### __[C#] Example 2: Add content to a FormSource__ +#### __Example 2: Add content to a FormSource__ @@ -57,7 +57,7 @@ After generating the FormSource object and filling it with content, you should i * In addition to the ability to fill a form source, the FixedContentEditor allows you to add this form to a container. - #### __[C#] Example 3: Add a FormSource to a document using FixedContentEditor__ + #### __Example 3: Add a FormSource to a document using FixedContentEditor__ diff --git a/libraries/radpdfprocessing/model/image.md b/libraries/radpdfprocessing/model/image.md index 1bd5ac9d..d33e7fe3 100644 --- a/libraries/radpdfprocessing/model/image.md +++ b/libraries/radpdfprocessing/model/image.md @@ -34,7 +34,7 @@ You can edit an __Image__ element using the properties the class exposes. The pr __Example 1__ shows how to initialize an Image object, assigns an ImageSource to it and add it to a previously defined container (page). -#### __[C#] Example 1: Create image__ +#### __Example 1: Create image__ @@ -44,7 +44,7 @@ Once the above RadFixedDocument is [exported]({%slug radpdfprocessing-formats-an __Example 2__ demonstrates how to use one of the factory methods of the __ContentElementCollection__ to create a new image and insert it into the respective container. -#### __[C#] Example 2: Add image to container__ +#### __Example 2: Add image to container__ @@ -54,7 +54,7 @@ The Image class exposes also the **GetBitmapSource()** method, enabling you to o > The GetBitmapSource() method is not available in the .NET Standard version of the PdfProcessing packages. -#### __[C#] Example 3: Obtain BitmapSource__ +#### __Example 3: Obtain BitmapSource__ diff --git a/libraries/radpdfprocessing/model/imagesource.md b/libraries/radpdfprocessing/model/imagesource.md index 01b4ec86..afc701ca 100644 --- a/libraries/radpdfprocessing/model/imagesource.md +++ b/libraries/radpdfprocessing/model/imagesource.md @@ -29,7 +29,7 @@ The ImageSource class has several public constructor overloads and can be create __Example 1__ illustrates how you can create an ImageSource using a __FileStream__. -#### __[C#] Example 1: Create ImageSource from Stream__ +#### __Example 1: Create ImageSource from Stream__ @@ -38,12 +38,12 @@ With the __EncodedImageData__ class you can create an __ImageSource__ with encod __Example 2__ demonstrates how you can create an __ImageSource__ using the __EncodedImageData__ class. -#### __[C#] Example 2: Create ImageSource from EncodedImageData__ +#### __Example 2: Create ImageSource from EncodedImageData__ With the __EncodedImageData__ class you can also create an __ImageSource__ with encoded image data and set its transparency. The __EncodedImageData__ class provides a second constructor overload where you can set the alpha-channel bytes of the image as a second constructor parameter in order to apply transparency to this image. -#### __[C#] Example 3: Create ImageSource from EncodedImageData with transparency__ +#### __Example 3: Create ImageSource from EncodedImageData with transparency__ ## Properties @@ -70,7 +70,7 @@ The ImageSource class exposes two methods, which could help you get the data fro __RadPdfProcessing__ exposes an extension method allowing you to convert every BitmapSource to an ImageSource that can be used for the creation of [Image]({%slug radpdfprocessing-model-image%}) elements. __Example 4__ shows how you can use the ToImageSource() extension method over a previously created bitmap. -#### __[C#] Example 4: Create ImageSource with extension method__ +#### __Example 4: Create ImageSource with extension method__ diff --git a/libraries/radpdfprocessing/model/interactive-forms/form-fields/checkboxfield.md b/libraries/radpdfprocessing/model/interactive-forms/form-fields/checkboxfield.md index 693cfdeb..aa153e0f 100644 --- a/libraries/radpdfprocessing/model/interactive-forms/form-fields/checkboxfield.md +++ b/libraries/radpdfprocessing/model/interactive-forms/form-fields/checkboxfield.md @@ -34,7 +34,7 @@ CheckBoxField provides the following properties: * **ExportValue**: Gets or sets the value of the field when exporting the interactive form. The default export value is “Yes”. -#### **[C#] Example 1: Create a CheckBoxField and add it to a page** +#### **Example 1: Create a CheckBoxField and add it to a page** diff --git a/libraries/radpdfprocessing/model/interactive-forms/form-fields/comboboxfield.md b/libraries/radpdfprocessing/model/interactive-forms/form-fields/comboboxfield.md index 44ace225..ead1e65a 100644 --- a/libraries/radpdfprocessing/model/interactive-forms/form-fields/comboboxfield.md +++ b/libraries/radpdfprocessing/model/interactive-forms/form-fields/comboboxfield.md @@ -39,7 +39,7 @@ ComboBoxField provides the following properties: * **ShouldSpellCheck**: Boolean value indicating whether the text should be spell checked during its input. -#### **[C#] Example 1: Create a ComboBoxField and add it to a page** +#### **Example 1: Create a ComboBoxField and add it to a page** ## See Also diff --git a/libraries/radpdfprocessing/model/interactive-forms/form-fields/combtextboxfield.md b/libraries/radpdfprocessing/model/interactive-forms/form-fields/combtextboxfield.md index 6e8f4052..161cae9f 100644 --- a/libraries/radpdfprocessing/model/interactive-forms/form-fields/combtextboxfield.md +++ b/libraries/radpdfprocessing/model/interactive-forms/form-fields/combtextboxfield.md @@ -31,7 +31,7 @@ CombTextBoxField provides the following properties: * **MaxLengthOfInputCharacters**: Integer value specifying the number of characters that can be inputted. -#### **[C#] Example 1: Create a CombTextBoxField and add it to a page** +#### **Example 1: Create a CombTextBoxField and add it to a page** diff --git a/libraries/radpdfprocessing/model/interactive-forms/form-fields/formfields.md b/libraries/radpdfprocessing/model/interactive-forms/form-fields/formfields.md index 23a12ad0..10dbd57f 100644 --- a/libraries/radpdfprocessing/model/interactive-forms/form-fields/formfields.md +++ b/libraries/radpdfprocessing/model/interactive-forms/form-fields/formfields.md @@ -35,7 +35,7 @@ The FormField class provides the following properties: Each field type can be recognized from the FormField base class by getting the value from its **FieldType** property. This way you can convert the field to its inheritor type by doing a cast to some of the FormField class inheritors. -#### **[C#] Example 1: Obtain fields from a document** +#### **Example 1: Obtain fields from a document** @@ -62,7 +62,7 @@ The following list shows all the inheritors of the FormField class: In R2 2020 we introduced the __Rename__ method which allows you to rename the Form Fields. You need to pass the existing field name and the new name. -#### **[C#] Example 2: Rename Form Fields** +#### **Example 2: Rename Form Fields** @@ -70,7 +70,7 @@ In R2 2020 we introduced the __Rename__ method which allows you to rename the Fo When merging documents that contain FormFields, you need to ensure that each field in the document will have a unique name. This can be achieved by using the __MergedFieldNameResolving__ event. This event gives you access to all used field names and allows you to change the current field, if it is already used. -#### **[C#] Example 2: Merge files with Form Fields** +#### **Example 2: Merge files with Form Fields** diff --git a/libraries/radpdfprocessing/model/interactive-forms/form-fields/listboxfield.md b/libraries/radpdfprocessing/model/interactive-forms/form-fields/listboxfield.md index 4285ebcb..689c4312 100644 --- a/libraries/radpdfprocessing/model/interactive-forms/form-fields/listboxfield.md +++ b/libraries/radpdfprocessing/model/interactive-forms/form-fields/listboxfield.md @@ -37,7 +37,7 @@ ListBoxField provides the following properties: * **TopIndex**: Gets or sets integer value providing the index of the choice that should be visualized on top of the list box viewport rectangle. -#### **[C#] Example 1: Create a ListBoxField and add it to a page** +#### **Example 1: Create a ListBoxField and add it to a page** ## See Also diff --git a/libraries/radpdfprocessing/model/interactive-forms/form-fields/pushbuttonfield.md b/libraries/radpdfprocessing/model/interactive-forms/form-fields/pushbuttonfield.md index a0234a11..ae0375a6 100644 --- a/libraries/radpdfprocessing/model/interactive-forms/form-fields/pushbuttonfield.md +++ b/libraries/radpdfprocessing/model/interactive-forms/form-fields/pushbuttonfield.md @@ -24,7 +24,7 @@ This class corresponds to FormFieldType.PushButton enum value and represents a s PushButtonField provides a single property called **Widgets**. It represents the collection of Widget annotations, which visualize the field on the PDF pages. The widgets can be added and removed from the collection using the collection's **AddWidget()** and **Remove()** methods respectively. As the widget collection implements the **IEnumerable** interface, the available widget instances can be iterated. -#### **[C#] Example 1: Create a PushButtonField and add it to a page** +#### **Example 1: Create a PushButtonField and add it to a page** >important In **.NET Standard/.NET (Target OS: None)** environments, fonts beyond the [14 standard ones]({%slug radpdfprocessing-concepts-fonts%}#standard-fonts) require a [FontsProvider implementation]({%slug pdfprocessing-implement-fontsprovider%}) to be resolved correctly. diff --git a/libraries/radpdfprocessing/model/interactive-forms/form-fields/radiobuttonfield.md b/libraries/radpdfprocessing/model/interactive-forms/form-fields/radiobuttonfield.md index d082c67a..a336e2db 100644 --- a/libraries/radpdfprocessing/model/interactive-forms/form-fields/radiobuttonfield.md +++ b/libraries/radpdfprocessing/model/interactive-forms/form-fields/radiobuttonfield.md @@ -38,7 +38,7 @@ RadioButtonField provides the following properties: * **ShouldUpdateRadiosInUnison**: Boolean value indicating whether all radio buttons that have RadioOption with the same value should be selected in unison. If false, then at most on radio button will have selected state even if some other radio button has the same option value. -#### **[C#] Example 1: Create RadioButtonFields and add them to a page** +#### **Example 1: Create RadioButtonFields and add them to a page** diff --git a/libraries/radpdfprocessing/model/interactive-forms/form-fields/signaturefield.md b/libraries/radpdfprocessing/model/interactive-forms/form-fields/signaturefield.md index 2c3b81df..ec53f74e 100644 --- a/libraries/radpdfprocessing/model/interactive-forms/form-fields/signaturefield.md +++ b/libraries/radpdfprocessing/model/interactive-forms/form-fields/signaturefield.md @@ -34,7 +34,7 @@ SignatureField provides the following properties: * **Widgets**: The collection of Widget annotations, which represent the field on the PDF pages. The widgets can be added and removed from the collection using the collection's **AddWidget()** and **Remove()** methods respectively. As the widget collection implements the **IEnumerable** interface, the available widget instances can be iterated. -#### **[C#] Example 1: Create a SignatureField and add it to a page** +#### **Example 1: Create a SignatureField and add it to a page** ## See Also diff --git a/libraries/radpdfprocessing/model/interactive-forms/form-fields/textboxfield.md b/libraries/radpdfprocessing/model/interactive-forms/form-fields/textboxfield.md index b35f7f4e..cbac5d3b 100644 --- a/libraries/radpdfprocessing/model/interactive-forms/form-fields/textboxfield.md +++ b/libraries/radpdfprocessing/model/interactive-forms/form-fields/textboxfield.md @@ -41,7 +41,7 @@ TextBoxField exposes the following properties: * **MaxLengthOfInputCharacters**: Nullable integer value specifying the maximal length of the inputted text. When null, the text is not restricted to any specified length. -#### **[C#] Example 1: Create a TextBoxField and add it to a page** +#### **Example 1: Create a TextBoxField and add it to a page** >important In .NET Standard use __Telerik.Documents.Primitives.Rect__ instead of __System.Windows.Rect__. diff --git a/libraries/radpdfprocessing/model/interactive-forms/formfieldcollection.md b/libraries/radpdfprocessing/model/interactive-forms/formfieldcollection.md index f03db426..dde5c51d 100644 --- a/libraries/radpdfprocessing/model/interactive-forms/formfieldcollection.md +++ b/libraries/radpdfprocessing/model/interactive-forms/formfieldcollection.md @@ -38,7 +38,7 @@ There are methods allowing you to easily construct a form field and add it to th **Example 1** shows how you can use the listed above methods to generate a form field and add it to the collection. -#### **[C#] Example 1: Creating a form field** +#### **Example 1: Creating a form field** @@ -50,7 +50,7 @@ You can also use several more methods of the class to modify the collection of f * **Contains()**: Accepts a string representing the form field name. Returns *true* when a field with such a name is present in the collection, otherwise *false*. -#### **[C#] Example 2: Using the methods of FormFieldCollection** +#### **Example 2: Using the methods of FormFieldCollection** ## See Also diff --git a/libraries/radpdfprocessing/model/named-destinations.md b/libraries/radpdfprocessing/model/named-destinations.md index 40786789..be30b1db 100644 --- a/libraries/radpdfprocessing/model/named-destinations.md +++ b/libraries/radpdfprocessing/model/named-destinations.md @@ -32,7 +32,7 @@ The **NamedDestinations** collection is exposed by RadFixedDocument and is used **NamedDestination** objects can be created through the Add() method of the **NamedDestinations** collection exposed by RadFixedDocument. -#### __[C#] Example 1: Create NamedDestination with Destination of type Link__ +#### __Example 1: Create NamedDestination with Destination of type Link__ @@ -40,7 +40,7 @@ The **NamedDestinations** collection is exposed by RadFixedDocument and is used You can remove a named destination as you would do with any item in a collection. -#### __[C#] Example 2: Remove NamedDestination__ +#### __Example 2: Remove NamedDestination__ @@ -48,7 +48,7 @@ You can remove a named destination as you would do with any item in a collection In addition to the **Name** property of the **NamedDestination** class which provides you with a setter, you can use the **Rename()** method of the **RadFixedDocument.NamedDestinations** collection. -#### __[C#] Example 3: Rename NamedDestination__ +#### __Example 3: Rename NamedDestination__ @@ -56,7 +56,7 @@ In addition to the **Name** property of the **NamedDestination** class which pro The **NamedDestinations** collection provides you with the ContainsName() method which is convenient to check whether the name you would like to use has been already applied to a NamedDestination or to check whether the NamedDestination you are searching for exists. -#### __[C#] Example 4: Check if a NamedDestination already exists__ +#### __Example 4: Check if a NamedDestination already exists__ diff --git a/libraries/radpdfprocessing/model/path.md b/libraries/radpdfprocessing/model/path.md index 3c8bcd65..e5490c76 100644 --- a/libraries/radpdfprocessing/model/path.md +++ b/libraries/radpdfprocessing/model/path.md @@ -49,14 +49,14 @@ __Path__ is a content element that is designed to be added in the __Content__ co __Example 1__ shows how you can create a Path, assign a predefined Geometry to it and add it to a container. -#### __[C#] Example 1: Create Path and add it to container__ +#### __Example 1: Create Path and add it to container__ __Example 2__ demonstrates how to use one of the factory methods of the __ContentElementCollection__ that create a new path and insert it into the document. -#### __[C#] Example 2: Add Path to container__ +#### __Example 2: Add Path to container__ @@ -68,7 +68,7 @@ __Example 2__ demonstrates how to use one of the factory methods of the __Conten You can modify a __Path__ element using the properties the class exposes. The properties are listed listed in the [Public API](#public-api) section. -#### __[C#] Example 3: Modifying Path properties__ +#### __Example 3: Modifying Path properties__ diff --git a/libraries/radpdfprocessing/model/radfixeddocument.md b/libraries/radpdfprocessing/model/radfixeddocument.md index 474f3081..a856a02a 100644 --- a/libraries/radpdfprocessing/model/radfixeddocument.md +++ b/libraries/radpdfprocessing/model/radfixeddocument.md @@ -67,7 +67,7 @@ __Example 1__ shows how you can create a new __RadFixedDocument__ instance. -#### __[C#] Example 1: Create RadFixedDocument__ +#### __Example 1: Create RadFixedDocument__ @@ -77,7 +77,7 @@ There are different actions, which you can execute with the help of __RadFixedDo __Example 2__ adds a page to the document created in [__Example 1__](#example1). -#### __[C#] Example 2: Add page to RadFixedDocument__ +#### __Example 2: Add page to RadFixedDocument__ @@ -87,20 +87,20 @@ Alternatively, you can create new __RadFixedPage__ and add it to the __Pages__ c __Example 3__ creates a page and adds it to the document created in [__Example 1__](#example1). -#### __[C#] Example 3: Create and add a page to RadFixedDocument__ +#### __Example 3: Create and add a page to RadFixedDocument__ **Example 4** shows you how you could obtain a copy of a RadFixedDocument. -#### __[C#] Example 4: Clone a document__ +#### __Example 4: Clone a document__ You can merge PDF documents out-of-the-box with the Merge() method of __RadFixedDocument__. This method clones the source document and appends it to the current instance of __RadFixedDocument__. -#### __[C#] Example 5: Merge documents__ +#### __Example 5: Merge documents__ diff --git a/libraries/radpdfprocessing/model/radfixedpage.md b/libraries/radpdfprocessing/model/radfixedpage.md index 3204cda1..d2fd5cc4 100644 --- a/libraries/radpdfprocessing/model/radfixedpage.md +++ b/libraries/radpdfprocessing/model/radfixedpage.md @@ -41,7 +41,7 @@ RadFixedPage is typically used when: __Example 1__ demonstrates how to create a new __RadFixedPage__ instance and add it to the __Pages__ collection of __RadFixedDocument__. -#### __[C#] Example 1: Create RadFixedPage and add it to a document__ +#### __Example 1: Create RadFixedPage and add it to a document__ @@ -55,7 +55,7 @@ __RadFixedPage__ is designed to hold any content element in the document model. __Example 2__ shows how to add a previously created ContentElement in a __RadFixedPage__. -#### __[C#] Example 2: Add content element to RadFixedPage__ +#### __Example 2: Add content element to RadFixedPage__ @@ -68,7 +68,7 @@ You can add different annotations in __RadFixedPage__ by using the __Annotations __Example 3__ shows how to add a previously created annotation in a __RadFixedPage__. -#### __[C#] Example 3: Add annotation to RadFixedPage__ +#### __Example 3: Add annotation to RadFixedPage__ @@ -81,7 +81,7 @@ RadFixedPage's API provides you with the ability to modify its properties. __Example 4__ shows how you can change the __Rotation__ and __Size__ properties of a __RadFixedPage__. -#### __[C#] Example 4: Change properties of a RadFixedPage__ +#### __Example 4: Change properties of a RadFixedPage__ diff --git a/libraries/radpdfprocessing/model/textfragment.md b/libraries/radpdfprocessing/model/textfragment.md index 76a46044..6b28a1a0 100644 --- a/libraries/radpdfprocessing/model/textfragment.md +++ b/libraries/radpdfprocessing/model/textfragment.md @@ -57,7 +57,7 @@ position: 3 Both methods return the actual TextFragment instance, so you can modify it. -#### __[C#] Example 1: Create TextFragments and add them to a page__ +#### __Example 1: Create TextFragments and add them to a page__ @@ -73,7 +73,7 @@ position: 3 You can modify a **TextFragment** element using the properties listed in the [Public API](#public-api) section. -#### __[C#] Example 2: Modifying TextFragment's properties__ +#### __Example 2: Modifying TextFragment's properties__ diff --git a/libraries/radspreadprocessing/changes-and-backward-compatibility/backward-compatibility.md b/libraries/radspreadprocessing/changes-and-backward-compatibility/backward-compatibility.md index 2772a964..55a5aa29 100644 --- a/libraries/radspreadprocessing/changes-and-backward-compatibility/backward-compatibility.md +++ b/libraries/radspreadprocessing/changes-and-backward-compatibility/backward-compatibility.md @@ -125,15 +125,15 @@ The default value of Telerik.Windows.Documents.Spreadsheet.Model.Printing.SheetP If you need to keep the document with A4 PaperType, you can apply this setting before exporting it: -#### [C#] Set PaperType -{{region radspreadprocessing-backward-compatibility_0}} +#### Set PaperType +```csharp foreach (Worksheet worksheet in workbook.Worksheets) { worksheet.WorksheetPageSetup.PaperType = PaperTypes.A4; } -{{endregion}} +``` ## What's Different in 2016 R3 diff --git a/libraries/radspreadprocessing/cross-platform-support/images.md b/libraries/radspreadprocessing/cross-platform-support/images.md index a5daad6d..65eb039a 100644 --- a/libraries/radspreadprocessing/cross-platform-support/images.md +++ b/libraries/radspreadprocessing/cross-platform-support/images.md @@ -15,17 +15,17 @@ position: 2 >note The **Telerik.Documents.ImageUtils** package provides a default implementation of the ImagePropertiesResolver class that could be used when exporting the document. -#### [C#] Example 1: Set the default implementation of the ImagePropertiesResolver class +#### Example 1: Set the default implementation of the ImagePropertiesResolver class -{{region cs-radspreadprocessing-cross-platform_0}} +```csharp ImagePropertiesResolverBase imagePropertiesResolver = new ImagePropertiesResolver(); SpreadExtensibilityManager.ImagePropertiesResolver = imagePropertiesResolver; -{{endregion}} +``` -#### [C#] Example 2: Windows Example: Create a custom implementation inheriting the ImagePropertiesResolverBase abstract class +#### Example 2: Windows Example: Create a custom implementation inheriting the ImagePropertiesResolverBase abstract class -{{region cs-radspreadprocessing-cross-platform_0}} +```csharp public class ImageInfo : ImagePropertiesResolverBase { @@ -38,15 +38,15 @@ position: 2 } } } -{{endregion}} +``` -#### [C#] Example 3: Set the custom implementation inheriting the ImagePropertiesResolverBase abstract class +#### Example 3: Set the custom implementation inheriting the ImagePropertiesResolverBase abstract class -{{region cs-radspreadprocessing-cross-platform_1}} +```csharp ImagePropertiesResolverBase imagePropertiesResolver = new ImageInfo(); SpreadExtensibilityManager.ImagePropertiesResolver = imagePropertiesResolver; -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/cross-platform-support/text-measure.md b/libraries/radspreadprocessing/cross-platform-support/text-measure.md index 495ef8b2..342f3a05 100644 --- a/libraries/radspreadprocessing/cross-platform-support/text-measure.md +++ b/libraries/radspreadprocessing/cross-platform-support/text-measure.md @@ -42,13 +42,13 @@ This implementation uses PdfProcessing to obtain the size of the text and provid >important To use the **SpreadFixedTextMeasurer** class, you must add a reference to **Telerik.Documents.Fixed**. -#### [C#] Example 1: Set the SpreadFixedTextMeasurer as a text measurer +#### Example 1: Set the SpreadFixedTextMeasurer as a text measurer -{{region cs-radspreadprocessing-cross-platform_1}} +```csharp SpreadTextMeasurerBase fixedTextMeasurer = new SpreadFixedTextMeasurer(); SpreadExtensibilityManager.TextMeasurer = fixedTextMeasurer; -{{endregion}} +``` ## SkiaTextMeasurer Q3 2025 (or newer) @@ -72,7 +72,7 @@ If you prefer to reference assemblies directly, you need: |**Telerik.Text.Skia.dll**|Required dependency of Telerik.Documents.TextMeasurer.Skia.| |**SkiaSharp.HarfBuzz.dll** (version {{site.harfbuzzsharp}}) (and all of its dependencies)|Required dependency of Telerik.Text.Skia.dll, along with all its dependencies| -#### [C#] Example 2: Set the SkiaTextMeasurer as a text measurer +#### Example 2: Set the SkiaTextMeasurer as a text measurer @@ -80,9 +80,9 @@ If you prefer to reference assemblies directly, you need: You can assign any **SpreadTextMeasurerBase** implementation to the **SpreadExtensibilityManager.TextMeasurer** property. All you should do is to inherit the abstract **SpreadTextMeasurerBase**, implement the required members and set the new implementation to the TextMeasurer property. -#### **[C#] Example 3: Create a custom implementation inheriting the SpreadTextMeasurerBase abstract class** +#### **Example 3: Create a custom implementation inheriting the SpreadTextMeasurerBase abstract class** -{{region cs-radspreadprocessing-custommeasurer}} +```csharp public class CustomTextMeasurer : SpreadTextMeasurerBase { @@ -125,16 +125,16 @@ You can assign any **SpreadTextMeasurerBase** implementation to the **SpreadExte }; } } -{{endregion}} +``` -#### **[C#] Example 4: Set the custom implementation as a text measurer** +#### **Example 4: Set the custom implementation as a text measurer** -{{region cs-radspreadprocessing-custommeasurer2}} +```csharp SpreadTextMeasurerBase customTextMeasurer = new CustomTextMeasurer(); SpreadExtensibilityManager.TextMeasurer = customTextMeasurer; -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/features/charts/axes.md b/libraries/radspreadprocessing/features/charts/axes.md index 126f9784..6b521e26 100644 --- a/libraries/radspreadprocessing/features/charts/axes.md +++ b/libraries/radspreadprocessing/features/charts/axes.md @@ -22,8 +22,8 @@ Refer to the scenario from **Figure 1**. The chart shown there has two axes: a d #### Figure 1: Sample data ![](images/SpreadProcessing-Features-Charts-Axes_1.png) -#### [C#] Example 1: Axes properties -{{region radspreadprocessing-features-charts-axes_0}} +#### Example 1: Axes properties +```csharp DocumentChart chart = new FloatingChartShape(worksheet, new CellIndex(0,0), new CellRange(1, 1, 5, 2), ChartType.Column).Chart; @@ -42,26 +42,26 @@ Refer to the scenario from **Figure 1**. The chart shown there has two axes: a d double? valMin = valAxis.Min; // 0 double? valMax = valAxis.Max; // 1800 -{{endregion}} +``` ## Changing the Axis of a Chart RadSpreadProcessing allows you to replace the axis of a chart with a new object. This is achieved through the **PrimaryAxes** and **SecondaryAxes** properties of **DocumentChart**. -#### [C#] Example 2: Replace axis -{{region radspreadprocessing-features-charts-axes_1}} +#### Example 2: Replace axis +```csharp DocumentChart chart = new FloatingChartShape(worksheet, new CellIndex(0, 0), new CellRange(1, 1, 5, 2), ChartType.Column).Chart; chart.PrimaryAxes.CategoryAxis = new DateAxis(); -{{endregion}} +``` ## Changing the Appearance of the Axes You can customize the way the axes in the chart look like. The API of SpreadProcessing enables you to change the fill and width of the outline of an axis and its major gridlines. -#### [C#] Example 3: Customize the major gridlines and outline of an axis -{{region radspreadprocessing-features-charts-axes_2}} +#### Example 3: Customize the major gridlines and outline of an axis +```csharp FloatingChartShape chartShape = new FloatingChartShape(workbook.ActiveWorksheet, new CellIndex(2, 7), new CellRange(0, 0, 4, 3), ChartType.Column) { @@ -73,7 +73,7 @@ You can customize the way the axes in the chart look like. The API of SpreadProc chartShape.Chart.PrimaryAxes.ValueAxis.MajorGridlines.Outline.Fill = new SolidFill(new ThemableColor(Colors.LightGray)); chartShape.Chart.PrimaryAxes.ValueAxis.MajorGridlines.Outline.Width = 2; -{{endregion}} +``` #### Figure 2: Custom appearance ![](images/SpreadProcessing-Features-Charts-Axes_3.png) \ No newline at end of file diff --git a/libraries/radspreadprocessing/features/charts/chart-data.md b/libraries/radspreadprocessing/features/charts/chart-data.md index fc4f387b..c15a22b5 100644 --- a/libraries/radspreadprocessing/features/charts/chart-data.md +++ b/libraries/radspreadprocessing/features/charts/chart-data.md @@ -26,9 +26,9 @@ The **FormulaChartData** type is abstract and it is implemented by the **Workboo - Workbook **Workbook**: Gets the workbook that the formula refers to get the chart data. -#### [C#] Example 1: Using IChartData +#### Example 1: Using IChartData -{{region radspreadprocessing-features-charts-chart-data_0}} +```csharp FloatingChartShape chartShape = new FloatingChartShape(worksheet, new CellIndex(1, 1), new CellRange(1, 1, 1, 1), ChartType.Column) { @@ -61,7 +61,7 @@ The **FormulaChartData** type is abstract and it is implemented by the **Workboo worksheet.Charts[0].Chart.SeriesGroups.First().Series.Last().Title = new TextTitle("Team 2"); chartShape.Chart = chart; -{{endregion}} +``` >caption Using Chart Data in RadSpreadProcessing diff --git a/libraries/radspreadprocessing/features/charts/pdf-export.md b/libraries/radspreadprocessing/features/charts/pdf-export.md index 49c9d6d4..b0afe4e8 100644 --- a/libraries/radspreadprocessing/features/charts/pdf-export.md +++ b/libraries/radspreadprocessing/features/charts/pdf-export.md @@ -28,9 +28,9 @@ The **ChartModelToImageConverter** object is readily available in the **Telerik. The [**PdfFormatProvider**]({%slug radspreadprocessing-formats-and-conversion-pdf-pdfformatprovider%}) instance accepts a renderer in its settings. The renderer needs to implement the **IPdfChartRenderer** interface and the RenderChart() method this interface defines. The method takes a [**FixedContentEditor**]({%slug radpdfprocessing-editing-fixedcontenteditor%}) in its parameters, which will draw the chart, and the other parameters contain the information necessary to draw it. The WpfPdfChartImageRenderer implemented in **Example 1** is an example implementation that uses the Telerik.Windows.Controls.Spreadsheet and Telerik.Windows.Controls.Chart [Xaml assemblies](https://docs.telerik.com/devtools/wpf/styling-and-appearance/xaml-vs-noxaml) to draw the chart. -#### [C#] Example 1: Implementing a renderer +#### Example 1: Implementing a renderer -{{region radspreadprocessing-features-charts-pdf-export_0}} +```csharp public class WpfPdfChartImageRenderer : IPdfChartRenderer { @@ -63,17 +63,17 @@ The [**PdfFormatProvider**]({%slug radspreadprocessing-formats-and-conversion-pd return bmp; } } -{{endregion}} +``` When you have the renderer implemented, you will need to assign it to the PdfFormatProvider instance through the **ChartRenderer** property of its [ExportSettings]({%slug radspreadprocessing-format-and-conversion-pdf-settings%}). -#### [C#] Example 2: Registering the renderer +#### Example 2: Registering the renderer -{{region radspreadprocessing-features-charts-pdf-export_1}} +```csharp PdfFormatProvider pdfFormatProvider = new PdfFormatProvider(); pdfFormatProvider.ExportSettings.ChartRenderer = new WpfPdfChartImageRenderer(); -{{endregion}} +``` Now the chart objects in the spreadsheet will be exported along with the other content after invoking the **Export()** method of **PdfFormatProvider**. diff --git a/libraries/radspreadprocessing/features/charts/series.md b/libraries/radspreadprocessing/features/charts/series.md index 1dae0269..b732119a 100644 --- a/libraries/radspreadprocessing/features/charts/series.md +++ b/libraries/radspreadprocessing/features/charts/series.md @@ -71,9 +71,9 @@ To better illustrate how you can change the series of a chart, let's take the sa #### Figure 1: Initial state of a chart ![](images/SpreadProcessing-Features-Charts-WorkingWithSeries_1.png) -#### [C#] Example 1: Add and remove series from a chart +#### Example 1: Add and remove series from a chart -{{region radspreadprocessing-features-charts-working-with-series_0}} +```csharp // The worksheet contains a chart of type bar. DocumentChart chart = (worksheet.Charts.First() as FloatingChartShape).Chart; @@ -91,28 +91,28 @@ To better illustrate how you can change the series of a chart, let's take the sa SeriesBase newSeries = chartComponent.Series.Add(categoriesData, valuesData, chartTitle); Type seriesType = newSeries.GetType(); // Will be of type BarSeries -{{endregion}} +``` #### Figure 2: Modified series of a chart ![](images/SpreadProcessing-Features-Charts-WorkingWithSeries_2.png) The same methods for adding and removing series can be accessed through the concrete SeriesCollection of the concrete SeriesGroup and they will return concrete Series object. -#### [C#] Example 2: Add series to a chart using concrete SeriesGroup object +#### Example 2: Add series to a chart using concrete SeriesGroup object -{{region radspreadprocessing-features-charts-working-with-series_1}} +```csharp BarSeriesGroup chartComponent = chart.SeriesGroups.First() as BarSeriesGroup; BarSeries newSeries = chartComponent.Series.Add(categoriesData, valuesData, chartTitle); -{{endregion}} +``` ## Iterating the Series of a Chart You can access the **Series** property of the **SeriesGroup** object contained in the **SeriesGroups** property of the **Chart** object and iterate the **SeriesBase** objects in it. -#### [C#] Example 3: Iterate series +#### Example 3: Iterate series -{{region radspreadprocessing-features-charts-working-with-series_2}} +```csharp DocumentChart chart = (worksheet.Charts.First() as FloatingChartShape).Chart; SeriesGroup seriesGroup = chart.SeriesGroups.First(); @@ -131,15 +131,15 @@ You can access the **Series** property of the **SeriesGroup** object contained i IEnumerable values = (series.Values as WorkbookFormulaChartData).EnumerateCellRanges(out dataWorksheet); } } -{{endregion}} +``` ## Making Changes to the Series You can modify the properties of the base class for all series - SeriesBase. -#### [C#] Example 4: Change series +#### Example 4: Change series -{{region radspreadprocessing-features-charts-working-with-series_3}} +```csharp DocumentChart chart = (worksheet.Charts.First() as FloatingChartShape).Chart; SeriesGroup seriesGroup = chart.SeriesGroups.First(); @@ -147,7 +147,7 @@ You can modify the properties of the base class for all series - SeriesBase. firstSeries.Title = new TextTitle("New title"); firstSeries.Values = new WorkbookFormulaChartData(worksheet, new CellRange(2, 3, 5, 3)); -{{endregion}} +``` ## SeriesGroup Class and Properties Related to Specific Series Types @@ -169,7 +169,7 @@ These properties enable you to control the options for each of the series indepe ### BubbleSeries - - **BubbleSizes**: Gets or sets the data for the bubble size of the series. It is of type [IChartData]({%slug radspreadprocessing-features-charts-chart-data%}}) and you can set it to a specific cell range or directly using values. + - **BubbleSizes**: Gets or sets the data for the bubble size of the series. It is of type [IChartData]({%slug radspreadprocessing-features-charts-chart-data%}) and you can set it to a specific cell range or directly using values. ### LineSeries @@ -192,9 +192,9 @@ These properties enable you to control the options for each of the series indepe - **Smooth**: The points on the scatter chart are connected with smoothed lines but markers are not drawn. - **SmoothMarker**: The points on the scatter chart are connected with smoothed lines and markers are drawn. -#### **[C#] Example 5: Customize the appearance of ScatterSeries** +#### **Example 5: Customize the appearance of ScatterSeries** -{{region }} +```csharp SeriesGroup scatterSeriesGroup = chart.Chart.SeriesGroups.First() as ScatterSeriesGroup; ScatterSeries scatterSeries = scatterSeriesGroup.Series.First() as ScatterSeries; @@ -202,7 +202,7 @@ These properties enable you to control the options for each of the series indepe scatterSeries.Marker.Symbol = MarkerStyle.Plus; scatterSeries.Marker.Size = 22; scatterSeries.Outline.Fill = new SolidFill(Colors.Red); -{{endregion}} +``` ## Series Grouping @@ -212,36 +212,36 @@ Some series groups (Bar, Line and Area) implement the **ISupportGrouping** inter #### Figure 3: Sample data ![](images/SpreadProcessing-Features-Charts-WorkingWithSeries_3.png) -#### [C#] Example 6: Creating standard/clustered bar chart with vertical orientation +#### Example 6: Creating standard/clustered bar chart with vertical orientation -{{region radspreadprocessing-features-charts-working-with-series_4}} +```csharp FloatingChartShape chartShape = worksheet.Charts.AddChart(new CellIndex(10, 1), selectedRange, ChartType.Bar); (chartShape.Chart.SeriesGroups.First() as ISupportGrouping).Grouping = SeriesGrouping.Standard; -{{endregion}} +``` #### Figure 4: Standard/clustered bar chart with vertical orientation ![](images/SpreadProcessing-Features-Charts-WorkingWithSeries_4.png) -#### [C#] Example 7: Creating stacked bar chart with vertical orientation +#### Example 7: Creating stacked bar chart with vertical orientation -{{region radspreadprocessing-features-charts-working-with-series_5}} +```csharp FloatingChartShape chartShape = worksheet.Charts.AddChart(new CellIndex(10, 1), selectedRange, ChartType.Bar); (chartShape.Chart.SeriesGroups.First() as ISupportGrouping).Grouping = SeriesGrouping.Stacked; -{{endregion}} +``` #### Figure 5: Stacked bar chart with vertical orientation ![](images/SpreadProcessing-Features-Charts-WorkingWithSeries_5.png) -#### [C#] Example 8: Creating percent-stacked bar chart with vertical orientation +#### Example 8: Creating percent-stacked bar chart with vertical orientation -{{region radspreadprocessing-features-charts-working-with-series_6}} +```csharp FloatingChartShape chartShape = worksheet.Charts.AddChart(new CellIndex(10, 1), selectedRange, ChartType.Bar); (chartShape.Chart.SeriesGroups.First() as ISupportGrouping).Grouping = SeriesGrouping.PercentStacked; -{{endregion}} +``` #### Figure 6: Percent-stacked bar chart with vertical orientation ![](images/SpreadProcessing-Features-Charts-WorkingWithSeries_6.png) diff --git a/libraries/radspreadprocessing/features/charts/title-and-legend.md b/libraries/radspreadprocessing/features/charts/title-and-legend.md index c25fac73..5624d9ef 100644 --- a/libraries/radspreadprocessing/features/charts/title-and-legend.md +++ b/libraries/radspreadprocessing/features/charts/title-and-legend.md @@ -16,9 +16,9 @@ You can manipulate the legend and the title of a chart. You can access and set the **Title** property of the **DocumentChart** object, which is of type **Title**. The Title property is exposed in both, DocumentChart and SeriesBase classes. Similar to the series of the chart, the title can be a simple *string* value or a reference to data. The reference is not to a CellIndex, but to a CellRange and if the CellRange contains more than one cell, the values of the cells are concatenated. -#### [C#] Example 1: Setting the title of a chart to a string +#### Example 1: Setting the title of a chart to a string -{{region radspreadprocessing-features-charts-title-and-legend_0}} +```csharp FloatingChartShape chartShape = new FloatingChartShape(worksheet, new CellIndex(0, 4), new CellRange(1, 1, 5, 2), ChartType.Pie) { @@ -28,18 +28,18 @@ You can access and set the **Title** property of the **DocumentChart** object, w DocumentChart chart = chartShape.Chart; chart.Title = new TextTitle("Text title"); -{{endregion}} +``` -#### [C#] Example 1: Setting the title of a series to a CellRange +#### Example 1: Setting the title of a series to a CellRange -{{region radspreadprocessing-features-charts-title-and-legend_1}} +```csharp BarSeriesGroup columnGroup = chart.SeriesGroups.First() as BarSeriesGroup; SeriesBase firstSeries = columnGroup.Series.First(); firstSeries.Title = new FormulaTitle(new WorkbookFormulaChartData(worksheet, new CellRange(0, 0, 0, 1))); -{{endregion}} +``` #### Figure 1: Chart title ![](images/SpreadProcessing-Features-ChartTitle_1.png) @@ -51,12 +51,12 @@ The charts use a legend to help users to understand the data plotted on the char The legend of the chart can be added or edited through the **Legend** property of the **DocumentChart** object. The property is of type **Legend**. The **Legend** type contains one property: **LegendPosition** of type **LegendPosition**, which is an enumeration with four members: **Top**, **Bottom**, **Left** and **Right**. The actual entries of the legend are constructed by the titles of the series. -#### [C#] Example 3: Adding a chart legend -{{region radspreadprocessing-features-charts-title-and-legend_2}} +#### Example 3: Adding a chart legend +```csharp chart.Legend = new Legend(); chart.Legend.Position = LegendPosition.Left; -{{endregion}} +``` #### Figure 2: Chart legend ![](images/SpreadProcessing-Features-ChartLegend_1.png) \ No newline at end of file diff --git a/libraries/radspreadprocessing/features/charts/using-charts.md b/libraries/radspreadprocessing/features/charts/using-charts.md index 13390a36..d4d34d57 100644 --- a/libraries/radspreadprocessing/features/charts/using-charts.md +++ b/libraries/radspreadprocessing/features/charts/using-charts.md @@ -38,9 +38,9 @@ Once you have created a FloatingChartShape, you can insert it in the document th >Make sure that you have set the size of the FloatingChartShape object. Otherwise, it will be inserted in the worksheet with zero size and will be invisible. -#### [C#] Example 1: Create a chart through FloatingChartShape and add it to a worksheet +#### Example 1: Create a chart through FloatingChartShape and add it to a worksheet -{{region radspreadprocessing-features-charts-using-charts_0}} +```csharp FloatingChartShape chartShape = new FloatingChartShape(worksheet, new CellIndex(6, 4), new CellRange(1, 1, 5, 2), ChartType.Column) { @@ -54,7 +54,7 @@ Once you have created a FloatingChartShape, you can insert it in the document th int seriesCount = seriesGroup.Series.Count(); // 1 SeriesBase series = seriesGroup.Series.First(); // type BarSeries -{{endregion}} +``` The result of executing the code in **Example 1** would look like in **Figure 1**. @@ -64,9 +64,9 @@ The result of executing the code in **Example 1** would look like in **Figure 1* The Chart property of FloatingChartShape holds an object of type [DocumentChart](#documentchart). -#### [C#] Example 2: Create a combo (Column and Line) chart through FloatingChartShape and add it to a worksheet +#### Example 2: Create a combo (Column and Line) chart through FloatingChartShape and add it to a worksheet -{{region radspreadprocessing-features-charts-using-charts_5}} +```csharp FloatingChartShape chartShape = new FloatingChartShape(worksheet, new CellIndex(0, 5), new CellRange(0, 0, 12, 3), new[] { ChartType.Line, ChartType.Line, ChartType.Column }) { @@ -76,7 +76,7 @@ The Chart property of FloatingChartShape holds an object of type [DocumentChart] worksheet.Charts.Add(chartShape); -{{endregion}} +``` The result of executing the code in **Example 2** would look like in **Figure 2**. @@ -87,8 +87,8 @@ The result of executing the code in **Example 2** would look like in **Figure 2* The FloatingChartShape class exposes properties allowing you to customize how the shape looks like. You can control the outline of the shape as well as its fill. -#### [C#] Example 3: Customize the fill and outline of FloatingChartShape -{{region radspreadprocessing-features-charts-using-charts_1}} +#### Example 3: Customize the fill and outline of FloatingChartShape +```csharp FloatingChartShape chartShape = new FloatingChartShape(workbook.ActiveWorksheet, new CellIndex(2, 7), new CellRange(0, 0, 4, 3), ChartType.Column) { @@ -99,7 +99,7 @@ The FloatingChartShape class exposes properties allowing you to customize how th chartShape.Outline.Fill = new SolidFill(new ThemableColor(Colors.SlateGray)); chartShape.Outline.Width = 5; chartShape.Fill = new SolidFill(new ThemableColor(Colors.Cornsilk)); -{{endregion}} +``` The result of executing the code in **Example 3** over a cell range containing sample data would look like in **Figure 3**. @@ -126,9 +126,9 @@ Also, a **Clone()** method is exposed, which creates a deep copy of the object. You can create a simple DocumentChart object, which is empty and then set the desired values manually. -#### [C#] Example 4: Creating an empty chart and setting its values manually +#### Example 4: Creating an empty chart and setting its values manually -{{region radspreadprocessing-features-charts-using-charts_2}} +```csharp DocumentChart chart = new DocumentChart(); // Fill the chart with data @@ -144,18 +144,18 @@ You can create a simple DocumentChart object, which is empty and then set the de (seriesGroup as ISupportAxes).AxisGroupName = AxisGroupName.Primary; -{{endregion}} +``` The chart can then be used to replace the chart in an existing **FloatingChartShape**. -#### [C#] Example 5: Add the DocumentChart to a worksheet +#### Example 5: Add the DocumentChart to a worksheet -{{region radspreadprocessing-features-charts-using-charts_3}} +```csharp chartShape.Chart = chart; worksheet.Charts.Add(chartShape); -{{endregion}} +``` >noteFor more on Series, the [Series]({%slug radspreadprocessing-features-charts-series%}) help topic. Refer to [Working with Axes]({%slug radspreadprocessing-features-charts-axes%}) for description of the axes objects of the chart. @@ -165,9 +165,9 @@ The initial data and the resulting chart are shown in **Figure 1**. You can access the Charts collection of the Shape collection of the Worksheet instance and enumerate the Charts. -#### [C#] Example 6: Iterate all the charts in a worksheet +#### Example 6: Iterate all the charts in a worksheet -{{region radspreadprocessing-features-charts-using-charts_4}} +```csharp foreach (FloatingChartShape chartShape in worksheet.Charts) { @@ -175,4 +175,4 @@ You can access the Charts collection of the Shape collection of the Worksheet in SeriesGroup group = chart.SeriesGroups.First(); SeriesBase series = group.Series.First(); } -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/clipboard-support.md b/libraries/radspreadprocessing/features/clipboard-support.md index 46629738..acbea475 100644 --- a/libraries/radspreadprocessing/features/clipboard-support.md +++ b/libraries/radspreadprocessing/features/clipboard-support.md @@ -22,9 +22,9 @@ In order to copy values that appear in your worksheet, create a __CellSelection_ __Example 1__ creates a new workbook with a single worksheet and assigns some sample values to the A1:B3 region. Further, the code creates a selection for the cell region and calls its __Copy()__ method. The returned __WorksheetFragment__ can later be used for pasting operation. -#### __[C#] Example 1: Copy selected cells__ +#### __Example 1: Copy selected cells__ -{{region cs-radspreadprocessing-features-clipboard-support_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -37,7 +37,7 @@ __Example 1__ creates a new workbook with a single worksheet and assigns some sa CellRange copiedCellRange = new CellRange(0, 0, 2, 1); WorksheetFragment worksheetFragment = worksheet.Cells[copiedCellRange].Copy(); -{{endregion}} +``` @@ -70,9 +70,9 @@ The document model provides control over the content and the formatting included __Example 2__ creates a new workbook with an empty worksheet. Further, the example sets the __Value__ of cell *A1* to =CONCATENATE("Rad" ,"Spreadsheet") and its __ForeColor__ to green. The code copies the contents of *A1* and pastes it in *A2* using __All__ PasteType. -#### __[C#] Example 2: Copy all__ +#### __Example 2: Copy all__ -{{region cs-radspreadprocessing-features-clipboard-support_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -83,19 +83,19 @@ __Example 2__ creates a new workbook with an empty worksheet. Further, the examp PasteOptions pasteOptions = new PasteOptions(PasteType.All); worksheet.Cells[1, 0].Paste(worksheetFragment, pasteOptions); -{{endregion}} +``` Using different __PasteType__, however, produces different output. __Example 3__ pastes the contents of *A1* with __Values__ PasteType, which results in a value "RadSpreadsheet" instead of =CONCATENATE("Rad" ,"Spreadsheet") and default __ForeColor__ instead of green: -#### __[C#] Example 3: Paste using PasteType.Values__ +#### __Example 3: Paste using PasteType.Values__ -{{region cs-radspreadprocessing-features-clipboard-support_2}} +```csharp PasteOptions pasteOptionsValues = new PasteOptions(PasteType.Values); worksheet.Cells[2, 0].Paste(worksheetFragment, pasteOptionsValues); -{{endregion}} +``` @@ -105,12 +105,12 @@ If you would like to paste the formula contained in *A1*, not only its result, a __Example 4__ combines the Value and Formats paste types and preserves both the contents and formatting of the copied cell selection. -#### __[C#] Example 4: Combine Values and Formats PasteType__ +#### __Example 4: Combine Values and Formats PasteType__ -{{region cs-radspreadprocessing-features-clipboard-support_3}} +```csharp PasteOptions valuesAndFormatting = new PasteOptions(PasteType.Formulas | PasteType.Formats); worksheet.Cells[3, 0].Paste(worksheetFragment, valuesAndFormatting); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/comments.md b/libraries/radspreadprocessing/features/comments.md index a5cda82d..0285b4c6 100644 --- a/libraries/radspreadprocessing/features/comments.md +++ b/libraries/radspreadprocessing/features/comments.md @@ -35,9 +35,9 @@ Since R2 2022 the SpreadProcessing library supports working with comments. Comme To add a comment you need to specify the cell index to which the comment will be related, the author, the text content, and the creation date. Specifying the creation date is optional and by default, its value is the current date and time. -#### __[C#] Example 1: Add comment__ +#### __Example 1: Add comment__ -{{region cs-radspreadprocessing-features-comments_0}} +```csharp CellIndex relatedCellIndex = new CellIndex(1, 1); string author = "John Doe"; @@ -46,7 +46,7 @@ To add a comment you need to specify the cell index to which the comment will be worksheet.Comments.Add(relatedCellIndex, author, text, creationDate); -{{endregion}} +``` The above snippet will add a comment in cell B2. @@ -55,14 +55,14 @@ The above snippet will add a comment in cell B2. To remove a comment, you should specify the comment instance. This instance can be obtained from the __CommentCollection__. -#### __[C#] Example 2: Remove comment__ +#### __Example 2: Remove comment__ -{{region cs-radspreadprocessing-features-comments_1}} +```csharp SpreadsheetComment comment = worksheet.Comments[0]; worksheet.Comments.Remove(comment); -{{endregion}} +``` ## Replies @@ -83,9 +83,9 @@ Each comment can be replied to, forming a thread of information. All replies can * __CopyTo:__ Copies the entire __ReplySortedCollection__ to a compatible one-dimensional array, starting at the specified index of the target array. -#### __[C#] Example 3: Working with Replies +#### __Example 3: Working with Replies -{{region cs-radspreadprocessing-features-comments_2}} +```csharp void MyProgram() { @@ -134,7 +134,7 @@ Each comment can be replied to, forming a thread of information. All replies can } } -{{endregion}} +``` ### Events @@ -148,9 +148,9 @@ The two events for both collections use similar enumeration types for event argu * __Add:__ Used when Adding a Comment or Reply * __Remove:__ Used when Removing a Comment or Reply -#### __[C#] Example 4: Changing the author of a comment upon adding it to the CommentCollection using the Changing event__ +#### __Example 4: Changing the author of a comment upon adding it to the CommentCollection using the Changing event__ -{{region cs-radspreadprocessing-features-comments_3}} +```csharp void Comments_Changing(object sender, ShapeCollectionChangingEventArgs e) { @@ -161,11 +161,11 @@ The two events for both collections use similar enumeration types for event argu } } -{{endregion}} +``` -#### __[C#] Example 5: Changing the author of a reply upon adding it to the ReplySortedCollection using the Changing event__ +#### __Example 5: Changing the author of a reply upon adding it to the ReplySortedCollection using the Changing event__ -{{region cs-radspreadprocessing-features-comments_4}} +```csharp void Replies_Changing(object sender, ReplySortedCollectionChangingEventArgs e) { @@ -175,7 +175,7 @@ The two events for both collections use similar enumeration types for event argu } } -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/conditional-formatting.md b/libraries/radspreadprocessing/features/conditional-formatting.md index ff3577df..39d035c9 100644 --- a/libraries/radspreadprocessing/features/conditional-formatting.md +++ b/libraries/radspreadprocessing/features/conditional-formatting.md @@ -72,9 +72,9 @@ The **ConditionalFormattingDxfRule** class is a base class for all rules that su The Formatting property can be used for all rules listed in **Table 1** except **ColorScaleRule**, **IconSetRule**, and **DataBarRule**. Due to their specificity, these three rules inherit directly from `ConditionalFormattingRule` and **do not** expose the `Formatting` property. Their styling options are directly inside the rule class. -#### [C#] Example 1: Create formatting +#### Example 1: Create formatting -{{region radspreadprocessing-features-conditional-formatting_5}} +```csharp DifferentialFormatting formatting = new DifferentialFormatting(); formatting.FontSize = 22; @@ -90,16 +90,16 @@ The Formatting property can be used for all rules listed in **Table 1** except * formatting.BottomBorder = cellBorder; formatting.LeftBorder = cellBorder; formatting.RightBorder = cellBorder; -{{endregion}} +``` ## Create and Apply Conditional Formatting Rule Each of the classes listed in **Table 1** above expose constructors enabling you to instantiate the specific rule. The constructors of these classes take a `string` parameter allowing you to specify the values and conditions the rule must work with. You can pass any cell value for the parameter, inlcuding formulas. -#### [C#] Example 2: Create Between rule +#### Example 2: Create Between rule -{{region radspreadprocessing-features-conditional-formatting_0}} +```csharp // Get a value from the worksheet string capacityValue = worksheet.Cells[1, 0].GetValue().Value.GetValueAsString(CellValueFormat.GeneralFormat); @@ -118,14 +118,14 @@ Each of the classes listed in **Table 1** above expose constructors enabling you // Create conditional formatting and add it to the desired range of cells ConditionalFormatting conditionalFormatting = new ConditionalFormatting(rule); worksheet.Cells[1, 2, 12, 2].AddConditionalFormatting(conditionalFormatting); -{{endregion}} +``` #### Between rule applied on a range of values ![Between rule applied on a range of values](images/RadSpreadProcessing_Features_ConditionalFormatting_Between.png) -#### [C#] Example 3: Create GreaterThanOrEqualTo rule +#### Example 3: Create GreaterThanOrEqualTo rule -{{region radspreadprocessing-features-conditional-formatting_1}} +```csharp GreaterThanOrEqualToRule rule = new GreaterThanOrEqualToRule("=$A$2"); @@ -137,14 +137,14 @@ Each of the classes listed in **Table 1** above expose constructors enabling you ConditionalFormatting conditionalFormatting = new ConditionalFormatting(rule); worksheet.Cells[1, 2, 11, 2].AddConditionalFormatting(conditionalFormatting); -{{endregion}} +``` #### GreaterThanOrEqualTo rule applied on a range of values ![GreaterThanOrEqualTo rule applied on a range of values](images/RadSpreadProcessing_Features_ConditionalFormatting_GreaterThanOrEqualTo.png) -#### [C#] Example 4: Create ColorScale rule +#### Example 4: Create ColorScale rule -{{region radspreadprocessing-features-conditional-formatting_2}} +```csharp // Get a value from an existing worksheet string capacityValue = worksheet.Cells[1, 0].GetValue().Value.GetValueAsString(CellValueFormat.GeneralFormat); @@ -166,16 +166,16 @@ Each of the classes listed in **Table 1** above expose constructors enabling you ConditionalFormatting conditionalFormatting = new ConditionalFormatting(rule); worksheet.Cells[1, 2, 12, 2].AddConditionalFormatting(conditionalFormatting); -{{endregion}} +``` >note Depending on the exact number of colors you would like to apply for the ColorScaleRule, you can choose between **TwoColorScaleValueContext** and **ThreeColorScaleValueContext** classes. #### ColorScale rule applied on a range of values ![ColorScale rule applied on a range of values](images/RadSpreadProcessing_Features_ConditionalFormatting_ColorScale.png) -#### [C#] Example 5: Create DataBar rule +#### Example 5: Create DataBar rule -{{region radspreadprocessing-features-conditional-formatting_3}} +```csharp // Create the context for the rule DataBarValueContext dataBarValueContext = new DataBarValueContext(); @@ -189,15 +189,15 @@ Each of the classes listed in **Table 1** above expose constructors enabling you ConditionalFormatting conditionalFormatting = new ConditionalFormatting(rule); worksheet.Cells[1, 2, 12, 2].AddConditionalFormatting(conditionalFormatting); -{{endregion}} +``` #### DataBar rule applied on a range of values ![DataBar rule applied on a range of values](images/RadSpreadProcessing_Features_ConditionalFormatting_DataBar.png) -#### [C#] Example 6: Create IconSet rule +#### Example 6: Create IconSet rule -{{region radspreadprocessing-features-conditional-formatting_4}} +```csharp // Create the rule using a predefined set of icons IconSetRule rule = new IconSetRule(PresetIconSet.ThreeArrowsColored); @@ -205,7 +205,7 @@ Each of the classes listed in **Table 1** above expose constructors enabling you ConditionalFormatting conditionalFormatting = new ConditionalFormatting(rule); worksheet.Cells[1, 2, 12, 2].AddConditionalFormatting(conditionalFormatting); -{{endregion}} +``` #### IconSet rule applied on a range of values ![IconSet rule applied on a range of values](images/RadSpreadProcessing_Features_ConditionalFormatting_IconSet.png) @@ -231,20 +231,20 @@ The following list shows all implementations of `IRangeValue` that you can use: Any previously applied formatting can be obtained through the GetConditionalFormattings method of CellSelection. This method returns a collection of **ConditionalFormattingRange** object representing the formattings applied to the selection and the CellRange each formatting is applied on. -#### [C#] Example 7: Get the conditional formatting +#### Example 7: Get the conditional formatting -{{region radspreadprocessing-features-conditional-formatting_6}} +```csharp IEnumerable formattingRanges = worksheet.Cells[0, 0, 10, 10].GetConditionalFormattings(); -{{endregion}} +``` ## Remove Conditional Formatting Through the CellSelection, you can also remove the formatting from the selected cells. -#### [C#] Example 8: Remove the conditional formatting +#### Example 8: Remove the conditional formatting -{{region radspreadprocessing-features-conditional-formatting_7}} +```csharp IEnumerable formattingRanges = worksheet.Cells[0, 0, 10, 10].GetConditionalFormattings(); @@ -255,7 +255,7 @@ Through the CellSelection, you can also remove the formatting from the selected worksheet.Cells[range.CellRange].RemoveConditionalFormatting(format); } } -{{endregion}} +``` ## Resolve Conditional Formatting @@ -263,26 +263,26 @@ Each of the formatting rule classes gives you the ability to evaluate the rule a For the rules that apply on all the values in the range, the return value is **between 0 and 1**, depending on where that value is positioned in the range of all values. Such rules are `ColorScaleRule`, `DataBarRule` and `IconSetRule`. For all other rules, the result of `Resolve` is **0 or 1**, depending on whether the specific cell value meets the rule requirements. -#### [C#] Example 9: Resolve conditional formatting rule +#### Example 9: Resolve conditional formatting rule -{{region radspreadprocessing-features-conditional-formatting_8}} +```csharp CellIndex cellIndex = new CellIndex(0, 0); ConditionalFormatting formatting = worksheet.Cells[cellIndex].GetConditionalFormattings().First().Formattings.First(); bool isFormattingApplied = formatting.Resolve(cellIndex) > 0; -{{endregion}} +``` ## Update the Rule for a Formatting In case you would like to change the rule used by a ConditionalFormatting object, you can do so using the UpdateRule() method. -#### [C#] Example 10: Change the rule for existing conditional formatting +#### Example 10: Change the rule for existing conditional formatting -{{region radspreadprocessing-features-conditional-formatting_9}} +```csharp ConditionalFormattingRange formattingRange = worksheet.Cells[0, 0, 10, 10].GetConditionalFormattings().First(); formattingRange.Formattings.First().UpdateRule(new ContainsRule("test")); -{{endregion}} +``` ## Update the Cell Range of Existing Formatting diff --git a/libraries/radspreadprocessing/features/data-validation.md b/libraries/radspreadprocessing/features/data-validation.md index 1adcd700..6a8f71ab 100644 --- a/libraries/radspreadprocessing/features/data-validation.md +++ b/libraries/radspreadprocessing/features/data-validation.md @@ -82,16 +82,16 @@ The any value data validation rule is the default rule. It is applied to all cel __Example 1__ shows hot to create any value validation rule and set it to a cell. -#### __[C#] Example 1: Apply any value rule__ +#### __Example 1: Apply any value rule__ -{{region cs-radspreadprocessing-features-data-validation_0}} +```csharp AnyValueDataValidationRuleContext context = new AnyValueDataValidationRuleContext(); context.InputMessageContent = "Sample input message content"; context.InputMessageTitle = "Sample input message title"; AnyValueDataValidationRule rule = new AnyValueDataValidationRule(context); worksheet.Cells[0, 0].SetDataValidationRule(rule); -{{endregion}} +``` The result from the code snippet in __Example 1__ is shown on the snapshot in __Figure 1__. @@ -105,9 +105,9 @@ The whole number data validation rule allows you to restrict the user input to w The code snippet in __Example 2__ shows how to create a whole number data validation rule that restricts the user input using two arguments to the range between 0 and 100 and considers blank values as invalid. -#### __[C#] Example 2: Apply whole number rule with two arguments__ +#### __Example 2: Apply whole number rule with two arguments__ -{{region cs-radspreadprocessing-features-data-validation_1}} +```csharp CellIndex dataValidationRuleCellIndex = new CellIndex(0, 0); NumberDataValidationRuleContext context = new NumberDataValidationRuleContext(worksheet, dataValidationRuleCellIndex); @@ -124,7 +124,7 @@ The code snippet in __Example 2__ shows how to create a whole number data valida WholeNumberDataValidationRule rule = new WholeNumberDataValidationRule(context); worksheet.Cells[dataValidationRuleCellIndex].SetDataValidationRule(rule); -{{endregion}} +``` The result from __Example 2__ is shown in __Figure 2__. @@ -140,9 +140,9 @@ The result from entering value *“test”* in the cell containing the data vali The code snippet in __Example 3__ shows how to create a whole number data validation rule that restricts the user input with one argument to numbers that are greater than 100. -#### __[C#] Example 3: Apply whole number rule with one argument__ +#### __Example 3: Apply whole number rule with one argument__ -{{region cs-radspreadprocessing-features-data-validation_2}} +```csharp CellIndex dataValidationRuleCellIndex = new CellIndex(0, 0); NumberDataValidationRuleContext context = new NumberDataValidationRuleContext(worksheet, dataValidationRuleCellIndex); @@ -157,13 +157,13 @@ The code snippet in __Example 3__ shows how to create a whole number data valida WholeNumberDataValidationRule rule = new WholeNumberDataValidationRule(context); worksheet.Cells[dataValidationRuleCellIndex].SetDataValidationRule(rule); -{{endregion}} +``` You are allowed to enter any valid [formula]({%slug radspreadprocessing-features-formulas-general-information%}) as a rule argument that returns a number. __Example 4__ shows how to restrict the user input to the values less than the sum of the values in cells A1 and B1. -#### __[C#] Example 4: Apply whole number rule with formula__ +#### __Example 4: Apply whole number rule with formula__ -{{region cs-radspreadprocessing-features-data-validation_3}} +```csharp // The value of A1 worksheet.Cells[0, 0].SetValue(60); // The value of B1 @@ -183,7 +183,7 @@ You are allowed to enter any valid [formula]({%slug radspreadprocessing-features WholeNumberDataValidationRule rule = new WholeNumberDataValidationRule(context); worksheet.Cells[dataValidationRuleCellIndex].SetDataValidationRule(rule); -{{endregion}} +``` #### Figure 4: Whole number rule based on formula @@ -199,9 +199,9 @@ The decimal data validation rule allows you to restrict the user input to decima __Example 5__ demonstrates how to create a decimal data validation rule that restricts the user input to be outside the range between 0 and 100. -#### __[C#] Example 5: Apply decimal rule__ +#### __Example 5: Apply decimal rule__ -{{region cs-radspreadprocessing-features-data-validation_4}} +```csharp CellIndex dataValidationRuleCellIndex = new CellIndex(0, 0); NumberDataValidationRuleContext context = new NumberDataValidationRuleContext(worksheet, dataValidationRuleCellIndex); @@ -217,7 +217,7 @@ __Example 5__ demonstrates how to create a decimal data validation rule that res DecimalDataValidationRule rule = new DecimalDataValidationRule(context); worksheet.Cells[dataValidationRuleCellIndex].SetDataValidationRule(rule); -{{endregion}} +``` ## List Rule @@ -225,9 +225,9 @@ The list data validation rule allows you to restrict the user input to a predefi __Example 6__ shows the creation of a list data validation rule that restricts the user input to a day of the week. -#### __[C#] Example 6: Apply list rule__ +#### __Example 6: Apply list rule__ -{{region cs-radspreadprocessing-features-data-validation_5}} +```csharp CellIndex dataValidationRuleCellIndex = new CellIndex(0, 0); ListDataValidationRuleContext context = new ListDataValidationRuleContext(worksheet, dataValidationRuleCellIndex); @@ -242,7 +242,7 @@ __Example 6__ shows the creation of a list data validation rule that restricts t ListDataValidationRule rule = new ListDataValidationRule(context); worksheet.Cells[dataValidationRuleCellIndex].SetDataValidationRule(rule); -{{endregion}} +``` __Figure 5__ shows the result from __Example 6__. @@ -256,9 +256,9 @@ The date rule allows you to restrict the user input to a certain range of dates __Example 7__ shows how to restrict the user input to the dates in the range between 12 February 2013 and 22 May 2017. -#### __[C#] Example 7: Apply date rule__ +#### __Example 7: Apply date rule__ -{{region cs-radspreadprocessing-features-data-validation_6}} +```csharp CellIndex dataValidationRuleCellIndex = new CellIndex(0, 0); NumberDataValidationRuleContext context = new NumberDataValidationRuleContext(worksheet, dataValidationRuleCellIndex); @@ -274,7 +274,7 @@ __Example 7__ shows how to restrict the user input to the dates in the range bet DateDataValidationRule rule = new DateDataValidationRule(context); worksheet.Cells[dataValidationRuleCellIndex].SetDataValidationRule(rule); -{{endregion}} +``` ## Time Rule @@ -282,9 +282,9 @@ The time rule allows you to restrict the user input to a certain range of times The code snippet in __Example 8__ shows how to restrict the user input to the range between 10:25 AM and 3:45 PM: -#### __[C#] Example 8: Apply time rule__ +#### __Example 8: Apply time rule__ -{{region cs-radspreadprocessing-features-data-validation_7}} +```csharp CellIndex dataValidationRuleCellIndex = new CellIndex(0, 0); NumberDataValidationRuleContext context = new NumberDataValidationRuleContext(worksheet, dataValidationRuleCellIndex); @@ -300,7 +300,7 @@ The code snippet in __Example 8__ shows how to restrict the user input to the ra TimeDataValidationRule rule = new TimeDataValidationRule(context); worksheet.Cells[dataValidationRuleCellIndex].SetDataValidationRule(rule); -{{endregion}} +``` ## Text Length Rule @@ -308,9 +308,9 @@ The text length rule allows you to restrict the user input to text with length i __Example 9__ shows how to restrict the user input to text with a length between 5 and 10 symbols. -#### __[C#] Example 9: Apply text length rule__ +#### __Example 9: Apply text length rule__ -{{region cs-radspreadprocessing-features-data-validation_8}} +```csharp CellIndex dataValidationRuleCellIndex = new CellIndex(0, 0); NumberDataValidationRuleContext context = new NumberDataValidationRuleContext(worksheet, dataValidationRuleCellIndex); @@ -326,7 +326,7 @@ __Example 9__ shows how to restrict the user input to text with a length between TextLengthDataValidationRule rule = new TextLengthDataValidationRule(context); worksheet.Cells[dataValidationRuleCellIndex].SetDataValidationRule(rule); -{{endregion}} +``` ## Custom Rule @@ -334,9 +334,9 @@ The custom rule allows you to restrict the user input with a custom condition sp The code snippet in __Example 10__ shows how to restrict the user input to values that are greater or equal to the sum of the values in the cells A1 and B1. -#### __[C#] Example 10: Apply custom rule__ +#### __Example 10: Apply custom rule__ -{{region cs-radspreadprocessing-features-data-validation_9}} +```csharp CellIndex dataValidationRuleCellIndex = new CellIndex(1, 0); SingleArgumentDataValidationRuleContext context = new SingleArgumentDataValidationRuleContext(worksheet, dataValidationRuleCellIndex); @@ -350,7 +350,7 @@ The code snippet in __Example 10__ shows how to restrict the user input to value CustomDataValidationRule rule = new CustomDataValidationRule(context); worksheet.Cells[dataValidationRuleCellIndex].SetDataValidationRule(rule); -{{endregion}} +``` ## Evaluate Rules @@ -358,8 +358,8 @@ In order to check if the cell value satisfies a rule, you have to evaluate the r __Example 11__ demonstrates how to evaluate a rule using the __Evaluate()__ method. -#### __[C#] Example 11: Evaluate rule__ -{{region cs-radspreadprocessing-features-data-validation_10}} +#### __Example 11: Evaluate rule__ +```csharp double value = 125; ICellValue cellValue = value.ToCellValue(); if (rule.Evaluate(worksheet, 0, 0, cellValue)) @@ -370,7 +370,7 @@ __Example 11__ demonstrates how to evaluate a rule using the __Evaluate()__ meth { // the rule is not satisfied } -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/features/fill-data-automatically/repeat-values.md b/libraries/radspreadprocessing/features/fill-data-automatically/repeat-values.md index 98836bca..c083f363 100644 --- a/libraries/radspreadprocessing/features/fill-data-automatically/repeat-values.md +++ b/libraries/radspreadprocessing/features/fill-data-automatically/repeat-values.md @@ -34,9 +34,9 @@ To repeat the values, first you need to create a [CellSelection]({%slug radsprea __Example 1__ illustrates how the contents of column *A* can be copied to the rest of the columns in the range *A1:D4*. The code creates a new worksheet and populates the cells *A1*, *A2*, *A3* and *A4* with the values 5, 8, 13 and 21 respectively. Further, it invokes the __FillData()__ method for the specified range with __FillDirection Right__. -#### __[C#] Example 1: Fill right__ +#### __Example 1: Fill right__ -{{region cs-radspreadprocessing-features-fill-data-automatically-repeat-values_0}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); Worksheet activeWorksheet = workbook.ActiveWorksheet; @@ -48,7 +48,7 @@ __Example 1__ illustrates how the contents of column *A* can be copied to the re CellRange range = new CellRange(0, 0, 3, 3); activeWorksheet.Cells[range].FillData(FillDirection.Right); -{{endregion}} +``` @@ -64,9 +64,9 @@ Similarly, you can automatically copy the values of a row to its adjacent rows. __Example 2__ invokes the __FillData()__ method with __FillDirection Down__ for the range *B2:D4*. The sample code creates an empty worksheet and enters values in the range *B2:D2*. These values are propagated to the rest of the rows in the specified region. -#### __[C#] Example 2: Fill down__ +#### __Example 2: Fill down__ -{{region cs-radspreadprocessing-features-fill-data-automatically-repeat-values_1}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); Worksheet activeWorksheet = workbook.ActiveWorksheet; @@ -77,7 +77,7 @@ __Example 2__ invokes the __FillData()__ method with __FillDirection Down__ for CellRange range = new CellRange(1, 1, 3, 3); activeWorksheet.Cells[range].FillData(FillDirection.Down); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/fill-data-automatically/series.md b/libraries/radspreadprocessing/features/fill-data-automatically/series.md index 3ccb9817..1ab37eff 100644 --- a/libraries/radspreadprocessing/features/fill-data-automatically/series.md +++ b/libraries/radspreadprocessing/features/fill-data-automatically/series.md @@ -46,9 +46,9 @@ The __FillDataSeriesLinear()__ method of the __CellSelection__ class constructs __Example 1__ creates a new worksheet that has the value *1* in cell *A1* and *3* in *B1*. The __FillDataSeriesLinear()__ method is invoked for the cell region *A1:F1*. Thus, the values *1, 3, 5, 7, 9 and 11* appear in the range *A1:F1*. -#### __[C#] Example 1: Fill linear series__ +#### __Example 1: Fill linear series__ -{{region cs-radspreadprocessing-features-fill-data-automatically-series_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -57,7 +57,7 @@ __Example 1__ creates a new worksheet that has the value *1* in cell *A1* and *3 CellRange range = new CellRange(0, 0, 0, 5); worksheet.Cells[range].FillDataSeriesLinear(CellOrientation.Horizontal, 2); -{{endregion}} +``` @@ -75,9 +75,9 @@ The __FillDataSeriesLinearTrend()__ method produces series using a linear fittin __Example 2__ shows how to use __FillDataSeriesLinearTrend()__ to continue series values *1, 5* from the range *A1:B1* and result will be series *1, 5, 9, 13, 17, 21* in the range *A1:F1*. -#### __[C#] Example 2: Fill linear trend series__ +#### __Example 2: Fill linear trend series__ -{{region cs-radspreadprocessing-features-fill-data-automatically-series_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -89,7 +89,7 @@ __Example 2__ shows how to use __FillDataSeriesLinearTrend()__ to continue serie CellRange range = new CellRange(0, 0, 0, 9); worksheet.Cells[range].FillDataSeriesLinearTrend(CellOrientation.Horizontal); -{{endregion}} +``` @@ -113,9 +113,9 @@ The __FillDataSeriesExponential()__ method calculates the values of each cell af __Example 3__ shows how to use the __FillDataSeriesExponential()__ method to continue series with initial values *1 and 3* that appear in cells *A1 and B1* respectively. After the method is invoked, the region *A1:F1* contains the following values: *1, 4, 16, 64, 256 and 1024*. -#### __[C#] Example 3: Fill exponential series__ +#### __Example 3: Fill exponential series__ -{{region cs-radspreadprocessing-features-fill-data-automatically-series_2}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -124,7 +124,7 @@ __Example 3__ shows how to use the __FillDataSeriesExponential()__ method to con CellRange range = new CellRange(0, 0, 0, 5); worksheet.Cells[range].FillDataSeriesExponential(CellOrientation.Horizontal, 4); -{{endregion}} +``` @@ -142,9 +142,9 @@ The __FillDataSeriesExponentialTrend()__ method calculates the values of the ser __Example 4__ shows how to use the __FillDataSeriesLinearTrend()__ method to continue series with initial values *1 and 5* that appear in cells *A1 and B1* respectively. After the linear trend is applied, the range *A1:F1* holds the following values: *1, 5, 25, 125, 625 and 3125*. -#### __[C#] Example 4: Exponential trend series__ +#### __Example 4: Exponential trend series__ -{{region cs-radspreadprocessing-features-fill-data-automatically-series_3}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -155,7 +155,7 @@ __Example 4__ shows how to use the __FillDataSeriesLinearTrend()__ method to con CellRange range = new CellRange(0, 0, 0, 5); worksheet.Cells[range].FillDataSeriesExponentialTrend(CellOrientation.Horizontal); -{{endregion}} +``` @@ -179,9 +179,9 @@ The __FillDataSeriesDate()__ method is used to fill date values incrementally us __Example 5__ shows how to construct series that use *5/28/2013* as a starting point and add two weekdays for each consecutive value. -#### __[C#] Example 5: Fill date series__ +#### __Example 5: Fill date series__ -{{region cs-radspreadprocessing-features-fill-data-automatically-series_4}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -189,7 +189,7 @@ __Example 5__ shows how to construct series that use *5/28/2013* as a starting p CellRange range = new CellRange(0, 0, 0, 9); worksheet.Cells[range].FillDataSeriesDate(CellOrientation.Horizontal, DateUnitType.Weekday, 2); -{{endregion}} +``` @@ -271,9 +271,9 @@ Similarly to the rest auto filling methods, __FillDataSeriesAuto()__ takes three __Example 6__ shows how to use the __FillDataSeriesAuto()__ method for initial value *1st* set in the cell *A1*. The resulting series filled in the range *A1:F1* are as follows: *1st, 2nd, 3rd, 4th, 5th and 6th*. -#### __[C#] Example 6: Auto fill__ +#### __Example 6: Auto fill__ -{{region cs-radspreadprocessing-features-fill-data-automatically-series_5}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -281,7 +281,7 @@ __Example 6__ shows how to use the __FillDataSeriesAuto()__ method for initial v CellRange range = new CellRange(0, 0, 0, 5); worksheet.Cells[range].FillDataSeriesAuto(CellOrientation.Horizontal, true); -{{endregion}} +``` @@ -294,9 +294,9 @@ __Figure 8__ demonstrates the result of __Example 6__. __Example 7__ demonstrates the behavior of the __FillDataSeriesAuto()__ method. This time, the initial value *6th* appears in cell *F1* and the applied auto fill is with reversed direction. Note that the constructed __CellRange__ is actually *F1:A1*, instead of *A1:F1*. The resulting series are: *11th, 12th, 9th, 8th, 7th and 6th*. -#### __[C#] Example 7: Auto fill reversed direction__ +#### __Example 7: Auto fill reversed direction__ -{{region cs-radspreadprocessing-features-fill-data-automatically-series_6}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -304,7 +304,7 @@ __Example 7__ demonstrates the behavior of the __FillDataSeriesAuto()__ method. CellRange range = new CellRange(0, 5, 0, 0); worksheet.Cells[range].FillDataSeriesAuto(CellOrientation.Horizontal, true); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/filtering.md b/libraries/radspreadprocessing/features/filtering.md index 620c0710..77122ade 100644 --- a/libraries/radspreadprocessing/features/filtering.md +++ b/libraries/radspreadprocessing/features/filtering.md @@ -124,9 +124,9 @@ Other than the members of the __IFilter__ interface, the __ValuesCollectionFilte __Example 1__ shows how to create a __ValuesCollectionFilter__. -#### __[C#] Example 1: Create ValuesCollectionFilter__ +#### __Example 1: Create ValuesCollectionFilter__ -{{region cs-radspreadprocessing-features-filtering_0}} +```csharp IEnumerable stringItems = new List() { "test", "1%", "1.0" }; IEnumerable dateItems = new List() { @@ -135,7 +135,7 @@ __Example 1__ shows how to create a __ValuesCollectionFilter__. }; ValuesCollectionFilter filter = new ValuesCollectionFilter(0, stringItems, dateItems, true); -{{endregion}} +``` @@ -189,13 +189,13 @@ The criteria is represented by the __CustomFilterCriteria__ class. Each criteria __Example 2__ shows how to create a custom filter. -#### __[C#] Example 2: Create CustomFilter__ +#### __Example 2: Create CustomFilter__ -{{region cs-radspreadprocessing-features-filtering_1}} +```csharp CustomFilterCriteria critera1 = new CustomFilterCriteria(ComparisonOperator.EqualsTo, "Test string"); CustomFilterCriteria critera2 = new CustomFilterCriteria(ComparisonOperator.GreaterThan, "-5"); CustomFilter filter = new CustomFilter(0, critera1, LogicalOperator.Or, critera2); -{{endregion}} +``` @@ -231,11 +231,11 @@ Other than the members of the __IFilter__ interface, the __TopFilter__ class exp __Example 3__ shows how to create a top filter. -#### __[C#] Example 3: Create TopFilter__ +#### __Example 3: Create TopFilter__ -{{region cs-radspreadprocessing-features-filtering_2}} +```csharp TopFilter filter = new TopFilter(0, TopFilterType.BottomPercent, 30); -{{endregion}} +``` @@ -256,11 +256,11 @@ Other than the members of the __IFilter__ interface, the __DynamicFilter__ class __Example 4__ demonstrates how to create a dynamic filter. -#### __[C#] Example 4: Create DynamicFilter__ +#### __Example 4: Create DynamicFilter__ -{{region cs-radspreadprocessing-features-filtering_3}} +```csharp DynamicFilter filter = new DynamicFilter(0, DynamicFilterType.LastWeek); -{{endregion}} +``` The filter will show only the values which are dates and which fall within the week prior to the application of the filter. @@ -280,12 +280,12 @@ Other than the members of the __IFilter__ interface, the __ForeColorFilter__ cla __Example 5__ demonstrates how to create a fore color filter. -#### __[C#] Example 5: Create ForeColorFilter__ +#### __Example 5: Create ForeColorFilter__ -{{region cs-radspreadprocessing-features-filtering_4}} +```csharp ThemableColor color = new ThemableColor(Colors.Red); ForeColorFilter filter = new ForeColorFilter(0, color); -{{endregion}} +``` @@ -306,12 +306,12 @@ Other than the members of the __IFilter__ interface, the __FillColorFilter__ cla __Example 6__ shows hot to create a fill color filter. -#### __[C#] Example 6: Create FillColorFilter__ +#### __Example 6: Create FillColorFilter__ -{{region cs-radspreadprocessing-features-filtering_5}} +```csharp IFill fill = new PatternFill(PatternType.Solid, Colors.Red, Colors.Red); FillColorFilter filter = new FillColorFilter(0, fill); -{{endregion}} +``` @@ -326,25 +326,25 @@ In order to set a filter on a range, you need to follow the steps below: * Set the filter range. - #### __[C#] Example 7: Set FilterRange__ + #### __Example 7: Set FilterRange__ - {{region cs-radspreadprocessing-features-filtering_6}} + ```csharp Worksheet worksheet = workbook.ActiveWorksheet; CellRange filterRange = new CellRange(0, 1, 5, 2); worksheet.Filter.FilterRange = filterRange; - {{endregion}} + ``` * Create a filter. - #### __[C#] Example 8: Create DynamicFilter__ + #### __Example 8: Create DynamicFilter__ - {{region cs-radspreadprocessing-features-filtering_7}} + ```csharp DynamicFilter filter = new DynamicFilter(1, DynamicFilterType.AboveAverage); - {{endregion}} + ``` The relative index specified in the constructor is 1, which means that the filter will be set on the second column of the range, that is, column C. @@ -352,11 +352,11 @@ In order to set a filter on a range, you need to follow the steps below: * Set the filter on the necessary column. - #### __[C#] Example 9: Set Filter__ + #### __Example 9: Set Filter__ - {{region cs-radspreadprocessing-features-filtering_8}} + ```csharp worksheet.Filter.SetFilter(filter); - {{endregion}} + ``` **Figure 2** demonstrates the result of the filtering when applied on the values 1-9 in column B and 11-19 in column C. @@ -368,12 +368,12 @@ In order to set a filter on a range, you need to follow the steps below: Alternatively, you can set the filter through the cell selection like in __Example 10__. This approach will automatically set the filter range anew. - #### __[C#] Example 10: Set filter through selection__ + #### __Example 10: Set filter through selection__ - {{region cs-radspreadprocessing-features-filtering_9}} + ```csharp worksheet.Cells[filterRange].Filter(filter); - {{endregion}} + ``` @@ -389,11 +389,11 @@ In order to set a filter on a range, you need to follow the steps below: When a filter is set it is automatically applied. The application of a filter happens only once and if the values or properties of the filtered column change afterwards, the filter needs to be reapplied. This is done by using the overloads of the __ReapplyFilter()__ method. The first overload allows reapplying a filter by the relative index of the column it is applied to. The second - by a __IFilter__ instance. -#### __[C#] Example 11: Set FilterRange__ +#### __Example 11: Set FilterRange__ -{{region cs-radspreadprocessing-features-filtering_10}} +```csharp worksheet.Filter.ReapplyFilter(1); -{{endregion}} +``` @@ -417,11 +417,11 @@ Removing and clearing filters is done using the following methods exposed by the As is the case with the __ReapplyFilter()__ method, you can remove a filter by instance and by relative index of the column it is applied to. -#### __[C#] Example 12: Remove filter__ +#### __Example 12: Remove filter__ -{{region cs-radspreadprocessing-features-filtering_11}} +```csharp bool success = worksheet.Filter.RemoveFilter(1); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/find-and-replace.md b/libraries/radspreadprocessing/features/find-and-replace.md index f82e3e00..a4d705fe 100644 --- a/libraries/radspreadprocessing/features/find-and-replace.md +++ b/libraries/radspreadprocessing/features/find-and-replace.md @@ -50,9 +50,9 @@ Both Workbook and Worksheet classes expose methods that search their contents fo __Example 1__ creates a new workbook with two empty worksheets and assigns sample values to the sheets. The __FindOptions__ created below specifies that the search will be conducted for the whole workbook and will start from cell A1 of the first worksheet. The sample snippet illustrates how to use __Find()__ and __FindAll()__ methods. -#### __[C#] Example 1: Perform find an find all__ +#### __Example 1: Perform find an find all__ -{{region cs-radspreadprocessing-features-find-and-replace_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet1 = workbook.Worksheets.Add(); Worksheet worksheet2 = workbook.Worksheets.Add(); @@ -74,7 +74,7 @@ __Example 1__ creates a new workbook with two empty worksheets and assigns sampl FindResult findResult = workbook.Find(options); IEnumerable findResults = workbook.FindAll(options); -{{endregion}} +``` @@ -89,9 +89,9 @@ As a supplement to the __Find()__ and __FindAll()__ methods, the Workbook and Wo __Example 2__ creates a workbook from scratch with two empty worksheets and adds some sample values. The __ReplaceOptions__ instance specifies that the replace is performed on the whole workbook and includes formula values. The operation starts from cell A1 of the first worksheet and the search is done by columns. -#### __[C#] Example 2: Perform replace and replace all__ +#### __Example 2: Perform replace and replace all__ -{{region cs-radspreadprocessing-features-find-and-replace_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet1 = workbook.Worksheets.Add(); Worksheet worksheet2 = workbook.Worksheets.Add(); @@ -121,7 +121,7 @@ __Example 2__ creates a workbook from scratch with two empty worksheets and adds } workbook.ReplaceAll(options); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/formulas/cell-references.md b/libraries/radspreadprocessing/features/formulas/cell-references.md index f0387f5d..ca9034af 100644 --- a/libraries/radspreadprocessing/features/formulas/cell-references.md +++ b/libraries/radspreadprocessing/features/formulas/cell-references.md @@ -25,13 +25,13 @@ To display the sum of cells A1 and B1 in cell C1, you can invoke the __SetValue( __Example 1__ creates a workbook with a single worksheet before setting the value of C1. -#### __[C#] Example 1: Set reference value__ +#### __Example 1: Set reference value__ -{{region cs-radspreadprocessing-features-formulas-cell-references_0}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); workbook.ActiveWorksheet.Cells[0, 2].SetValue("=A1+B1"); -{{endregion}} +``` @@ -41,16 +41,16 @@ References may optionally specify the worksheet of the referenced cell/range. To __Example 2__ adds a worksheet to the workbook and renames the newly created instance. Moreover, the example sets the value of cell A1 in *Sheet1* to refer to cell B2 in the new sheet. -#### __[C#] Example 2: Set reference value from another sheet__ +#### __Example 2: Set reference value from another sheet__ -{{region cs-radspreadprocessing-features-formulas-cell-references_1}} +```csharp workbook.Worksheets.Add(); Worksheet sheet1 = workbook.Worksheets[0]; Worksheet samsWorksheet = workbook.Worksheets[1]; samsWorksheet.Name = "Sam'sWorksheet"; sheet1.Cells[0, 0].SetValue("='Sam''sWorksheet'!B2"); -{{endregion}} +``` @@ -61,12 +61,12 @@ References to whole rows or columns should always contain a colon separating the __Example 3__ demonstrates how to add a reference to a cell range. -#### __[C#] Example 3: Set reference to cell range__ +#### __Example 3: Set reference to cell range__ -{{region cs-radspreadprocessing-features-formulas-cell-references_2}} +```csharp sheet1.Cells[2, 2].SetValue("=SUM(A1:B2)"); samsWorksheet.Cells[0, 0].SetValue("=PRODUCT(D3:F5)"); -{{endregion}} +``` @@ -103,21 +103,21 @@ SpreadProcessing supports references to whole columns and whole rows. You can us - can refer to a single or to multiple rows/columns. Note that even for single row or column, the reference should be defined similarly to how you define ranges, e.g. you should use A:A to refer to column A. - can also be absolute, relative or mixed references. -#### [C#] Example 4: Use reference to a column +#### Example 4: Use reference to a column -{{region cs-radspreadprocessing-features-formulas-cell-references_3}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); workbook.ActiveWorksheet.Cells[1, 1].SetValue("=AVERAGE(A:A)"); -{{endregion}} +``` -#### [C#] Example 5: Use reference to multuple rows +#### Example 5: Use reference to multuple rows -{{region cs-radspreadprocessing-features-formulas-cell-references_4}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); workbook.ActiveWorksheet.Cells[0, 0].SetValue("=AVERAGE(1:5)"); -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/features/formulas/custom-functions.md b/libraries/radspreadprocessing/features/formulas/custom-functions.md index 7834fa14..d558dd39 100644 --- a/libraries/radspreadprocessing/features/formulas/custom-functions.md +++ b/libraries/radspreadprocessing/features/formulas/custom-functions.md @@ -50,11 +50,11 @@ Additionally each custom function needs to be registered through the __FunctionM __Example 1__ shows how to register a function class ArgumentsFunction, inheritor of FunctionBase. -#### __[C#] Example 1: Register custom function__ +#### __Example 1: Register custom function__ -{{region cs-radspreadprocessing-features-formulas-custom-functions_0}} +```csharp FunctionManager.RegisterFunction(new ArgumentsFunction()); -{{endregion}} +``` @@ -128,9 +128,9 @@ The value of these properties are from the enumerations [ArgumentInterpretation] __Example 2__ creates an instance of ArgumentConversionRules: -#### __[C#] Example 2: Create ArgumentConversionRules__ +#### __Example 2: Create ArgumentConversionRules__ -{{region cs-radspreadprocessing-features-formulas-custom-functions_1}} +```csharp public static readonly ArgumentConversionRules BoolFunctionConversion = new ArgumentConversionRules( emptyIndirectArgument: ArgumentInterpretation.Ignore, textNumberDirectArgument: ArgumentInterpretation.TreatAsError, @@ -138,7 +138,7 @@ __Example 2__ creates an instance of ArgumentConversionRules: nonTextNumberDirectArgument: ArgumentInterpretation.TreatAsError, nonTextNumberIndirectArgument: ArgumentInterpretation.Ignore, arrayArgument: ArrayArgumentInterpretation.UseAllElements); -{{endregion}} +``` @@ -196,9 +196,9 @@ __FunctionInfo__ has the following properties: __Example 3__ shows how to create an instance of FunctionInfo class. -#### __[C#] Example 3: Create FunctionInfo__ +#### __Example 3: Create FunctionInfo__ -{{region cs-radspreadprocessing-features-formulas-custom-functions_2}} +```csharp string functionName = "ADD"; string description = "Adds all the numbers in range of cells."; @@ -214,7 +214,7 @@ __Example 3__ shows how to create an instance of FunctionInfo class. }; FunctionInfo sumFunctionInfo = new FunctionInfo(functionName, FunctionCategory.MathTrig, description, requiredArguments, optionalArguments, 254, true); -{{endregion}} +``` @@ -229,9 +229,9 @@ The result of the function's calculations is the number of arguments passed to t __Example 4__ shows how to create the 'ARGUMENTS' function. -#### __[C#] Example 4: Create ARGUMENTS function__ +#### __Example 4: Create ARGUMENTS function__ -{{region cs-radspreadprocessing-features-formulas-custom-functions_3}} +```csharp public class Arguments : FunctionBase { public static readonly string FunctionName = "ARGUMENTS"; @@ -279,7 +279,7 @@ __Example 4__ shows how to create the 'ARGUMENTS' function. return new NumberExpression(context.Arguments.Length); } } -{{endregion}} +``` @@ -289,9 +289,9 @@ The next example is of a custom function named "E" that inherits from the __Func __Example 5__ shows how to create the 'E' function. -#### __[C#] Example 5: Create E function__ +#### __Example 5: Create E function__ -{{region cs-radspreadprocessing-features-formulas-custom-functions_4}} +```csharp public class E : FunctionBase { public static readonly string FunctionName = "E"; @@ -325,7 +325,7 @@ __Example 5__ shows how to create the 'E' function. return NumberExpression.E; } } -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/formulas/formulas.md b/libraries/radspreadprocessing/features/formulas/formulas.md index f879fc1e..2422e4a7 100644 --- a/libraries/radspreadprocessing/features/formulas/formulas.md +++ b/libraries/radspreadprocessing/features/formulas/formulas.md @@ -35,13 +35,13 @@ In order to set the value of a cell to a formula use the __SetValue()__ method o __Example 1__ creates a workbook from scratch and adds a worksheet. Further, the code assigns the value =3+4 to cell A1. -#### __[C#] Example 1: Set formula__ +#### __Example 1: Set formula__ -{{region cs-radspreadprocessing-features-formulas_0}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); workbook.ActiveWorksheet.Cells[0, 0].SetValue("=3+4"); -{{endregion}} +``` @@ -51,9 +51,9 @@ Additionally to entering formulas in cells, you can retrieve and inspect formula A closer look at the value of cell A1 will reveal that the two methods __GetValueAsString()__ and __GetResultValueAsString()__ return the original string of the expression and string of the computed result, respectively. Similarly, the __FormulaCellValue__ offers information about the __CellValueType__ of its value and result value through the __ValueType__ and __ResultValueType__ properties. -#### __[C#] Example 2: Get formula value__ +#### __Example 2: Get formula value__ -{{region cs-radspreadprocessing-features-formulas_1}} +```csharp FormulaCellValue formulaCellValue = workbook.ActiveWorksheet.Cells[0, 0].GetValue().Value as FormulaCellValue; if (formulaCellValue != null) { @@ -73,7 +73,7 @@ A closer look at the value of cell A1 will reveal that the two methods __GetValu CellValueType resultValueType = formulaCellValue.ResultValueType; //resultValueType = Number } -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/freeze-panes.md b/libraries/radspreadprocessing/features/freeze-panes.md index 9347a87c..0e1f7ddb 100644 --- a/libraries/radspreadprocessing/features/freeze-panes.md +++ b/libraries/radspreadprocessing/features/freeze-panes.md @@ -77,22 +77,22 @@ If the top left cell indices of the fixed pane and of the scrollable pane are no The result illustrated in __Figure 3__ can be achieved with the code from __Example 1__. -#### __[C#] Example 1: Freezing panes__ -{{region cs-radspreadprocessing-features-freeze-panes_01}} +#### __Example 1: Freezing panes__ +```csharp CellIndex fixedPaneTopLeftCellIndex = new CellIndex(2, 2); CellIndex scrollableTopLeftCellIndex = new CellIndex(5, 8); workbook.ActiveWorksheet.ViewState.FreezePanes(fixedPaneTopLeftCellIndex, 1, 4, scrollableTopLeftCellIndex); -{{endregion}} +``` ### Horizontal and Vertical Split If you would like to create a vertical or horizontal split, all you need to do is specify either the row count or the column count to be equal to zero. -#### __[C#] Example 2: Vertical split__ -{{region cs-radspreadprocessing-features-freeze-panes_02}} +#### __Example 2: Vertical split__ +```csharp CellIndex fixedPaneTopLeftCellIndex = new CellIndex(2, 2); workbook.ActiveWorksheet.ViewState.FreezePanes(fixedPaneTopLeftCellIndex, 0, 4); -{{endregion}} +``` The result from __Example 2__ is shown on __Figure 4__. @@ -118,12 +118,12 @@ Another option to freeze the panes in a worksheet is to use the Pane property of The state from __Figure 3__ can be achieved with the code from __Example 3__. -#### __[C#] Example 3: Freeze panes through the Pane class__ -{{region cs-radspreadprocessing-features-freeze-panes_03}} +#### __Example 3: Freeze panes through the Pane class__ +```csharp CellIndex scrollableTopLeftCellIndex = new CellIndex(5, 8); Pane pane = new Pane(scrollableTopLeftCellIndex, 4, 1, ViewportPaneType.Scrollable); workbook.ActiveWorksheet.ViewState.Pane = pane; -{{endregion}} +``` > Regardless of the method used to freeze the panes of a worksheet, you should take care not to place the top left index of the frozen pane below or to the right of the index determined by the frozen row count and the frozen column count. Doing so may result in an invalid document and unexpected behavior. @@ -132,17 +132,17 @@ The state from __Figure 3__ can be achieved with the code from __Example 3__. In order to unfreeze the panes of the worksheet, you need to use the same methods as above but specify zero for number of frozen rows and columns. -#### __[C#] Example 4: Unfreezing panes__ -{{region cs-radspreadprocessing-features-freeze-panes_04}} +#### __Example 4: Unfreezing panes__ +```csharp workbook.ActiveWorksheet.ViewState.FreezePanes(0, 0); -{{endregion}} +``` Another option is to set the Pane property of the ViewState to null. -#### __[C#] Example 4: Unfreezing panes through the Pane class__ -{{region cs-radspreadprocessing-features-freeze-panes_05}} +#### __Example 4: Unfreezing panes through the Pane class__ +```csharp workbook.ActiveWorksheet.ViewState.Pane = null; -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/complete-context-question-processor.md b/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/complete-context-question-processor.md index 05cab5d3..734d534e 100644 --- a/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/complete-context-question-processor.md +++ b/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/complete-context-question-processor.md @@ -56,7 +56,7 @@ The **CompleteContextProcessorSettings** class defines configuration options for The following example demonstrates how to use the **CompleteContextQuestionProcessor** to ask questions about an Excel document, including working with specific document pages. For setting up the AI client as shown in this example, see the [AI Provider Setup]({%slug radspreadprocessing-features-gen-ai-powered-document-insights-prerequisites%}#ai-provider-setup) section: -#### __[C#] Example 1: Using CompleteContextQuestionProcessor__ +#### __Example 1: Using CompleteContextQuestionProcessor__ diff --git a/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/getting-started.md b/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/getting-started.md index d699097f..5ed3091c 100644 --- a/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/getting-started.md +++ b/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/getting-started.md @@ -19,7 +19,7 @@ The following example demonstrates how to use the GenAI-powered Document Insight >important For .NET {{site.mindotnetversion}}+ (Target OS Windows) with [Packages for .NET {{site.mindotnetversion}} and .NET {{site.maxdotnetversion}} for Windows]({%slug available-nuget-packages%}#packages-for-net-framework-and-net-{{site.mindotnetversion}}-and-net-{{site.maxdotnetversion}}-for-windows), an [IEmbedder]({%slug radspreadprocessing-features-gen-ai-powered-document-insights-partial-context-question-processor%}#implementing-custom-iembedder) implementation is required for the [PartialContextQuestionProcessor]({%slug radspreadprocessing-features-gen-ai-powered-document-insights-partial-context-question-processor%}). -#### [C#] Example 1: Using GenAI-powered Document Insights +#### Example 1: Using GenAI-powered Document Insights diff --git a/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/prerequisites.md b/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/prerequisites.md index 230bfcbb..c610dc31 100644 --- a/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/prerequisites.md +++ b/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/prerequisites.md @@ -72,7 +72,7 @@ Before using the GenAI-powered Document Insights functionality, you need to set >caution The following code snippet is valid for Microsoft.Extensions.AI.OpenAI 9.3. The specific **IChatClient** initialization may be different according to the specific version. -#### __[C#] Example 1: Setting up Azure OpenAI__ +#### __Example 1: Setting up Azure OpenAI__ @@ -81,7 +81,7 @@ Before using the GenAI-powered Document Insights functionality, you need to set 1. Create an OpenAI account. 2. Get your API key from the OpenAI dashboard. -#### __[C#] Example 2: Setting up OpenAI__ +#### __Example 2: Setting up OpenAI__ @@ -93,7 +93,7 @@ Ollama allows you to run AI models locally on your machine. This is useful for d 2. Pull the model you want to use. 3. Start the Ollama server. -#### __[C#] Example 3: Setting up Ollama__ +#### __Example 3: Setting up Ollama__ diff --git a/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/summarization-processor.md b/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/summarization-processor.md index 843ed417..f2d8edfa 100644 --- a/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/summarization-processor.md +++ b/libraries/radspreadprocessing/features/gen-ai-powered-document-insights/summarization-processor.md @@ -47,7 +47,7 @@ The **SummarizationProcessorSettings** class defines configuration options for t * **ModelMaxInputTokenLimit**: The maximum input token limit for the model. * **PromptAddition**: An addition for the prompt used for summarization. It can be used for clarification purposes. -#### __[C#] Example 1: Configuring SummarizationProcessorSettings__ +#### __Example 1: Configuring SummarizationProcessorSettings__ @@ -65,7 +65,7 @@ For large documents that exceed the token limit of the model, **SummarizationPro This approach allows the processor to efficiently handle documents of any size, but it increases the number of API calls required. The **SummaryResourcesCalculated** event provides information about the expected resource usage, allowing you to decide whether to proceed with the operation. -#### __[C#] Example 2: Using SummarizationProcessor__ +#### __Example 2: Using SummarizationProcessor__ diff --git a/libraries/radspreadprocessing/features/grouping.md b/libraries/radspreadprocessing/features/grouping.md index d03fff17..121bd7b2 100644 --- a/libraries/radspreadprocessing/features/grouping.md +++ b/libraries/radspreadprocessing/features/grouping.md @@ -40,52 +40,52 @@ The maximum outline level is 7. There are two available options when grouping. The first option is to simply assign the outline level property of the rows or columns: -#### __[C#] Example 1: Grouping columns using outline level__ +#### __Example 1: Grouping columns using outline level__ -{{region cs-radspreadprocessing-features-grouping_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Columns[0].SetOutlineLevel(1); worksheet.Columns[1, 2].SetOutlineLevel(2); worksheet.Columns[3].SetOutlineLevel(1); -{{endregion}} +``` -#### __[VB.NET] Example 1: Grouping columns using outline level__ +#### __Example 1: Grouping columns using outline level__ -{{region vb-radspreadprocessing-features-grouping_6}} +```csharp Dim workbook = New Workbook() Dim worksheet = workbook.Worksheets.Add() worksheet.Columns(0).SetOutlineLevel(1) worksheet.Columns(1, 2).SetOutlineLevel(2) worksheet.Columns(3).SetOutlineLevel(1) -{{endregion}} +``` The other option is to use the Group method exposed by the row/column selection classes. -#### __[C#] Example 2: Grouping columns using the group method__ +#### __Example 2: Grouping columns using the group method__ -{{region cs-radspreadprocessing-features-grouping_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Columns[0, 3].Group(); worksheet.Columns[1, 2].Group(); -{{endregion}} +``` -#### __[VB.NET] Example 2: Grouping columns using the group method__ +#### __Example 2: Grouping columns using the group method__ -{{region vb-radspreadprocessing-features-grouping_7}} +```csharp Dim workbook = New Workbook() Dim worksheet = workbook.Worksheets.Add() worksheet.Columns(0, 3).Group() worksheet.Columns(1, 2).Group() -{{endregion}} +``` __Figure 2__ shows the result of both approaches. @@ -102,54 +102,54 @@ The following code snippets exemplify the two approaches to make these changes i ![](images/RadSpreadProcessing_Features_Grouping_03.png) -#### __[C#] Example 3: Ungrouping columns using the ungroup method__ +#### __Example 3: Ungrouping columns using the ungroup method__ -{{region cs-radspreadprocessing-features-grouping_2}} +```csharp worksheet.Rows[0, 1].Ungroup(); worksheet.Rows[4, 6].Ungroup(); -{{endregion}} +``` -#### __[VB.NET] Example 3: Ungrouping columns using the ungroup method__ +#### __Example 3: Ungrouping columns using the ungroup method__ -{{region vb-radspreadprocessing-features-grouping_8}} +```csharp worksheet.Rows(0, 1).Ungroup() worksheet.Rows(4, 6).Ungroup() -{{endregion}} +``` You can achieve the same result with the code in __Example 4__. -#### __[C#] Example 4: Ungrouping columns using outline level__ +#### __Example 4: Ungrouping columns using outline level__ -{{region cs-radspreadprocessing-features-grouping_3}} +```csharp worksheet.Rows[0, 1].ClearOutlineLevel(); worksheet.Rows[4, 6].SetOutlineLevel(1); -{{endregion}} +``` -#### __[VB.NET] Example 4: Ungrouping columns using outline level__ +#### __Example 4: Ungrouping columns using outline level__ -{{region vb-radspreadprocessing-features-grouping_9}} +```csharp worksheet.Rows(0, 1).ClearOutlineLevel() worksheet.Rows(4, 6).SetOutlineLevel(1) -{{endregion}} +``` ## Getting the Outline Level You can get the outline level of a row/column or a group of rows/columns using the code in __Example 5__: -#### __[C#] Example 5: Getting the OutlineLevel__ +#### __Example 5: Getting the OutlineLevel__ -{{region cs-radspreadprocessing-features-grouping_4}} +```csharp RangePropertyValue outlineLevelRangeValue = worksheet.Rows[0, 1].GetOutlineLevel(); int outLineLevel = outlineLevelRangeValue.Value; -{{endregion}} +``` -#### __[VB.NET] Example 5: Getting the OutlineLevel__ +#### __Example 5: Getting the OutlineLevel__ -{{region vb-radspreadprocessing-features-grouping_10}} +```csharp Dim outlineLevelRangeValue As RangePropertyValue(Of Integer) = worksheet.Rows(0, 1).GetOutlineLevel() Dim outLineLevel As Integer = outlineLevelRangeValue.Value -{{endregion}} +``` ## Setting the Position of the Summary Row or Column @@ -168,19 +168,19 @@ If you would like to change the placement of the summary row or column, this can Both properties have a default value of true. The following snippet shows how to set the value of the __SummaryColumnIsToRight__ and what result to expect in the produced file. -#### __[C#] Example 6: Setting the position of the summary column to left__ +#### __Example 6: Setting the position of the summary column to left__ -{{region cs-radspreadprocessing-features-grouping_5}} +```csharp worksheet.GroupingProperties.SummaryColumnIsToRight = false; -{{endregion}} +``` -#### __[VB.NET] Example 6: Setting the position of the summary column to left__ +#### __Example 6: Setting the position of the summary column to left__ -{{region vb-radspreadprocessing-features-grouping_11}} +```csharp worksheet.GroupingProperties.SummaryColumnIsToRight = False -{{endregion}} +``` #### Figure 5: Left summary column ![](images/RadSpreadProcessing_Features_Grouping_05.png) diff --git a/libraries/radspreadprocessing/features/headers-and-footers.md b/libraries/radspreadprocessing/features/headers-and-footers.md index 7224c54b..f58b8d79 100644 --- a/libraries/radspreadprocessing/features/headers-and-footers.md +++ b/libraries/radspreadprocessing/features/headers-and-footers.md @@ -30,10 +30,10 @@ This article aims to present the Headers and Footers API in **RadSpreadprocessin **HeaderFooterSettings** is the class that defines how the headers and footers of some worksheet should look like. An instance of this class can be obtained through the propertied of [WorksheetPageSetup]({%slug radspreadprocessing-features-worksheetpagesetup%}#worksheetpagesetup-properties). -#### **[C#] Example 1: Get HeaderFooterSettings** -{{region cs-radspreadprocessing-features-headers-and-footers_0}} +#### **Example 1: Get HeaderFooterSettings** +```csharp HeaderFooterSettings settings = worksheet.WorksheetPageSetup.HeaderFooterSettings; -{{endregion}} +``` @@ -89,13 +89,13 @@ The **HeaderFooterSection** class defines the content of a particular header/foo **Example 2** shows how to set a sample content to header and footer sections. The code demonstrates how to insert a “*Date*” field in the right section of the header and a “*Page*” and a “*Number of pages*” fields in the center section of the footer. -#### **[C#] Example 2: Set a content to a header/footer section** +#### **Example 2: Set a content to a header/footer section** -{{region cs-radspreadprocessing-features-headers-and-footers_1}} +```csharp HeaderFooterSettings settings = worksheet.WorksheetPageSetup.HeaderFooterSettings; settings.Header.RightSection.Text = "Printed by Telerik"; settings.Footer.CenterSection.Text = "RadSpreadProcessing"; -{{endregion}} +``` The header and footer of the first page in the worksheet from the snippet above will be evaluated and rendered as shown in **Figure 1**. @@ -150,13 +150,13 @@ The following list describes all valid uses of the ampersand symbol sequences. I **Example 3** demonstrates how you could insert a date field in the header, a page number filed combined with a number of pages field in the footer of a worksheet . -#### **[C#] Example 3: Insert fields in header/footer** +#### **Example 3: Insert fields in header/footer** -{{region cs-radspreadprocessing-features-headers-and-footers_2}} +```csharp HeaderFooterSettings settings = worksheet.WorksheetPageSetup.HeaderFooterSettings; settings.Header.RightSection.Text = "Printed by Telerik on &D"; settings.Footer.CenterSection.Text = "Page &P of &N"; -{{endregion}} +``` **Figure 2** shows how the document will look like after applying the settings demonstrated in **Example 3**. @@ -176,12 +176,12 @@ In order to control the vertical positioning of the headers and footers on the p **Example 4** shows how you could set the margins of a worksheet using the predefined NormalMargins of PageMargins for the page margins, 0 inches for the footer margin and 1 inch for the header. -#### **[C#] Example 4: Setting margins to header/footer** +#### **Example 4: Setting margins to header/footer** -{{region cs-radspreadprocessing-features-headers-and-footers_3}} +```csharp PageMargins normalMargins = PageMargins.NormalMargins; worksheet.WorksheetPageSetup.Margins = new PageMargins(normalMargins.Left, normalMargins.Top, normalMargins.Right, normalMargins.Bottom, Unit.DipToInch(0), Unit.DipToInch(1)); -{{endregion}} +``` The [Unit class](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Media.Unit.html), used in **Example 4** provides convenient methods that can help you convert a value between different measurement units. diff --git a/libraries/radspreadprocessing/features/history.md b/libraries/radspreadprocessing/features/history.md index 57ebfb0f..49c11860 100644 --- a/libraries/radspreadprocessing/features/history.md +++ b/libraries/radspreadprocessing/features/history.md @@ -29,12 +29,12 @@ By default, the __WorkbookHistory__ class does not record all changes introduced __Example 1__ enables the history of a workbook. -#### __[C#] Example 1: Enable history__ +#### __Example 1: Enable history__ -{{region cs-radspreadprocessing-features-history_2}} +```csharp Workbook workbook = new Workbook(); workbook.History.IsEnabled = true; -{{endregion}} +``` @@ -46,9 +46,9 @@ Once the history is enabled you can invoke its __Undo()__ and __Redo()__ methods __Example 2__ creates a new workbook with a single worksheet and sets the value of cell *A1* twice. Further, the snippet performs the undo and redo actions. -#### __[C#] Example 2: Perform undo and redo__ +#### __Example 2: Perform undo and redo__ -{{region cs-radspreadprocessing-features-history_0}} +```csharp Workbook workbook = new Workbook(); workbook.History.IsEnabled = true; Worksheet worksheet = workbook.Worksheets.Add(); @@ -58,7 +58,7 @@ __Example 2__ creates a new workbook with a single worksheet and sets the value workbook.History.Undo(); workbook.History.Redo(); -{{endregion}} +``` @@ -70,9 +70,9 @@ The __Workbook__ history offers a friendly API that allows grouping multiple cha __Example 3__ demonstrates how to create an undo group. -#### __[C#] Example 3: Create undo group__ +#### __Example 3: Create undo group__ -{{region cs-radspreadprocessing-features-history_1}} +```csharp Workbook workbook = new Workbook(); workbook.History.IsEnabled = true; Worksheet worksheet = workbook.Worksheets.Add(); @@ -86,7 +86,7 @@ __Example 3__ demonstrates how to create an undo group. workbook.History.Undo(); workbook.History.Redo(); -{{endregion}} +``` @@ -98,10 +98,10 @@ To clear the history you just have to call the __Clear()__ method of the __Workb __Example 4__ clears the history of a workbook. -#### __[C#] Example 4: Clear history__ +#### __Example 4: Clear history__ -{{region cs-radspreadprocessing-features-history_3}} +```csharp workbook.History.Clear(); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/hyperlink.md b/libraries/radspreadprocessing/features/hyperlink.md index 49689ac4..0bc8a6d9 100644 --- a/libraries/radspreadprocessing/features/hyperlink.md +++ b/libraries/radspreadprocessing/features/hyperlink.md @@ -54,43 +54,43 @@ You can create instances of each of those types, using the static methods of the __Example 1__ creates a hyperlink to a web address. -#### __[C#] Example 1: Create link to web address__ +#### __Example 1: Create link to web address__ -{{region cs-radspreadprocessing-features-hyperlink_0}} +```csharp HyperlinkInfo webAddres = HyperlinkInfo.CreateHyperlink("http://www.telerik.com", "Telerik"); -{{endregion}} +``` __Example 2__ creates a hyperlink to a cell range somewhere in the document. -#### __[C#] Example 2: Create link to place in the document__ +#### __Example 2: Create link to place in the document__ -{{region cs-radspreadprocessing-features-hyperlink_1}} +```csharp HyperlinkInfo inDocument = HyperlinkInfo.CreateInDocumentHyperlink("A1:B3", "Go to A1:B3"); -{{endregion}} +``` __Example 3__ creates a hyperlink to a cell in another worksheet of the document. -#### __[C#] Example 3: Create link to a cell in another worksheet of the document__ +#### __Example 3: Create link to a cell in another worksheet of the document__ -{{region cs-radspreadprocessing-features-hyperlink_2}} +```csharp HyperlinkInfo inDocument = HyperlinkInfo.CreateInDocumentHyperlink("'Sheet2'!A1", "Go to Sheet2"); -{{endregion}} +``` __Example 4__ shows how you can create a hyperlink to an email address. -#### __[C#] Example 4: Create link to email address__ +#### __Example 4: Create link to email address__ -{{region cs-radspreadprocessing-features-hyperlink_3}} +```csharp HyperlinkInfo mailto = HyperlinkInfo.CreateMailtoHyperlink("someOne@someCompany.com", "someSubject", "Mail to someOne"); -{{endregion}} +``` @@ -102,12 +102,12 @@ To add a hyperlink, you need to specify a cell range that will contain the hyper __Example 5__ assigns the hyperlink created in __Example 1__ to A1. -#### __[C#] Example 5: Add hyperlink__ +#### __Example 5: Add hyperlink__ -{{region cs-radspreadprocessing-features-hyperlink_4}} +```csharp CellIndex a1Index = new CellIndex(0, 0); SpreadsheetHyperlink spreadsheetHyperlink = worksheet.Hyperlinks.Add(a1Index, webAddres); -{{endregion}} +``` @@ -119,24 +119,24 @@ There are several ways you can retrieve hyperlinks from the __HyperlinkCollectio __Example 6__ defines two indexes and then a cell range out of those indexes. -#### __[C#] Example 6: Define cell range__ +#### __Example 6: Define cell range__ -{{region cs-radspreadprocessing-features-hyperlink_5}} +```csharp CellIndex a1Index = new CellIndex(0, 0); CellIndex b3Index = new CellIndex(2, 1); CellRange a1b3Range = new CellRange(a1Index, b3Index); -{{endregion}} +``` __Example 7__ gets all hyperlinks the ranges of which are contained in the cell range from __Example 5__. -#### __[C#] Example 7: Get hyperlinks in cell range__ +#### __Example 7: Get hyperlinks in cell range__ -{{region cs-radspreadprocessing-features-hyperlink_6}} +```csharp IEnumerable containingHyperlinks = worksheet.Hyperlinks.GetContainingHyperlinks(a1b3Range); -{{endregion}} +``` @@ -146,22 +146,22 @@ __Example 6__ defines two indexes and then a cell range out of those indexes. __Example 8__ gets all hyperlinks the ranges of which intersect with the cell range from __Example 5__. -#### __[C#] Example 8: Get hyperlinks intersecting with cell range__ +#### __Example 8: Get hyperlinks intersecting with cell range__ -{{region cs-radspreadprocessing-features-hyperlink_7}} +```csharp IEnumerable intersectingHyperlinks = worksheet.Hyperlinks.GetIntersectingHyperlinks(a1b3Range); -{{endregion}} +``` __Example 9__ gets the last added hyperlink that intersects with the cell range from __Example 5__. -#### __[C#] Example 9: Get last hyperlink intersecting with cell range__ +#### __Example 9: Get last hyperlink intersecting with cell range__ -{{region cs-radspreadprocessing-features-hyperlink_8}} +```csharp bool canGetHyperlink = worksheet.Hyperlinks.TryGetHyperlink(a1Index, out spreadsheetHyperlink); -{{endregion}} +``` @@ -171,11 +171,11 @@ __Example 6__ defines two indexes and then a cell range out of those indexes. __Example 10__ gets the hyperlink which range matches the cell range from __Example 5__. -#### __[C#] Example 10: Get hyperlink exactly matching cell range__ +#### __Example 10: Get hyperlink exactly matching cell range__ -{{region cs-radspreadprocessing-features-hyperlink_9}} +```csharp bool canGetHyperlinkExact = worksheet.Hyperlinks.TryGetHyperlinkExact(a1b3Range, out spreadsheetHyperlink); -{{endregion}} +``` @@ -187,14 +187,14 @@ To remove a hyperlink you need to retrieve a __SpreadsheetHyperlink__ object and __Example 11__ removes a hyperlink. -#### __[C#] Example 11: Remove hyperlink__ +#### __Example 11: Remove hyperlink__ -{{region cs-radspreadprocessing-features-hyperlink_10}} +```csharp SpreadsheetHyperlink spreadsheetHyperlink; if (worksheet.Hyperlinks.TryGetHyperlink(a1Index, out spreadsheetHyperlink)) { worksheet.Hyperlinks.Remove(spreadsheetHyperlink); } -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/merge-unmerge-cells.md b/libraries/radspreadprocessing/features/merge-unmerge-cells.md index 9b49d376..ef7fdcee 100644 --- a/libraries/radspreadprocessing/features/merge-unmerge-cells.md +++ b/libraries/radspreadprocessing/features/merge-unmerge-cells.md @@ -25,16 +25,16 @@ Let's take a closer look at how the two methods for merging change the following __Example 1__ constructs a worksheet that will be used as a starting point in the next few examples. -#### __[C#] Example 1: Construct worksheet__ +#### __Example 1: Construct worksheet__ -{{region cs-radspreadprocessing-features-merge-unmerge-cells_8}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetValue("A1"); worksheet.Cells[1, 0].SetValue("A2"); worksheet.Cells[0, 1].SetValue("B1"); worksheet.Cells[1, 1].SetValue("B2"); -{{endregion}} +``` @@ -47,16 +47,16 @@ __Figure 1__ shows the result of the snippet in __Example 1__. __Example 2__ illustrates how to perform a merge operation on the cell region *A1:B2*. -#### __[C#] Example 2: Perform merge operation__ +#### __Example 2: Perform merge operation__ -{{region cs-radspreadprocessing-features-merge-unmerge-cells_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellIndex A1Cell = new CellIndex(0, 0); CellIndex B2Cell = new CellIndex(1, 1); worksheet.Cells[A1Cell, B2Cell].Merge(); -{{endregion}} +``` @@ -75,15 +75,15 @@ Let’s see how the __MergeAcross()__ method will change the same region in the __Example 3__ illustrates how to perform a merge operation on the cell region *A1:B2*. -#### __[C#] Example 3: Perform merge across__ +#### __Example 3: Perform merge across__ -{{region cs-radspreadprocessing-features-merge-unmerge-cells_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellIndex A1Cell = new CellIndex(0, 0); CellIndex B2Cell = new CellIndex(1, 1); worksheet.Cells[A1Cell, B2Cell].MergeAcross(); -{{endregion}} +``` @@ -102,15 +102,15 @@ If you now try to merge a cell range that intersects with another merged cell ra __Example 4__ merges across the region *A1:B2* and then performs another merge on the cells in the region *B2:C3*: -#### __[C#] Example 4: Intersect cell range with merged cell range__ +#### __Example 4: Intersect cell range with merged cell range__ -{{region cs-radspreadprocessing-features-merge-unmerge-cells_2}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellIndex B2Cell = new CellIndex(1, 1); CellIndex C3Cell = new CellIndex(2, 2); worksheet.Cells[B2Cell, C3Cell].Merge(); -{{endregion}} +``` @@ -136,12 +136,12 @@ The Cells class exposes a __GetIsMerged()__ method that allows you to determine __Example 5__ checks if cell A1 is in a merged region. -#### __[C#] Example 5: Check if cell is in merged cell range__ +#### __Example 5: Check if cell is in merged cell range__ -{{region cs-radspreadprocessing-features-merge-unmerge-cells_3}} +```csharp CellIndex A1CellIndex = new CellIndex(0, 0); bool isA1merged = worksheet.Cells.GetIsMerged(A1CellIndex); -{{endregion}} +``` @@ -153,13 +153,13 @@ Another way to check if a cell belongs to a merged range is to use the __TryGetC __Example 6__ shows how to use TryGetContainingMergedRange() method. -#### __[C#] Example 6: Try get merged cell range__ +#### __Example 6: Try get merged cell range__ -{{region cs-radspreadprocessing-features-merge-unmerge-cells_4}} +```csharp CellIndex A1CellIndex = new CellIndex(0, 0); CellRange mergedCellRange; bool canGetContainingMergedCellRange = worksheet.Cells.TryGetContainingMergedRange(A1CellIndex, out mergedCellRange); -{{endregion}} +``` @@ -171,14 +171,14 @@ Use the __GetContainingMergedRanges()__ method of the __Cells__ class to retriev __Example 7__ shows how to use GetContainingMergedRanges() method. -#### __[C#] Example 7: Get all containing merged ranges in a range__ +#### __Example 7: Get all containing merged ranges in a range__ -{{region cs-radspreadprocessing-features-merge-unmerge-cells_5}} +```csharp CellIndex A1CellIndex = new CellIndex(0, 0); CellIndex N33CellIndex = new CellIndex(32, 13); CellRange A1N33CellRange = new CellRange(A1CellIndex, N33CellIndex); IEnumerable containingMergedCellRanges = worksheet.Cells.GetContainingMergedRanges(A1N33CellRange); -{{endregion}} +``` @@ -190,13 +190,13 @@ The __GetMergedCellRanges()__ method of the __Cells__ class returns an enumerati __Example 8__ shows how to get all merged ranges in a worksheet. -#### __[C#] Example 8: Get all merged ranges__ +#### __Example 8: Get all merged ranges__ -{{region cs-radspreadprocessing-features-merge-unmerge-cells_6}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); IEnumerable mergedCellRanges = worksheet.Cells.GetMergedCellRanges(); -{{endregion}} +``` @@ -211,14 +211,14 @@ Figure 5: Sample worksheet __Example 9__ invokes the __Unmerge()__ method for the region *B2:D4* of the worksheet from __Figure 5__, which intersects with the two merged ranges. -#### __[C#] Example 9: Unmerge cells__ +#### __Example 9: Unmerge cells__ -{{region cs-radspreadprocessing-features-merge-unmerge-cells_7}} +```csharp CellIndex B2CellIndex = new CellIndex(1, 1); CellIndex D4CellIndex = new CellIndex(3, 3); CellRange B2D4CellSelection = new CellRange(B2CellIndex, D4CellIndex); worksheet.Cells[B2D4CellSelection].Unmerge(); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/named-ranges.md b/libraries/radspreadprocessing/features/named-ranges.md index 2706778c..bc2dcf8d 100644 --- a/libraries/radspreadprocessing/features/named-ranges.md +++ b/libraries/radspreadprocessing/features/named-ranges.md @@ -86,9 +86,9 @@ __Defined name__: A name that can contain any value that can be stored in a cell __Example 1__ demonstrates how to add and use defined names. The code creates a workbook with one worksheet containing four values. Further, the example adds one global name called CorporateTax containing a constant value of 16 percent and a local GrossProfit name referring to the four values stored in Sheet1. Also, the cell A5 is assigned a value that uses both GrossProfit and CorporateTax names. -#### __[C#] Example 1: Add and use names__ +#### __Example 1: Add and use names__ -{{region cs-radspreadprocessing-features-named-ranges_0}} +```csharp Workbook workbook = new Workbook(); Worksheet sheet1 = workbook.Worksheets.Add(); @@ -103,7 +103,7 @@ __Example 1__ demonstrates how to add and use defined names. The code creates a workbook.Names.Remove("CorporateTax"); sheet1.Names.Remove("GrossProfit"); -{{endregion}} +``` > Other than the name, the __RefersTo__ value and the comment parameter, the Add method requires a cell index. The reason for this is that with some defined names, the cell index associated with their creation is relevant to the resulting value. More specifically, this is the case when the __RefersTo__ property includes a relative cell reference. For example, in the case of a name where the __RefersTo__ field is "=C3" (as opposed to "=$C$3") and the cell index is CellIndex(0,0), i.e. A1, the defined name will always point two rows lower and two columns to the right of the current cell it is used in: if you enter =Name in A1, A1 will have the value of C3 and if you enter the same in B2, it will have the value of D4. > @@ -118,12 +118,12 @@ The NameCollection class exposes a __Remove()__ method that takes a string param __Example 2__ shows how to remove one of the names added in __Example 1__. -#### __[C#] Example 2: Remove name__ +#### __Example 2: Remove name__ -{{region cs-radspreadprocessing-features-named-ranges_1}} +```csharp workbook.Names.Remove("CorporateTax"); sheet1.Names.Remove("GrossProfit"); -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/features/notes.md b/libraries/radspreadprocessing/features/notes.md index ae5d5314..0cba2d53 100644 --- a/libraries/radspreadprocessing/features/notes.md +++ b/libraries/radspreadprocessing/features/notes.md @@ -37,9 +37,9 @@ Since R1 2022 the SpreadProcessing library supports working with notes. The Note To add a note you need to specify the cell index to which the note will be related, the position where the note should be placed, the author, and the text content. Specifying the position is optional and by default, the note is placed next to the related cell. -#### __[C#] Example 1: Add note__ +#### __Example 1: Add note__ -{{region cs-radspreadprocessing-features-notes_0}} +```csharp CellIndex relatedCellIndex = new CellIndex(1, 1); CellIndex cellIndex = new CellIndex(5, 5); @@ -49,20 +49,20 @@ To add a note you need to specify the cell index to which the note will be relat worksheet.Notes.Add(relatedCellIndex, cellIndex, author, text); -{{endregion}} +``` The above snippet will add a note in cell B2 with a position on cell F6. ### Removing Notes -#### __[C#] Example 2: Remove note__ +#### __Example 2: Remove note__ -{{region cs-radspreadprocessing-features-notes_1}} +```csharp var note = worksheet.Notes[0]; worksheet.Notes.Remove(note); -{{endregion}} +``` ### Hide/Show notes @@ -74,14 +74,14 @@ You can use one of the following methods to show/hide single or all notes: * __Hide(SpreadsheetNote note):__ Hide the specified note from the collection. * __Show(SpreadsheetNote note):__ Show the specified note from the collection. -#### __[C#] Example 3:Hide note__ +#### __Example 3:Hide note__ -{{region cs-radspreadprocessing-features-notes_2}} +```csharp var note = worksheet.Notes[0]; worksheet.Notes.Hide(note); -{{endregion}} +``` ### Events diff --git a/libraries/radspreadprocessing/features/number-formats.md b/libraries/radspreadprocessing/features/number-formats.md index 17afa9f9..aedf154e 100644 --- a/libraries/radspreadprocessing/features/number-formats.md +++ b/libraries/radspreadprocessing/features/number-formats.md @@ -53,165 +53,165 @@ The number format is represented by the **CellValueFormat** class. You can set i The following examples demonstrate how to apply a predefined format to a **CellSelection**: -#### **[C#] Example 1: Apply general format** -{{region cs-radspreadprocessing-features-number-formats_0}} +#### **Example 1: Apply general format** +```csharp CellValueFormat generalFormat = new CellValueFormat("General"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); cellSelectionA1.SetFormat(generalFormat); -{{endregion}} +``` **Example 1** produces the following result: ![Rad Spread Processing Features Number Formatting 00](images/RadSpreadProcessing_Features_Number_Formatting_00.jpg) -#### **[C#] Example 2: Apply number format** -{{region cs-radspreadprocessing-features-number-formats_1}} +#### **Example 2: Apply number format** +```csharp CellValueFormat numberFormat = new CellValueFormat("0.00"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); cellSelectionA1.SetFormat(numberFormat); -{{endregion}} +``` **Example 2** produces the following result: ![Rad Spread Processing Features Number Formatting 01](images/RadSpreadProcessing_Features_Number_Formatting_01.jpg) -#### **[C#] Example 3: Apply currency format** +#### **Example 3: Apply currency format** -{{region cs-radspreadprocessing-features-number-formats_2}} +```csharp CellValueFormat currencyFormat = new CellValueFormat("$#,##0.00"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); cellSelectionA1.SetFormat(currencyFormat); -{{endregion}} +``` **Example 3** produces the following result: ![Rad Spread Processing Features Number Formatting 02](images/RadSpreadProcessing_Features_Number_Formatting_02.jpg) -#### **[C#] Example 4: Apply accounting format** +#### **Example 4: Apply accounting format** -{{region cs-radspreadprocessing-features-number-formats_3}} +```csharp CellValueFormat accountingFormat = new CellValueFormat("_($* #,##0.00_);_($* (#,##0.00);_($* \" - \"??_);_(@_)"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); cellSelectionA1.SetFormat(accountingFormat); -{{endregion}} +``` **Example 4** produces the following result: ![Rad Spread Processing Features Number Formatting 3](images/RadSpreadProcessing_Features_Number_Formatting_03.jpg) -#### **[C#] Example 5: Apply date format** +#### **Example 5: Apply date format** -{{region cs-radspreadprocessing-features-number-formats_4}} +```csharp CellValueFormat dateFormat = new CellValueFormat("m/d/yyyy"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); // OR cellSelectionA1.SetValue(new DateTime(1903, 5, 18, 13, 37, 46)); cellSelectionA1.SetFormat(dateFormat); -{{endregion}} +``` **Example 5** produces the following result: ![Rad Spread Processing Features Number Formatting 04](images/RadSpreadProcessing_Features_Number_Formatting_04.jpg) In order to show **milliseconds** in **Date Format** the predefined format could be modified like: _"m/d/yyyy HH:mm:ss.SSS"_. More information of how to create your own number format or modify one of the predefined types you can find in [Format Codes]({%slug radspreadprocessing-features-format-codes%}) help article. -#### **[C#] Example 6: Apply time format** +#### **Example 6: Apply time format** -{{region cs-radspreadprocessing-features-number-formats_5}} +```csharp CellValueFormat timeFormat = new CellValueFormat("h:mm:ss AM/PM"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); // OR cellSelectionA1.SetValue(new DateTime(1903, 5, 18, 13, 37, 46)); cellSelectionA1.SetFormat(timeFormat); -{{endregion}} +``` **Example 6** produces the following result: ![Rad Spread Processing Features Number Formatting 05](images/RadSpreadProcessing_Features_Number_Formatting_05.jpg) In order to show **milliseconds** in **Time Format** the predefined format could be modified like: _"HH:mm:ss.SSS"_. More information of how to create your own number format or modify one of the predefined types you can find in [Format Codes]({%slug radspreadprocessing-features-format-codes%}) help article. -#### **[C#] Example 7: Apply percentage format** +#### **Example 7: Apply percentage format** -{{region cs-radspreadprocessing-features-number-formats_6}} +```csharp CellValueFormat percentageFormat = new CellValueFormat("0.00%"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); cellSelectionA1.SetFormat(percentageFormat); -{{endregion}} +``` **Example 7** produces the following result: ![Rad Spread Processing Features Number Formatting 06](images/RadSpreadProcessing_Features_Number_Formatting_06.jpg) -#### **[C#] Example 8: Apply fraction format** +#### **Example 8: Apply fraction format** -{{region cs-radspreadprocessing-features-number-formats_7}} +```csharp CellValueFormat fractionFormat = new CellValueFormat("# ?/?"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); cellSelectionA1.SetFormat(fractionFormat); -{{endregion}} +``` **Example 8** produces the following result: ![Rad Spread Processing Features Number Formatting 07](images/RadSpreadProcessing_Features_Number_Formatting_07.jpg) -#### **[C#] Example 9: Apply scientific format** +#### **Example 9: Apply scientific format** -{{region cs-radspreadprocessing-features-number-formats_8}} +```csharp CellValueFormat scientificFormat = new CellValueFormat("0.00E+00"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); cellSelectionA1.SetFormat(scientificFormat); -{{endregion}} +``` **Example 9** produces the following result: ![Rad Spread Processing Features Number Formatting 08](images/RadSpreadProcessing_Features_Number_Formatting_08.jpg) -#### **[C#] Example 10: Apply text format** +#### **Example 10: Apply text format** -{{region cs-radspreadprocessing-features-number-formats_9}} +```csharp CellValueFormat textFormat = new CellValueFormat("@"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); cellSelectionA1.SetFormat(textFormat); -{{endregion}} +``` **Example 10** produces the following result: ![Rad Spread Processing Features Number Formatting 09](images/RadSpreadProcessing_Features_Number_Formatting_09.jpg) -#### **[C#] Example 11: Apply special format** +#### **Example 11: Apply special format** -{{region cs-radspreadprocessing-features-number-formats_10}} +```csharp CellValueFormat specialFormat = new CellValueFormat("00000-0000"); CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; cellSelectionA1.SetValue(1234.56789); cellSelectionA1.SetFormat(specialFormat); -{{endregion}} +``` **Example 11** produces the following result: ![Rad Spread Processing Features Number Formatting 10](images/RadSpreadProcessing_Features_Number_Formatting_10.jpg) -#### **[C#] Example 12: Apply custom format** +#### **Example 12: Apply custom format** -{{region cs-radspreadprocessing-features-number-formats_11}} +```csharp CellValueFormat specialFormat = new CellValueFormat("[Green]$#,##0_);[Red]$(#,##0);\"zero\";[Blue]\"Text: \" @"); @@ -230,7 +230,7 @@ In order to show **milliseconds** in **Time Format** the predefined format could CellSelection cellSelectionB2 = worksheet.Cells[new CellIndex(1, 1)]; cellSelectionB2.SetValue(-1234.56789); cellSelectionB2.SetFormat(specialFormat); -{{endregion}} +``` **Example 12** produces the following result: ![Rad Spread Processing Features Number Formatting 11](images/RadSpreadProcessing_Features_Number_Formatting_11.jpg) @@ -251,13 +251,13 @@ You can retrieve the number format of any cell selection using the __GetFormat() __Example 13__ demonstrates how to get the __Number__ format of cell *A1*: -#### __[C#] Example 13: Get number format__ +#### __Example 13: Get number format__ -{{region cs-radspreadprocessing-features-number-formats_12}} +```csharp CellSelection cellSelectionA1 = worksheet.Cells[new CellIndex(0, 0)]; CellValueFormat cellSelectioA1Format = cellSelectionA1.GetFormat().Value; -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/protection/fips-compliance.md b/libraries/radspreadprocessing/features/protection/fips-compliance.md index d2f8380d..887d9217 100644 --- a/libraries/radspreadprocessing/features/protection/fips-compliance.md +++ b/libraries/radspreadprocessing/features/protection/fips-compliance.md @@ -20,11 +20,11 @@ If you need to comply with the FIPS 140-2 standard, you can disable the forbiden >Enforcing FIPS compliance might cause exceptions when importing documents which use any of the forbidden algorithms. -#### [C#] Example 1: Enforce FIPS -{{region radspreadprocessing-features-protection-fips-compliance-0}} +#### Example 1: Enforce FIPS +```csharp HashingAlgorithmsProvider.EnforceFips1402(); -{{endregion}} +``` Enforcing the FIPS compliance should be done before using the Protection feature. diff --git a/libraries/radspreadprocessing/features/protection/workbook.md b/libraries/radspreadprocessing/features/protection/workbook.md index 66e7dfa8..279cc3fa 100644 --- a/libraries/radspreadprocessing/features/protection/workbook.md +++ b/libraries/radspreadprocessing/features/protection/workbook.md @@ -26,14 +26,14 @@ __Example 1__ illustrates how to create a workbook from scratch and protect it u >The protection functionality protects the workbook structure from being edited. If you need to protect the document so that it can be opened only after providing a password for it, you should encrypt it. The encryption functionality is currently not supported in SpreadProcessing and you can vote for its implementation using the [public request](https://feedback.telerik.com/document-processing/1356022-spreadprocessing-implement-encryption-of-workbook) for it. -#### __[C#] Example 1: Password-protect a Workbook__ +#### __Example 1: Password-protect a Workbook__ -{{region cs-radspreadprocessing-features-protection-workbook_0}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); workbook.Protect("telerik"); -{{endregion}} +``` @@ -45,16 +45,16 @@ Use the __Unprotect(string)__ method of the __Workbook__ class to remove the wor __Example 2__ demonstrates how to unprotect a workbook. -#### __[C#] Example 2: Unprotect a Workbook__ +#### __Example 2: Unprotect a Workbook__ -{{region cs-radspreadprocessing-features-protection-workbook_1}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); workbook.Protect("telerik"); workbook.Unprotect("telerik"); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/protection/worksheet.md b/libraries/radspreadprocessing/features/protection/worksheet.md index 4837a4f4..c2874889 100644 --- a/libraries/radspreadprocessing/features/protection/worksheet.md +++ b/libraries/radspreadprocessing/features/protection/worksheet.md @@ -26,16 +26,16 @@ The __Worksheet__ class exposes a __Protect()__ method that takes two parameters __Example 1__ sets the __IsLocked__ property of cell A1 to false and protects the worksheet using a password and the default protection options. Since by default all cells are locked, after the sheet is protected, the user will be able to edit the value only in cell A1 as it is explicitly marked as unlocked. -#### __[C#] Example 1: Protect a Worksheet__ +#### __Example 1: Protect a Worksheet__ -{{region cs-radspreadprocessing-features-protection-worksheet_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetIsLocked(false); worksheet.Protect("telerik", WorksheetProtectionOptions.Default); -{{endregion}} +``` @@ -45,15 +45,15 @@ Use the __Unprotect(string)__ method of the Worksheet class to remove the protec __Example 2__ demonstrates how to unprotect a worksheet. -#### __[C#] Example 2: Unprotect a Worksheet__ +#### __Example 2: Unprotect a Worksheet__ -{{region cs-radspreadprocessing-features-protection-worksheet_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Protect("telerik", WorksheetProtectionOptions.Default); worksheet.Unprotect("telerik"); -{{endregion}} +``` @@ -68,14 +68,14 @@ To achieve that, you need to pass a __WorksheetProtectionOptions__ instance as t __Example 3__ demonstrates how to protect a worksheet using WorksheetProtectionOptions. -#### __[C#] Example 3: Protect Worksheet with WorksheetProtectionOptions__ +#### __Example 3: Protect Worksheet with WorksheetProtectionOptions__ -{{region cs-radspreadprocessing-features-protection-worksheet_2}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); WorksheetProtectionOptions options = new WorksheetProtectionOptions(allowInsertRows: true, allowDeleteRows: true); worksheet.Protect("telerik", options); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/setting-the-culture.md b/libraries/radspreadprocessing/features/setting-the-culture.md index b61901e8..68dea9d9 100644 --- a/libraries/radspreadprocessing/features/setting-the-culture.md +++ b/libraries/radspreadprocessing/features/setting-the-culture.md @@ -11,11 +11,11 @@ position: 18 __RadSpreadProcessing__ allows you to set a culture that differs from the current thread culture. This can be achieved by creating a new __CultureHelper__. -#### __C# Setting the Culture__ +#### __Setting the Culture__ -{{region cs-radspreadprocessing-features-setting-the-culture_1}} +```csharp Telerik.Windows.Documents.Spreadsheet.Formatting.FormatHelper.CultureHelper = new SpreadsheetCultureHelper(new CultureInfo("en-US")); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/shapes-and-images.md b/libraries/radspreadprocessing/features/shapes-and-images.md index 69414747..51e361a9 100644 --- a/libraries/radspreadprocessing/features/shapes-and-images.md +++ b/libraries/radspreadprocessing/features/shapes-and-images.md @@ -90,20 +90,20 @@ To insert an image into a worksheet do the following: In order to create an instance of __FloatingImage__ you need the worksheet in which you want to insert the image, the cell index and the offset. -#### __[C#] Example 1: Create FloatingImage__ +#### __Example 1: Create FloatingImage__ -{{region cs-radspreadprocessing-features-shapes-and-images_0}} +```csharp Worksheet worksheet = workbook.ActiveWorksheet; Telerik.Windows.Documents.Spreadsheet.Model.Shapes.FloatingImage image = new Telerik.Windows.Documents.Spreadsheet.Model.Shapes.FloatingImage(worksheet, new CellIndex(7, 1), 35, 10); -{{endregion}} +``` The next step is to configure the other properties of the image as needed. -#### __[C#] Example 2: Configure image properties__ +#### __Example 2: Configure image properties__ -{{region cs-radspreadprocessing-features-shapes-and-images_01}} +```csharp Stream stream = File.Open(filePath, FileMode.Open); using (stream) @@ -114,7 +114,7 @@ The next step is to configure the other properties of the image as needed. image.Width = 330; image.Height = 45; image.RotationAngle = 20; -{{endregion}} +``` @@ -123,11 +123,11 @@ Insert the image into the collection of shapes of the worksheet. Note that the >important When using the **.NET Standard** version of the RadSpreadProcessing packages, in order to **export to PDF** format documents containing images different than Jpeg and Jpeg2000 or ImageQuality different than High, the **JpegImageConverter** property inside the **FixedExtensibilityManager** has to be set. For more information check the FixedExtensibilityManager in the [PdfProcessing`s Cross-Platform Support]({%slug radpdfprocessing-cross-platform%}) -#### __[C#] Example 3: Add image to worksheet__ +#### __Example 3: Add image to worksheet__ -{{region cs-radspreadprocessing-features-shapes-and-images_02}} +```csharp worksheet.Images.Add(image); -{{endregion}} +``` @@ -139,11 +139,11 @@ In order to delete a shape from a worksheet, you need the shape's instance. The __Example 4__ demonstrates how you can remove the image added in __Example 3__. -#### __[C#] Example 4: Delete shape__ +#### __Example 4: Delete shape__ -{{region cs-radspreadprocessing-features-shapes-and-images_03}} +```csharp worksheet.Images.Remove(image); -{{endregion}} +``` @@ -155,23 +155,23 @@ After the initial values of the properties of the shapes have been assigned, the * Repositioning the shape - #### __[C#] Example 5: Move image__ + #### __Example 5: Move image__ - {{region cs-radspreadprocessing-features-shapes-and-images_04}} + ```csharp image.CellIndex = new CellIndex(4, 5); image.OffsetX = 10; image.OffsetY = 10; - {{endregion}} + ``` * Changing the shape's width and height - #### __[C#] Example 6: Change width and height__ + #### __Example 6: Change width and height__ - {{region cs-radspreadprocessing-features-shapes-and-images_05}} + ```csharp image.Width -= 50; image.Height += 50; - {{endregion}} + ``` The Width and Height properties do not take the LockAspectRatio property into account. If you would like more control on whether the aspect ratio of the shape should be observed, you can also use the following methods. @@ -182,34 +182,34 @@ After the initial values of the properties of the shapes have been assigned, the * void SetHeight(bool respectLockAspectRatio, double height, bool adjustCellIndex = false) - #### __[C#] Example 7: Set width and whether lock aspect ratio is respected__ + #### __Example 7: Set width and whether lock aspect ratio is respected__ - {{region cs-radspreadprocessing-features-shapes-and-images_08}} + ```csharp image.SetWidth(false, 330); image.SetHeight(true, 45); - {{endregion}} + ``` These two methods will be further explained in the next section. * Rotating the shape - #### __[C#] Example 8: Rotate__ + #### __Example 8: Rotate__ - {{region cs-radspreadprocessing-features-shapes-and-images_06}} + ```csharp image.RotationAngle = 40; - {{endregion}} + ``` The rotation angle of the shape can affect the __CellIndexM__ property and the offset. The relationship between these properties is described in more detail in the next section of this article. * Flipping the shape - #### __[C#] Example 9: Flip__ + #### __Example 9: Flip__ - {{region cs-radspreadprocessing-features-shapes-and-images_07}} + ```csharp image.IsHorizontallyFlipped = true; - {{endregion}} + ``` diff --git a/libraries/radspreadprocessing/features/sorting.md b/libraries/radspreadprocessing/features/sorting.md index baf12331..d003efb8 100644 --- a/libraries/radspreadprocessing/features/sorting.md +++ b/libraries/radspreadprocessing/features/sorting.md @@ -107,11 +107,11 @@ The values sort condition is a condition which uses the values of the cells to s __Example 1__ shows how to create a __ValuesSortCondition__. -#### __[C#] Example 1: Create ValuesSortCondition__ +#### __Example 1: Create ValuesSortCondition__ -{{region cs-radspreadprocessing-features-sorting_0}} +```csharp ValuesSortCondition condition = new ValuesSortCondition(0, SortOrder.Ascending); -{{endregion}} +``` @@ -129,11 +129,11 @@ Sometimes the behavior of the predefined comparers is not sufficient. In this ca __Example 2__ shows how to create a CustomValuesSortCondition. -#### __[C#] Example 2: Create CustomValuesSortCondition__ +#### __Example 2: Create CustomValuesSortCondition__ -{{region cs-radspreadprocessing-features-sorting_1}} +```csharp CustomValuesSortCondition condition = new CustomValuesSortCondition(0, new string[] { "regular", "1 day", "2 days", "express" }, SortOrder.Ascending); -{{endregion}} +``` @@ -148,11 +148,11 @@ A fore color sort condition orders the cells according to the color of the text __Example 3__ demonstrates how to create a __ForeColorSortCondition__. This condition will sort the range by putting all cells with a red fore color on the top. -#### __[C#] Example 3: Create ForeColorSortCondition__ +#### __Example 3: Create ForeColorSortCondition__ -{{region cs-radspreadprocessing-features-sorting_2}} +```csharp ForeColorSortCondition condition = new ForeColorSortCondition(0, new ThemableColor(Colors.Red), SortOrder.Ascending); -{{endregion}} +``` @@ -164,11 +164,11 @@ A fill color sort condition orders the cells according to their fill color. Each __Example 4__ shows how to create a __FillColorSortCondition__. -#### __[C#] Example 4: Create FillColorSortCondition__ +#### __Example 4: Create FillColorSortCondition__ -{{region cs-radspreadprocessing-features-sorting_3}} +```csharp FillColorSortCondition condition = new FillColorSortCondition(0, PatternFill.CreateSolidFill(Color.FromArgb(255, 181, 18, 27)), SortOrder.Ascending); -{{endregion}} +``` @@ -189,37 +189,37 @@ Note that unlike the case with [Filtering]({%slug radspreadprocessing-features-f __Example 5__ shows how to create three sorting conditions. -#### __[C#] Example 5: Create Conditions__ +#### __Example 5: Create Conditions__ -{{region cs-radspreadprocessing-features-sorting_4}} +```csharp Worksheet worksheet = workbook.ActiveWorksheet; CustomValuesSortCondition condition1 = new CustomValuesSortCondition(5, new string[] { "regular", "1 day", "2 days", "express" }, SortOrder.Ascending); FillColorSortCondition condition2 = new FillColorSortCondition(7, PatternFill.CreateSolidFill(Color.FromArgb(255, 181, 18, 27)), SortOrder.Ascending); FillColorSortCondition condition3 = new FillColorSortCondition(7, PatternFill.CreateSolidFill(Color.FromArgb(255, 94, 151, 50)), SortOrder.Ascending); -{{endregion}} +``` Further, __Example 6__ shows how to apply the sorting conditions through the __SortState__ property. -#### __[C#] Example 6: Set conditions through SortState__ +#### __Example 6: Set conditions through SortState__ -{{region cs-radspreadprocessing-features-sorting_5}} +```csharp worksheet.SortState.Set(new CellRange(3, 0, 17, 7), condition1, condition2, condition3); -{{endregion}} +``` Alternatively, __Example 7__ shows how to apply the sorting conditions through the cell selection property. -#### __[C#] Example 7: Set conditions through selection__ +#### __Example 7: Set conditions through selection__ -{{region cs-radspreadprocessing-features-sorting_6}} +```csharp worksheet.Cells[3, 0, 17, 7].Sort(condition1, condition2, condition3); -{{endregion}} +``` @@ -237,11 +237,11 @@ In order to clear the sorting, you can use the __Clear()__ method of the __SortS __Example 8__ shows how to clear the sorting. -#### __[C#] Example 8: Clear sorting__ +#### __Example 8: Clear sorting__ -{{region cs-radspreadprocessing-features-sorting_7}} +```csharp worksheet.SortState.Clear(); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/styling/cell-styles.md b/libraries/radspreadprocessing/features/styling/cell-styles.md index 8ff6bf34..e9f13615 100644 --- a/libraries/radspreadprocessing/features/styling/cell-styles.md +++ b/libraries/radspreadprocessing/features/styling/cell-styles.md @@ -89,13 +89,13 @@ When you apply a style to a cell with locally set properties, the end result is __Example 1__ shows what including the __Number__ group looks like. -#### __[C#] Example 1: Include Number group in CellStyle__ +#### __Example 1: Include Number group in CellStyle__ -{{region cs-radspreadprocessing-features-styling-cell-styles_0}} +```csharp Workbook workbook = new Workbook(); CellStyle tempStyle = workbook.Styles["Bad"]; tempStyle.IncludeNumber = true; -{{endregion}} +``` @@ -110,9 +110,9 @@ Creating a new style is pretty straight-forward. All you have to do is invoke th __Example 2__ creates a new style and applies it to cell *A1*. -#### __[C#] Example 2: Create a style__ +#### __Example 2: Create a style__ -{{region cs-radspreadprocessing-features-styling-cell-styles_1}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); @@ -137,7 +137,7 @@ __Example 2__ creates a new style and applies it to cell *A1*. cellStyle.EndUpdate(); workbook.ActiveWorksheet.Cells[0, 0].SetStyleName("My style"); -{{endregion}} +``` @@ -149,9 +149,9 @@ Modifying a style is even easier than creating one. All you need to do is retrie __Example 3__ obtains the *Bad* style from the styles collection of a workbook and modifies it. -#### __[C#] Example 3: Modify a style__ +#### __Example 3: Modify a style__ -{{region cs-radspreadprocessing-features-styling-cell-styles_2}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); @@ -164,15 +164,15 @@ __Example 3__ obtains the *Bad* style from the styles collection of a workbook a style.ForeColor = new ThemableColor(Colors.Black); style.EndUpdate(); -{{endregion}} +``` ## Copy Existing Cell Style The API enables you to copy the properties of an existing style so you can modify it according to your preferences while keeping the original style untouched. -#### __[C#] Example 4: Copy an existing style and modify its properties__ +#### __Example 4: Copy an existing style and modify its properties__ -{{region cs-radspreadprocessing-features-styling-cell-styles_4}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); @@ -187,15 +187,15 @@ The API enables you to copy the properties of an existing style so you can modif customStyle.Fill = new PatternFill(PatternType.Solid, Colors.LightSkyBlue, Colors.Transparent); customStyle.EndUpdate(); -{{endregion}} +``` ## Remove Cell Style You can also remove a style from the __Styles__ collection. It is as easy as removing an object from a list, you simply invoke the __Remove()__ method, which returns a Boolean value. If such style exist in the collection, the method will return *true*. -#### __[C#] Example 5: Remove a style__ +#### __Example 5: Remove a style__ -{{region cs-radspreadprocessing-features-styling-cell-styles_3}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); @@ -207,7 +207,7 @@ You can also remove a style from the __Styles__ collection. It is as easy as rem { Debug.WriteLine("The style does not exist"); } -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/styling/document-themes.md b/libraries/radspreadprocessing/features/styling/document-themes.md index 1f768660..2b8b26b9 100644 --- a/libraries/radspreadprocessing/features/styling/document-themes.md +++ b/libraries/radspreadprocessing/features/styling/document-themes.md @@ -57,9 +57,9 @@ The twelve color types above are used for creating __ThemableColor__ objects. Th __Example 1__ demonstrates how to create a __ThemeColorScheme__ object. Note that the example passes a name and twelve colors to the constructor. Every color has a comment next to it, so you can see its corresponding __ThemeColorType__. -#### __[C#] Example 1: Create ThemeColorScheme__ +#### __Example 1: Create ThemeColorScheme__ -{{region cs-radspreadprocessing-features-styling-document-themes_0}} +```csharp ThemeColorScheme colorScheme = new ThemeColorScheme( "Mine", Colors.Black, // background 1 @@ -74,7 +74,7 @@ __Example 1__ demonstrates how to create a __ThemeColorScheme__ object. Note tha Colors.Orange, // accent 6 Colors.Purple, // hyperlink Colors.Red); // followedHyperlink -{{endregion}} +``` @@ -102,11 +102,11 @@ In order to create colors that depend on the current document theme, you need to __Example 2__ shows how you can create a ThemableColor. -#### __[C#] Example 2: Create ThemableColor__ +#### __Example 2: Create ThemableColor__ -{{region cs-radspreadprocessing-features-styling-document-themes_1}} +```csharp ThemableColor themableColor = new ThemableColor(ThemeColorType.Accent1); -{{endregion}} +``` @@ -125,14 +125,14 @@ To create a ThemeFontScheme you need to pass a name and two font family names to __Example 3__ illustrates how to create a __ThemeFontScheme__ object. -#### __[C#] Example 3: Create ThemeFontScheme__ +#### __Example 3: Create ThemeFontScheme__ -{{region cs-radspreadprocessing-features-styling-document-themes_2}} +```csharp ThemeFontScheme fontScheme = new ThemeFontScheme( "Mine", "Times New Roman", // latinMajor "Arial"); // latinMinor -{{endregion}} +``` @@ -151,11 +151,11 @@ When you need to create a font that depends on the current document theme, you c __Example 4__ shows how to create a ThemableFontFamily. -#### __[C#] Example 4: Create ThemableFontFamily__ +#### __Example 4: Create ThemableFontFamily__ -{{region cs-radspreadprocessing-features-styling-document-themes_3}} +```csharp ThemableFontFamily themableFont = new ThemableFontFamily(ThemeFontType.Major); -{{endregion}} +``` @@ -167,11 +167,11 @@ Now that when you have a color and a font schemes, you can create a new __Docume __Example 5__ demonstrates how to create a DocumentTheme using the color scheme from __Example 1__ and the font scheme from __Example 3__. -#### __[C#] Example 5: Create DocumentTheme__ +#### __Example 5: Create DocumentTheme__ -{{region cs-radspreadprocessing-features-styling-document-themes_4}} +```csharp DocumentTheme theme = new DocumentTheme("Mine", colorScheme, fontScheme); -{{endregion}} +``` @@ -181,11 +181,11 @@ In the predefined static class __PredefinedThemeSchemes__, you can find a number __Example 6__ shows how you can create a document theme using the predefined color and font schemes. -#### __[C#] Example 6: Create DocumentTheme from predefined schemes__ +#### __Example 6: Create DocumentTheme from predefined schemes__ -{{region cs-radspreadprocessing-features-styling-document-themes_5}} +```csharp DocumentTheme theme = new DocumentTheme("From predefined schemes", PredefinedThemeSchemes.ColorSchemes[0], PredefinedThemeSchemes.FontSchemes[5]); -{{endregion}} +``` @@ -195,13 +195,13 @@ Changing the current document theme is as easy as setting a single property: __Example 7__ changes the theme of a newly created workbook. -#### __[C#] Example 7: Change DocumentTheme__ +#### __Example 7: Change DocumentTheme__ -{{region cs-radspreadprocessing-features-styling-document-themes_6}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); workbook.Theme = theme; -{{endregion}} +``` @@ -210,21 +210,21 @@ __Example 7__ changes the theme of a newly created workbook. In order to get the actual value from __ThemableColor__ or __ThemableFontFamily__ you need to call the __GetActualValue()__ method on the corresponding object. -#### __[C#] Example 8: Get actual color__ +#### __Example 8: Get actual color__ -{{region cs-radspreadprocessing-features-styling-document-themes_7}} +```csharp Color actualColor = themableColor.GetActualValue(theme); // the actual color is the same as Accent1 color of the colorScheme -{{endregion}} +``` -#### __[C#] Example 9: Get actual font__ +#### __Example 9: Get actual font__ -{{region cs-radspreadprocessing-features-styling-document-themes_8}} +```csharp var actualFont = themableFont.GetActualValue(theme); // the actualFont is the same as the Major font of the fontScheme -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/features/worksheetpagesetup.md b/libraries/radspreadprocessing/features/worksheetpagesetup.md index 0874b732..6aff88d0 100644 --- a/libraries/radspreadprocessing/features/worksheetpagesetup.md +++ b/libraries/radspreadprocessing/features/worksheetpagesetup.md @@ -74,9 +74,9 @@ __Figures 1 and 2__ show an example of Worksheet's page setup usage. In the exam In order to fit the print content better, we use the Worksheet's page setup and change the page orientation as well as the scale factor and some additional print settings. __Example 1__ shows the code that needs to be executed. -#### __[C#] Example 1: Use WorksheetPageSetup__ +#### __Example 1: Use WorksheetPageSetup__ -{{region cs-radspreadprocessing-features-worksheetpagesetup_0}} +```csharp WorksheetPageSetup pageSetup = workbook.ActiveWorksheet.WorksheetPageSetup; @@ -84,7 +84,7 @@ In order to fit the print content better, we use the Worksheet's page setup and pageSetup.PageOrientation = PageOrientation.Landscape; pageSetup.ScaleFactor = new Size(0.9, 0.9); pageSetup.CenterHorizontally = true; -{{endregion}} +``` As a result, we managed to fit the data into a single page with size A4 as shown in __Figure 2__. @@ -112,9 +112,9 @@ Through WorksheetPageSetup's __PrintArea__ property you can access the print are The example shown in __Figure 3__ demonstrates how to use Worksheet's print area. In this example, we have a big table with data and we want to print only two specific ranges. To achieve that, the print area is set with these cell ranges in the code snippet from __Example 2__. -#### __[C#] Example 2: Set PrintArea__ +#### __Example 2: Set PrintArea__ -{{region cs-radspreadprocessing-features-worksheetpagesetup_1}} +```csharp PrintArea printArea = workbook.ActiveWorksheet.WorksheetPageSetup.PrintArea; @@ -123,7 +123,7 @@ The example shown in __Figure 3__ demonstrates how to use Worksheet's print area new CellRange(0, 0, 4, 8), new CellRange(1, 1, 25, 3) }); -{{endregion}} +``` @@ -167,9 +167,9 @@ __Figure 4__ shows a preview of large amount of data. In order to separate semantically-correct the print data onto several pages, we are going to place horizontal page breaks at the place where we need the splitting to happen. __Example 3__ shows how this can be achieved. -#### __[C#] Example 3: Insert PageBreaks__ +#### __Example 3: Insert PageBreaks__ -{{region cs-radspreadprocessing-features-worksheetpagesetup_2}} +```csharp PageBreaks pageBreaks = workbook.ActiveWorksheet.WorksheetPageSetup.PageBreaks; @@ -180,7 +180,7 @@ In order to separate semantically-correct the print data onto several pages, we pageBreaks.TryInsertHorizontalPageBreak(17, 0); pageBreaks.TryInsertHorizontalPageBreak(20, 0); pageBreaks.TryInsertHorizontalPageBreak(23, 0); -{{endregion}} +``` @@ -198,14 +198,14 @@ The __PrintTitles__ property of __WorksheetPageSetup__ enables you to set rows a * __RepeatedRows__: Gets or sets a value of type RowRange that represents the range of rows that should be repeated. -#### __[C#] Example 4: Repeat the first two rows and two columns of the worksheet on each page__ +#### __Example 4: Repeat the first two rows and two columns of the worksheet on each page__ -{{region cs-radspreadprocessing-features-worksheetpagesetup_3}} +```csharp WorksheetPageSetup pageSetup = workbook.ActiveWorksheet.WorksheetPageSetup; pageSetup.PrintTitles.RepeatedRows = new RowRange(0, 1); pageSetup.PrintTitles.RepeatedColumns = new ColumnRange(0, 1); -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/formats-and-conversion/csv/csvformatprovider.md b/libraries/radspreadprocessing/formats-and-conversion/csv/csvformatprovider.md index 56bb3eba..238a8f7d 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/csv/csvformatprovider.md +++ b/libraries/radspreadprocessing/formats-and-conversion/csv/csvformatprovider.md @@ -24,9 +24,9 @@ To import and export csv files, you need to use the __CsvFormatProvider__ class __Example 1__ shows how to import a CSV file using a __FileStream__. The code assures that a file with the specified name exists. Further, the sample instantiates a __CsvFormatProvider__ and passes a FileStream to its __Import()__ method. -#### __[C#] Example 1: Import CSV file__ +#### __Example 1: Import CSV file__ -{{region cs-radspreadprocessing-formats-and-conversion-csv-csvformatprovider_0}} +```csharp string fileName = "FileName.csv"; if (!File.Exists(fileName)) { @@ -41,7 +41,7 @@ __Example 1__ shows how to import a CSV file using a __FileStream__. The code as workbook = formatProvider.Import(input, TimeSpan.FromSeconds(10)); } -{{endregion}} +``` @@ -50,9 +50,9 @@ __Example 1__ shows how to import a CSV file using a __FileStream__. The code as __Example 2__ demonstrates how to export an existing Workbook to a CSV file. The snippet creates a new workbook with a single worksheet. Further, it creates a __CsvFormatProvider__ and invokes its __Export()__ method: -#### __[C#] Example 2: Export CSV file__ +#### __Example 2: Export CSV file__ -{{region cs-radspreadprocessing-formats-and-conversion-csv-csvformatprovider_1}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); @@ -64,7 +64,7 @@ __Example 2__ demonstrates how to export an existing Workbook to a CSV file. The formatProvider.Export(workbook, output, TimeSpan.FromSeconds(10)); } -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/formats-and-conversion/csv/settings.md b/libraries/radspreadprocessing/formats-and-conversion/csv/settings.md index 037257aa..4d4499b0 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/csv/settings.md +++ b/libraries/radspreadprocessing/formats-and-conversion/csv/settings.md @@ -36,14 +36,14 @@ __CsvFormatProvider__ exposes a __Settings__ property of type __CsvSettings__. T __Example 1__ shows how to create and specify a particular setting to a CsvFormatProvider. -#### __[C#] Example 1: Use CsvSettings__ +#### __Example 1: Use CsvSettings__ -{{region cs-radspreadprocessing-formats-and-conversion-csv-settings_0}} +```csharp CsvFormatProvider provider = new CsvFormatProvider(); provider.Settings.Delimiter = ';'; provider.Settings.Quote = '^'; provider.Settings.HasHeaderRow = true; provider.Settings.Encoding = new UTF8Encoding(); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/formats-and-conversion/data-table/settings.md b/libraries/radspreadprocessing/formats-and-conversion/data-table/settings.md index 743d2bad..93253a0f 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/data-table/settings.md +++ b/libraries/radspreadprocessing/formats-and-conversion/data-table/settings.md @@ -27,9 +27,9 @@ The __CellImportedEventArgs__ contains information about the current cell: * __worksheet:__ The worksheet where the data is imported. -#### __[C#] Example 1: Using the CellImported event to format the cells__ +#### __Example 1: Using the CellImported event to format the cells__ -{{region cs-radspreadprocessing-formats-and-conversion-data-table-format-provider-settings_0}} +```csharp private void ImportTable() { DataTable table = GetTable(); @@ -51,7 +51,7 @@ The __CellImportedEventArgs__ contains information about the current cell: } } -{{endregion}} +``` # Export Settings @@ -68,9 +68,9 @@ The __ColumnExportingEventArgs__ object contains the current column instance and * __DataColumn:__ Gets the [DataColumn](https://docs.microsoft.com/en-us/dotnet/api/system.data.datacolumn?view=net-6.0) that is being exported. * __ColumnIndex:__ Gets the index of the exported column. -#### __[C#] Example 2: Using the ColumnExporting event to set the AllowDBNull property__ +#### __Example 2: Using the ColumnExporting event to set the AllowDBNull property__ -{{region cs-radspreadprocessing-formats-and-conversion-data-table-format-provider-settings_1}} +```csharp private void ExportTable() { @@ -86,7 +86,7 @@ The __ColumnExportingEventArgs__ object contains the current column instance and } } -{{endregion}} +``` # See Also diff --git a/libraries/radspreadprocessing/formats-and-conversion/data-table/using-data-table-format-provider.md b/libraries/radspreadprocessing/formats-and-conversion/data-table/using-data-table-format-provider.md index 39b414b5..fb944d76 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/data-table/using-data-table-format-provider.md +++ b/libraries/radspreadprocessing/formats-and-conversion/data-table/using-data-table-format-provider.md @@ -18,22 +18,22 @@ To use the DataTableFormatProvider you need to reference the __Telerik.Windows.D Example 1 shows how you can import a DataTable. The sample instantiates a __DataTableFormatProvider__ and passes the table to its __Import__ method. -#### __[C#] Example 1: Import DataTable __ +#### __Example 1: Import DataTable __ -{{region cs-radspreadprocessing-formats-and-conversion-using-data-table-format-provider_0}} +```csharp DataTable table = GetTable(); DataTableFormatProvider provider = new DataTableFormatProvider(); Workbook workbook = provider.Import(table); -{{endregion}} +``` You can import the data from the DataTable to an existing worksheet as well. -#### __[C#] Example 2: Import DataTable to an existing Worksheet __ +#### __Example 2: Import DataTable to an existing Worksheet __ -{{region cs-radspreadprocessing-formats-and-conversion-using-data-table-format-provider_1}} +```csharp DataTable table = GetTable(); DataTableFormatProvider provider = new DataTableFormatProvider(); @@ -43,22 +43,22 @@ You can import the data from the DataTable to an existing worksheet as well. provider.Import(table, worksheet); -{{endregion}} +``` ## Export Example 3 demonstrates how you can export an existing Worksheet to a DataTable. The snippet assumes that you already have a Workbook with some data. -#### __[C#] Example 3: Export Worksheet to a DataTable__ +#### __Example 3: Export Worksheet to a DataTable__ -{{region cs-radspreadprocessing-formats-and-conversion-using-data-table-format-provider_2}} +```csharp Workbook workbook = GetWorkbook(); DataTableFormatProvider provider = new DataTableFormatProvider(); DataTable table = provider.Export(workbook.ActiveWorksheet); -{{endregion}} +``` # See Also diff --git a/libraries/radspreadprocessing/formats-and-conversion/general-information.md b/libraries/radspreadprocessing/formats-and-conversion/general-information.md index d3fa9d9b..8edce61a 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/general-information.md +++ b/libraries/radspreadprocessing/formats-and-conversion/general-information.md @@ -45,7 +45,7 @@ All of the listed providers implement the `IWorkbookFormatProvider` and `IBinary ### IWorkbookFormatProvider interface methods -````C# +```csharp public interface IWorkbookFormatProvider { string Name { get; } @@ -58,11 +58,11 @@ public interface IWorkbookFormatProvider void Export(Workbook workbook, Stream output); Workbook Import(Stream input); } -```` +``` __Example__: Use FormatProver's Import() and Export() methods with `Stream` array -````C# +```csharp var path = "MyWorkbook.xlsx"; Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook; IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); @@ -78,23 +78,23 @@ using (Stream output = new FileStream(path, FileMode.Create)) { formatProvider.Export(workbook, output); } -```` +``` ### IBinaryWorkbookFormatProvider interface methods -````C# +```csharp public interface IBinaryWorkbookFormatProvider : IWorkbookFormatProvider { // Overloading IWorkbookFormatProvider's Import and Export methods to support byte[] byte[] Export(Workbook workbook); Workbook Import(byte[] input); } -```` +``` __Example__: Use FormatProver's Import() and Export() methods with `byte[]` array -````C# +```csharp var path = "MyWorkbook.xlsx"; Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook; IBinaryWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider(); @@ -105,7 +105,7 @@ workbook = formatProvider.Import(fileAsByteArray, TimeSpan.FromSeconds(10)); // Export byte[] workbookAsByteArray = formatProvider.Export(workbook, TimeSpan.FromSeconds(10)); -```` +``` >note For more examples of importing and exporting workbooks check out the [Import/Load and Export/Save RadSpreadProcessing Workbook]({%slug import-export-save-load-workbook%}) knowledge base article. @@ -135,7 +135,7 @@ The document model of RadSpreadProcessing also contains a __WorkbookFormatProvid More information on the Format Providers Manager and the __WorkbookFormatProvidersManager__ class can be found in the dedicated [Format Providers Manager]({%slug radspreadprocessing-formats-and-conversion-format-providers-manager %}) article. -````C# +```csharp public class WorkbookFormatProvidersManager { public static IEnumerable FormatProviders { get; } @@ -154,7 +154,7 @@ public class WorkbookFormatProvidersManager public static void RegisterFormatProvider(IWorkbookFormatProvider provider); public static void UnregisterFormatProvider(IWorkbookFormatProvider provider); } -```` +``` ## See Also diff --git a/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xls/xlsformatprovider.md b/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xls/xlsformatprovider.md index 458f25a3..3bb1384e 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xls/xlsformatprovider.md +++ b/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xls/xlsformatprovider.md @@ -28,9 +28,9 @@ Once you reference the aforementioned packages, you need to create an instance o __Example 1__ shows how to import an XLS file using a FileStream. The code assures that a file with the specified name exists. Further, the sample instantiates an __XlsFormatProvider__ and passes a FileStream to its __Import()__ method. -#### __[C#] Example 1: Import XLS (Excel 97-2003 Workbook) file__ +#### __Example 1: Import XLS (Excel 97-2003 Workbook) file__ -{{region cs-radspreadprocessing-formats-and-conversion-xls-xlsformatprovider_0}} +```csharp string fileName = "SampleFile.xls"; if (!File.Exists(fileName)) @@ -46,7 +46,7 @@ __Example 1__ shows how to import an XLS file using a FileStream. The code assur workbook = formatProvider.Import(input, TimeSpan.FromSeconds(10)); } -{{endregion}} +``` @@ -55,9 +55,9 @@ __Example 1__ shows how to import an XLS file using a FileStream. The code assur __Example 2__ demonstrates how to export an existing Workbook to an XLS file. The snippet creates a new workbook with a single worksheet. Further, the example creates an __XlsFormatProvider__ and invokes its __Export()__ method. Note that the __Export()__ method accepts a parameter of type __Stream__ so you can work with any of its inheritors. -#### __[C#] Example 2: Export spreadsheet document to XLS (Excel 97-2003 Workbook) file__ +#### __Example 2: Export spreadsheet document to XLS (Excel 97-2003 Workbook) file__ -{{region cs-radspreadprocessing-formats-and-conversion-xls-xlsformatprovider_1}} +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook(); workbook.Worksheets.Add(); string fileName = "SampleFile.xls"; @@ -69,12 +69,12 @@ __Example 2__ demonstrates how to export an existing Workbook to an XLS file. Th formatProvider.Export(workbook, output, TimeSpan.FromSeconds(10)); } -{{endregion}} +``` -#### __[C#] Example 3: Export spreadsheet document to a Stream and byte[]__ +#### __Example 3: Export spreadsheet document to a Stream and byte[]__ -{{region cs-radspreadprocessing-formats-and-conversion-xls-xlsformatprovider_2}} +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook(); workbook.Worksheets.Add(); @@ -88,7 +88,7 @@ __Example 2__ demonstrates how to export an existing Workbook to an XLS file. Th bytes = output.ToArray(); } -{{endregion}} +``` *This documentation is neither affiliated with, nor authorized, sponsored, or approved by, Microsoft Corporation. diff --git a/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsm/xlsmformatprovider.md b/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsm/xlsmformatprovider.md index e0ee8211..5ef208bc 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsm/xlsmformatprovider.md +++ b/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsm/xlsmformatprovider.md @@ -32,9 +32,9 @@ Once you reference the aforementioned packages, you need to create an instance o __Example 1__ shows how to import an Xlsm file using a FileStream. The code assures that a file with the specified name exists. Further, the sample instantiates an __XlsmFormatProvider__ and passes a FileStream to its __Import()__ method. -#### __[C#] Example 1: Import Xlsm (Excel Workbook) file__ +#### __Example 1: Import Xlsm (Excel Workbook) file__ -{{region cs-radspreadprocessing-formats-and-conversion-Xlsm-Xlsmformatprovider_0}} +```csharp string fileName = "SampleFile.Xlsm"; if (!File.Exists(fileName)) { @@ -50,7 +50,7 @@ __Example 1__ shows how to import an Xlsm file using a FileStream. The code assu workbook = formatProvider.Import(input, TimeSpan.FromSeconds(10)); } -{{endregion}} +``` ## Export @@ -58,9 +58,9 @@ __Example 2__ demonstrates how to export an existing Workbook to an Xlsm file. T >Exporting worbook created with RadSpreadProcessing will result in a file with empty Macros (VBA Project). -#### __[C#] Example 2: Export spreadsheet document to Xlsm (Excel Workbook) file__ +#### __Example 2: Export spreadsheet document to Xlsm (Excel Workbook) file__ -{{region cs-radspreadprocessing-formats-and-conversion-Xlsm-Xlsmformatprovider_1}} +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook(); workbook.Worksheets.Add(); string fileName = "SampleFile.Xlsm"; @@ -74,12 +74,12 @@ __Example 2__ demonstrates how to export an existing Workbook to an Xlsm file. T } -{{endregion}} +``` -#### __[C#] Example 3: Export spreadsheet document to a Stream and byte[]__ +#### __Example 3: Export spreadsheet document to a Stream and byte[]__ -{{region cs-radspreadprocessing-formats-and-conversion-Xlsm-Xlsmformatprovider_2}} +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook(); workbook.Worksheets.Add(); @@ -93,7 +93,7 @@ __Example 2__ demonstrates how to export an existing Workbook to an Xlsm file. T bytes = output.ToArray(); } -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsx/xlsxformatprovider.md b/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsx/xlsxformatprovider.md index 70e35a71..4c19d7f0 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsx/xlsxformatprovider.md +++ b/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsx/xlsxformatprovider.md @@ -30,9 +30,9 @@ Once you reference the aforementioned packages, you need to create an instance o __Example 1__ shows how to import an xlsx file using a FileStream. The code assures that a file with the specified name exists. Further, the sample instantiates an __XlsxFormatProvider__ and passes a FileStream to its __Import()__ method. -#### __[C#] Example 1: Import XLSX (Excel Workbook) file__ +#### __Example 1: Import XLSX (Excel Workbook) file__ -{{region cs-radspreadprocessing-formats-and-conversion-xlsx-xlsxformatprovider_0}} +```csharp string fileName = "SampleFile.xlsx"; if (!File.Exists(fileName)) @@ -48,7 +48,7 @@ __Example 1__ shows how to import an xlsx file using a FileStream. The code assu workbook = formatProvider.Import(input, TimeSpan.FromSeconds(10)); } -{{endregion}} +``` @@ -57,9 +57,9 @@ __Example 1__ shows how to import an xlsx file using a FileStream. The code assu __Example 2__ demonstrates how to export an existing Workbook to an xlsx file. The snippet creates a new workbook with a single worksheet. Further, the example creates an __XlsxFormatProvider__ and invokes its __Export()__ method. Note that the __Export()__ method accepts a parameter of type __Stream__ so you can work with any of its inheritors. -#### __[C#] Example 2: Export spreadsheet document to XLSX (Excel Workbook) file__ +#### __Example 2: Export spreadsheet document to XLSX (Excel Workbook) file__ -{{region cs-radspreadprocessing-formats-and-conversion-xlsx-xlsxformatprovider_1}} +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook(); workbook.Worksheets.Add(); @@ -72,12 +72,12 @@ __Example 2__ demonstrates how to export an existing Workbook to an xlsx file. T formatProvider.Export(workbook, output, TimeSpan.FromSeconds(10)); } -{{endregion}} +``` -#### __[C#] Example 3: Export spreadsheet document to a Stream and byte[]__ +#### __Example 3: Export spreadsheet document to a Stream and byte[]__ -{{region cs-radspreadprocessing-formats-and-conversion-xlsx-xlsxformatprovider_2}} +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook(); workbook.Worksheets.Add(); @@ -91,7 +91,7 @@ __Example 2__ demonstrates how to export an existing Workbook to an xlsx file. T bytes = output.ToArray(); } -{{endregion}} +``` *This documentation is neither affiliated with, nor authorized, sponsored, or approved by, Microsoft Corporation. diff --git a/libraries/radspreadprocessing/formats-and-conversion/import-export-format-providers-manager.md b/libraries/radspreadprocessing/formats-and-conversion/import-export-format-providers-manager.md index c31c621e..d99d89b3 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/import-export-format-providers-manager.md +++ b/libraries/radspreadprocessing/formats-and-conversion/import-export-format-providers-manager.md @@ -11,7 +11,7 @@ position: 1 __RadSpreadprocessing__ contains a __WorkbookFormatProvidersManager__ class that allows you to specify a set of format providers and import or export files letting the manager choose the appropriate format provider. The class also exposes methods that return all registered providers and supported file extensions. -````C# +```csharp public class WorkbookFormatProvidersManager { public static IEnumerable FormatProviders { get; } @@ -30,7 +30,7 @@ public class WorkbookFormatProvidersManager public static void RegisterFormatProvider(IWorkbookFormatProvider provider); public static void UnregisterFormatProvider(IWorkbookFormatProvider provider); } -```` +``` ## Registering and Unregistering Format Providers @@ -41,43 +41,43 @@ The __WorkbookFormatProvidersManager__ class contains two methods that allow you > Some Format Providers require additional package references. Check the full list of the FormatProviders' additional reference requirements in [Format Providers - Additional package references]({%slug radspreadprocessing-formats-and-conversion-general-information%}#additional-package-references). -#### __[C#] Example 1: Register provider__ +#### __Example 1: Register provider__ -{{region cs-radspreadprocessing-formats-and-conversion-format-providers-manager_0}} +```csharp WorkbookFormatProvidersManager.RegisterFormatProvider(new XlsxFormatProvider()); -{{endregion}} +``` -#### __[VB.NET] Example 1: Register provider__ +#### __Example 1: Register provider__ -{{region vb-radspreadprocessing-formats-and-conversion-format-providers-manager_0}} +```csharp WorkbookFormatProvidersManager.RegisterFormatProvider(New XlsxFormatProvider()) -{{endregion}} +``` You can also unregister format providers using the `UnregisterFormatProvider()` method. __Example 2__ demonstrates how to unregister the [TxtFormatProvider]({%slug radspreadprocessing-formats-and-conversion-txt-txtformatprovider %}). -#### __[C#] Example 2: Unregister provider__ +#### __Example 2: Unregister provider__ -{{region cs-radspreadprocessing-formats-and-conversion-format-providers-manager_1}} +```csharp IWorkbookFormatProvider provider = WorkbookFormatProvidersManager.GetProviderByName("TxtFormatProvider"); if (provider != null) { WorkbookFormatProvidersManager.UnregisterFormatProvider(provider); } -{{endregion}} +``` -#### __[VB.NET] Example 2: Unregister provider__ +#### __Example 2: Unregister provider__ -{{region vb-radspreadprocessing-formats-and-conversion-format-providers-manager_1}} +```csharp Dim provider As IWorkbookFormatProvider = WorkbookFormatProvidersManager.GetProviderByName("TxtFormatProvider") If provider IsNot Nothing Then WorkbookFormatProvidersManager.UnregisterFormatProvider(provider) End If -{{endregion}} +``` ## Import @@ -90,9 +90,9 @@ The method tries to find a registered format provider that can handle the extens __Example 3__ demonstrates how to present the user with an `OpenFileDialog` and try to import the selected file. Note that you can use the __GetOpenFileDialogFilter()__ method of the __FileDialogHelper__ class to constructs the correct filter for all registered format providers. -#### __[C#] Example 3: Import a file using OpenFileDialog__ +#### __Example 3: Import a file using OpenFileDialog__ -{{region cs-radspreadprocessing-formats-and-conversion-format-providers-manager_2}} +```csharp OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog(); openFileDialog.Filter = Telerik.Windows.Controls.Spreadsheet.Utilities.FileDialogsHelper.GetOpenFileDialogFilter(); if (openFileDialog.ShowDialog() == true) @@ -110,12 +110,12 @@ __Example 3__ demonstrates how to present the user with an `OpenFileDialog` and throw new IOException("The file cannot be opened. It might be locked by another application.", ex); } } -{{endregion}} +``` -#### __[VB.NET] Example 3: Import a file using OpenFileDialog__ +#### __Example 3: Import a file using OpenFileDialog__ -{{region vb-radspreadprocessing-formats-and-conversion-format-providers-manager_2}} +```csharp Dim openFileDialog As New Microsoft.Win32.OpenFileDialog() openFileDialog.Filter = FileDialogsHelper.GetOpenFileDialogFilter() If openFileDialog.ShowDialog() = True Then @@ -128,7 +128,7 @@ __Example 3__ demonstrates how to present the user with an `OpenFileDialog` and Throw New IOException("The file cannot be opened. It might be locked by another application.", ex) End Try End If -{{endregion}} +``` > The OpenFileDialog class exposes a different API in Silverlight. The name of the file could be obtained through the File.Name property of `OpenFileDialog` and the stream you can get using `File.OpenRead()`. @@ -150,9 +150,9 @@ The method attempts to find a provider that can handle a file of the specified e __Example 4__ illustrates how to use the __Export()__ method to save a file. The sample code presents the user with the SaveFileDialog. Note that here again you can use the __GetOpenFileDialogFilter()__ method of the __FileDialogHelper__ class to construct the correct filter for all registered format providers. -#### __[C#] Example 4: Save a file using SaveFileDialog__ +#### __Example 4: Save a file using SaveFileDialog__ -{{region cs-radspreadprocessing-formats-and-conversion-format-providers-manager_3}} +```csharp Microsoft.Win32.SaveFileDialog saveFileDialog = new Microsoft.Win32.SaveFileDialog(); saveFileDialog.Filter = Telerik.Windows.Controls.Spreadsheet.Utilities.FileDialogsHelper.GetSaveFileDialogFilter(); @@ -164,12 +164,12 @@ __Example 4__ illustrates how to use the __Export()__ method to save a file. The WorkbookFormatProvidersManager.Export(workbook, extension, output); } } -{{endregion}} +``` -#### __[VB.NET] Example 4: Save a file using SaveFileDialog__ +#### __Example 4: Save a file using SaveFileDialog__ -{{region vb-radspreadprocessing-formats-and-conversion-format-providers-manager_3}} +```csharp Dim saveFileDialog As New Microsoft.Win32.SaveFileDialog() saveFileDialog.Filter = FileDialogsHelper.GetSaveFileDialogFilter() @@ -179,7 +179,7 @@ __Example 4__ illustrates how to use the __Export()__ method to save a file. The WorkbookFormatProvidersManager.Export(workbook, extension, output) End Using End If -{{endregion}} +``` You can achieve the same result through using the __SaveFile__ command. In fact, the command executes exactly the same code as above. That said, make sure you register the format providers you would like to use before using the command. diff --git a/libraries/radspreadprocessing/formats-and-conversion/pdf/format-and-conversion-settings.md b/libraries/radspreadprocessing/formats-and-conversion/pdf/format-and-conversion-settings.md index 14a1f79d..2f6fbe40 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/pdf/format-and-conversion-settings.md +++ b/libraries/radspreadprocessing/formats-and-conversion/pdf/format-and-conversion-settings.md @@ -36,21 +36,21 @@ __PdfExportSettings__ allow controlling how a __Workbook__ is exported to PDF. U __Example 1__ shows how to export the Entire Workbook without ignoring the __PrintArea__ property in all worksheets. -#### __[C#] Example 1: Export entire workbook__ +#### __Example 1: Export entire workbook__ -{{region cs-radspreadprocessing-formats-and-conversion-pdf-settings_0}} +```csharp PdfFormatProvider provider = new PdfFormatProvider(); provider.ExportSettings = new PdfExportSettings(ExportWhat.EntireWorkbook, false); -{{endregion}} +``` __Example 2__ shows how to export only two selected ranges from the active worksheet, ignoring print areas and page breaks. -#### __[C#] Example 2: Export selection__ +#### __Example 2: Export selection__ -{{region cs-radspreadprocessing-formats-and-conversion-pdf-settings_1}} +```csharp CellRange[] rangesToExport = new CellRange[] { new CellRange(2, 3, 10, 15), @@ -59,7 +59,7 @@ __Example 2__ shows how to export only two selected ranges from the active works PdfFormatProvider provider = new PdfFormatProvider(); provider.ExportSettings = new PdfExportSettings(rangesToExport); -{{endregion}} +``` >In order to specify file export settings to the __PdfFormatProvider__ you need to add both the Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export and Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export namespaces. In Example 3 the *Fixed* alias corresponds to the __Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export__ namespace. @@ -68,16 +68,16 @@ __Example 2__ shows how to export only two selected ranges from the active works Another export option is to specify settings specific to the PDF format to the exported document. __Example 3__ demonstrates how to utilize the __PdfFileSettings__ property in order to export a PDF/A-compliant document. -#### __[C#] Example 3: Export PDF/A compliant document__ +#### __Example 3: Export PDF/A compliant document__ -{{region cs-radspreadprocessing-formats-and-conversion-pdf-settings_2}} +```csharp PdfFormatProvider provider = new PdfFormatProvider(); Fixed.PdfExportSettings fileSettings = new Fixed.PdfExportSettings(); fileSettings.ComplianceLevel = Fixed.PdfComplianceLevel.PdfA2B; provider.ExportSettings.PdfFileSettings = fileSettings; -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/formats-and-conversion/pdf/pdfformatprovider.md b/libraries/radspreadprocessing/formats-and-conversion/pdf/pdfformatprovider.md index 1de8c3f3..e97956c0 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/pdf/pdfformatprovider.md +++ b/libraries/radspreadprocessing/formats-and-conversion/pdf/pdfformatprovider.md @@ -42,9 +42,9 @@ In order to use __PdfFormatProvider__ you need to add references to the packages __Example 1__ shows how to use __PdfFormatProvider__ to export a Workbook to a file. -#### __[C#] Example 1: PdfFormatProvider export example__ +#### __Example 1: PdfFormatProvider export example__ -{{region cs-radspreadprocessing-formats-and-conversion-pdf-pdfformatprovider_0}} +```csharp Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider pdfFormatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider(); using (Stream output = File.OpenWrite("Sample.pdf")) @@ -54,12 +54,12 @@ __Example 1__ shows how to use __PdfFormatProvider__ to export a Workbook to a f pdfFormatProvider.Export(workbook, output, TimeSpan.FromSeconds(10)); } -{{endregion}} +``` The result from the export method is a document that can be opened in any application that supports PDF documents. -#### __[C#] Example 2: Export to RadFixedDocument__ -{{region cs-radspreadprocessing-formats-and-conversion-pdf-pdfformatprovider_1}} +#### __Example 2: Export to RadFixedDocument__ +```csharp Workbook workbook = CreateSampleWorkbook(); @@ -67,7 +67,7 @@ The result from the export method is a document that can be opened in any applic RadFixedDocument fixedDocument = provider.ExportToFixedDocument(workbook, TimeSpan.FromSeconds(10)); -{{endregion}} +``` >tip __RadFixedDocument__ is the base class of the __RadPdfProcessing__ library. Additional information on the library and its functionality can be found [here]({%slug radpdfprocessing-overview%}). diff --git a/libraries/radspreadprocessing/formats-and-conversion/txt/settings.md b/libraries/radspreadprocessing/formats-and-conversion/txt/settings.md index 56192462..c840333d 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/txt/settings.md +++ b/libraries/radspreadprocessing/formats-and-conversion/txt/settings.md @@ -37,13 +37,13 @@ __TxtFormatProvider__ exposes a __Settings__ property of type __TxtSettings__. T __Example 1__ shows how to create and specify a particular setting to a TxtFormatProvider. -#### __[C#] Example 1: Use TxtSettings__ +#### __Example 1: Use TxtSettings__ -{{region cs-radspreadprocessing-formats-and-conversion-txt-settings_0}} +```csharp TxtFormatProvider provider = new TxtFormatProvider(); provider.Settings.Delimiter = ';'; provider.Settings.Quote = '^'; provider.Settings.HasHeaderRow = true; -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/formats-and-conversion/txt/txtformatprovider.md b/libraries/radspreadprocessing/formats-and-conversion/txt/txtformatprovider.md index 4f112ae0..99444c8f 100644 --- a/libraries/radspreadprocessing/formats-and-conversion/txt/txtformatprovider.md +++ b/libraries/radspreadprocessing/formats-and-conversion/txt/txtformatprovider.md @@ -24,9 +24,9 @@ In order to import and export txt files, you need an instance of __TxtFormatProv __Example 1__ shows how to import a txt file using a FileStream. The sample instantiates a __TxtFormatProvider__ and passes a FileStream to its __Import()__ method: -#### __[C#] Example 1: Import TXT file__ +#### __Example 1: Import TXT file__ -{{region cs-radspreadprocessing-formats-and-conversion-txt-txtformatprovider_0}} +```csharp Workbook workbook; string fileName = "input.txt"; @@ -37,7 +37,7 @@ __Example 1__ shows how to import a txt file using a FileStream. The sample inst workbook = formatProvider.Import(input, TimeSpan.FromSeconds(10)); } -{{endregion}} +``` @@ -46,9 +46,9 @@ __Example 1__ shows how to import a txt file using a FileStream. The sample inst __Example 2__ demonstrates how to export an existing Workbook to a TXT file. The snippet creates a new workbook with a single worksheet. Further, it creates a __TxtFormatProvider__ and invokes its __Export()__ method: -#### __[C#] Example 2: Export TXT file__ +#### __Example 2: Export TXT file__ -{{region cs-radspreadprocessing-formats-and-conversion-txt-txtformatprovider_1}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); @@ -61,7 +61,7 @@ __Example 2__ demonstrates how to export an existing Workbook to a TXT file. The formatProvider.Export(workbook, output, TimeSpan.FromSeconds(10)); } -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/getting-started.md b/libraries/radspreadprocessing/getting-started.md index facb8918..f975e613 100644 --- a/libraries/radspreadprocessing/getting-started.md +++ b/libraries/radspreadprocessing/getting-started.md @@ -110,24 +110,24 @@ The document model allows you to instantiate a new [workbook]({%slug radspreadpr __Example 1__ shows how you can create a workbook and add a new worksheet to it. -#### __[C#] Example 1: Create Workbook__ +#### __Example 1: Create Workbook__ -{{region cs-radspreadprocessing-getting-started_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); -{{endregion}} +``` You can then create a [CellSelection]({%slug radspreadprocessing-working-with-cells-get-set-clear-properties%}) and set any value to the selected cells. __Example 2__ shows how you can create a cell and set a string value to it. -#### __[C#] Example 2: Set value of cell__ +#### __Example 2: Set value of cell__ -{{region cs-radspreadprocessing-getting-started_1}} +```csharp CellSelection selection = worksheet.Cells[1, 1]; //B2 cell selection.SetValue("Hello RadSpreadProcessing"); -{{endregion}} +``` @@ -138,9 +138,9 @@ The __RadSpreadProcessing__ library supports a variety of formats to which you c For more examples and application scenarios of Importing and Exporting a Workbook to various formats check out the [Import/Load and Export/Save RadSpreadProcessing Workbook]({%slug import-export-save-load-workbook%}) knowledge base article. -#### __[C#] Example 3: Export to Xlsx__ +#### __Example 3: Export to Xlsx__ -{{region cs-radspreadprocessing-getting-started_2}} +```csharp string fileName = "SampleFile.xlsx"; XlsxFormatProvider formatProvider = new XlsxFormatProvider(); @@ -149,7 +149,7 @@ For more examples and application scenarios of Importing and Exporting a Workboo { formatProvider.Export(workbook, output); } -{{endregion}} +``` >More information about the import and export functionalities of RadSpreadProcessing is available in the [Formats and Conversion section]({%slug radspreadprocessing-formats-and-conversion-general-information%}). diff --git a/libraries/radspreadprocessing/helpers/name-converter.md b/libraries/radspreadprocessing/helpers/name-converter.md index 76d0847b..cf669051 100644 --- a/libraries/radspreadprocessing/helpers/name-converter.md +++ b/libraries/radspreadprocessing/helpers/name-converter.md @@ -29,65 +29,65 @@ The [NameConverter](https://docs.telerik.com/devtools/document-processing/api/te ### Convert Row Index to Name **ConvertRowIndexToName** method converts the row index to name. -#### __[C#] Example 1:__ +#### __Example 1:__ -{{region radspreadprocessing-name-converter_0}} +```csharp int rowIndex = 0; string rowName = NameConverter.ConvertRowIndexToName(rowIndex); -{{endregion}} +``` ### Convert Row Name to Index **ConvertRowNameToIndex** method converts the row name to index. -#### __[C#] Example 2:__ +#### __Example 2:__ -{{region radspreadprocessing-name-converter_1}} +```csharp string rowName = "1"; int rowIndex = NameConverter.ConvertRowNameToIndex(rowName); -{{endregion}} +``` ### Convert Column Index to Name **ConvertColumnIndexToName** method converts the column index to name. -#### __[C#] Example 3:__ +#### __Example 3:__ -{{region radspreadprocessing-name-converter_2}} +```csharp int columnIndex = 0; string columnName = NameConverter.ConvertColumnIndexToName(columnIndex); -{{endregion}} +``` ### Convert Column Name to Index **ConvertColumnNameToIndex** converts the column name to index. -#### __[C#] Example 4:__ +#### __Example 4:__ -{{region radspreadprocessing-name-converter_3}} +```csharp string columnName = "A"; int columnIndex = NameConverter.ConvertColumnNameToIndex(columnName); -{{endregion}} +``` ### Convert Cell Index to Name **ConvertCellIndexToName** method converts the cell index to name. This method exposes two overloads. -#### __[C#] Example 5: first overload__ +#### __Example 5: first overload__ -{{region radspreadprocessing-name-converter_4}} +```csharp CellIndex cellIndex = new CellIndex(rowIndex: 0, columnIndex: 0); string cellName = NameConverter.ConvertCellIndexToName(cellIndex); -{{endregion}} +``` -#### __[C#] Example 5: second overload__ -{{region radspreadprocessing-name-converter_5}} +#### __Example 5: second overload__ +```csharp string cellName = NameConverter.ConvertCellIndexToName(rowIndex: 0, columnIndex: 0); -{{endregion}} +``` ### Try Convert Names to Cell Reference Range Expression **TryConvertNamesToCellReferenceRangeExpression** method tries to convert the cell ranges names to cell reference ranges. -#### __[C#] Example 6:__ +#### __Example 6:__ -{{region radspreadprocessing-name-converter_6}} +```csharp string cellRangesName = "A1:F11"; Worksheet worksheet = workbook.ActiveWorksheet; @@ -95,38 +95,38 @@ The [NameConverter](https://docs.telerik.com/devtools/document-processing/api/te int columnIndex = 0; CellReferenceRangeExpression expression; bool isConversionToCellReferenceRangeExpressionSuccessful = NameConverter.TryConvertNamesToCellReferenceRangeExpression(cellRangesName, worksheet, rowIndex, columnIndex, out expression); -{{endregion}} +``` ### Convert Cell Reference to Name **ConvertCellReferenceToName** method converts the cell reference to name. -#### __[C#] Example 7:__ +#### __Example 7:__ -{{region radspreadprocessing-name-converter_7}} +```csharp CellReference fromCellReference = cellReferenceRangeExpression.CellReferenceRange.FromCellReference; string fromCellReferenceName = NameConverter.ConvertCellReferenceToName(fromCellReference); CellReference toCellReference = cellReferenceRangeExpression.CellReferenceRange.ToCellReference; string toCellReferenceName = NameConverter.ConvertCellReferenceToName(toCellReference); -{{endregion}} +``` ### Convert Cell Range to Name **ConvertCellRangeToName** method converts the cell range to a name. -#### __[C#] Example 8:__ +#### __Example 8:__ -{{region radspreadprocessing-name-converter_8}} +```csharp CellIndex fromIndex = new CellIndex(rowIndex: 0, columnIndex: 0); CellIndex toIndex = new CellIndex(rowIndex: 10, columnIndex: 5); string cellRangeName = NameConverter.ConvertCellRangeToName(fromIndex, toIndex); -{{endregion}} +``` ### Try Convert Name to Cell Range **TryConvertNameToCellRange** method converts the name to a cell range. -#### __[C#] Example 9:__ +#### __Example 9:__ -{{region radspreadprocessing-name-converter_9}} +```csharp CellIndex fromIndex = new CellIndex(rowIndex: 0, columnIndex: 0); CellIndex toIndex = new CellIndex(rowIndex: 10, columnIndex: 5); @@ -134,31 +134,31 @@ The [NameConverter](https://docs.telerik.com/devtools/document-processing/api/te CellRange cellRange; bool result = NameConverter.TryConvertCellRangeNameToCellRange(cellRangeName, out cellRange); -{{endregion}} +``` ### Convert Cell Indexes to Name **ConvertCellIndexesToName** method converts the cell indexes to a name. -#### __[C#] Example 10:__ +#### __Example 10:__ -{{region radspreadprocessing-name-converter_10}} +```csharp string cellRangeName = NameConverter.ConvertCellIndexesToName(fromRowIndex: 0, fromColumnIndex: 0, toRowIndex: 10, toColumnIndex: 5); -{{endregion}} +``` ### Convert Cell Name to Index **ConvertCellNameToIndex** method converts the cell name to a cell index. This method exposes two overloads. -#### __[C#] Example 11: first overload__ +#### __Example 11: first overload__ -{{region radspreadprocessing-name-converter_11}} +```csharp string cellName = "A1"; int rowIndex; int columnIndex; NameConverter.ConvertCellNameToIndex(cellName, out rowIndex, out columnIndex); -{{endregion}} +``` -#### __[C#] Example 11: second overload__ -{{region radspreadprocessing-name-converter_11}} +#### __Example 11: second overload__ +```csharp string cellName = "A1"; int rowIndex; @@ -166,21 +166,21 @@ The [NameConverter](https://docs.telerik.com/devtools/document-processing/api/te int columnIndex; bool isColumnAbsolute; NameConverter.ConvertCellNameToIndex(cellName, out isRowAbsolute, out rowIndex, out isColumnAbsolute, out columnIndex); -{{endregion}} +``` ### Try Convert Cell Name to Index **TryConvertCellNameToIndex** method tries to convert the cell name to index. This method exposes two overloads. -#### __[C#] Example 12: first overload__ -{{region radspreadprocessing-name-converter_12}} +#### __Example 12: first overload__ +```csharp string cellName = "A1"; int rowIndex; int columnIndex; bool isConversionSuccessful = NameConverter.TryConvertCellNameToIndex(cellName, out rowIndex, out columnIndex); -{{endregion}} +``` -#### __[C#] Example 12: second overload__ -{{region radspreadprocessing-name-converter_12}} +#### __Example 12: second overload__ +```csharp string cellName = "A1"; int rowIndex; @@ -188,18 +188,18 @@ The [NameConverter](https://docs.telerik.com/devtools/document-processing/api/te int columnIndex; bool isColumnAbsolute; bool isConversionSuccessful = NameConverter.TryConvertCellNameToIndex(cellName, out isRowAbsolute, out rowIndex, out isColumnAbsolute, out columnIndex); -{{endregion}} +``` ### Is Valid A1 Cell Name **IsValidA1CellName** method determines whether the name of the cell is valid. -#### __[C#] Example 13:__ +#### __Example 13:__ -{{region radspreadprocessing-name-converter_13}} +```csharp string cellName = "B2"; bool isValidCellName= NameConverter.IsValidA1CellName(cellName); -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/performance.md b/libraries/radspreadprocessing/performance.md index edda7df4..015761c2 100644 --- a/libraries/radspreadprocessing/performance.md +++ b/libraries/radspreadprocessing/performance.md @@ -34,29 +34,29 @@ Calculating the layout is an operation computing the width of each column and th Internally there are many mechanisms used to lower the number of calculations, but sometimes they are not enough. For example, if you want to generate a document and then show it, you do not need to trigger any layout updates other than the one after you finish creating the document. The code snippet in __Example 1__ shows how the layout updates can be suspended and then resumed after document generation is completed. -#### __[C#] Example 1: Suspend layout updates__ +#### __Example 1: Suspend layout updates__ -{{region cs-radspreadprocessing-performance_0}} +```csharp Workbook workbook = new Workbook(); workbook.SuspendLayoutUpdate(); // The code which generates the document workbook.ResumeLayoutUpdate(); -{{endregion}} +``` Note that if an exception is thrown between the two method calls, the resuming of the layout update will not be performed and the UI will stop updating. You could ensure the layout update will be resumed whatever happens using __UpdateScope__. The code snippet in __Example 2__ demonstrates how to use it. -#### __[C#] Example 2: Suspend layout updates in UndoScope__ +#### __Example 2: Suspend layout updates in UndoScope__ -{{region cs-radspreadprocessing-performance_1}} +```csharp Workbook workbook = new Workbook(); using (new UpdateScope(workbook.SuspendLayoutUpdate, workbook.ResumeLayoutUpdate)) { // The code which generates the document } -{{endregion}} +``` @@ -65,29 +65,29 @@ Note that if an exception is thrown between the two method calls, the resuming o Preserving information about the steps in the undo stack is usually not a time consuming operation, but even the lightest operation performed thousands of times may slow down your application. If you do not need to preserve each step in the document generation process as a separate undo step, you can simply combine a series of actions into one undo step. For example, if you want to set background color to the even rows in your table you have to set the fill for each row separately. This way each background setting will be preserved as a separate undo step. To combine them in a single undo step you can use the code in __Example 3__. -#### __[C#] Example 3: Combine steps in undo group__ +#### __Example 3: Combine steps in undo group__ -{{region cs-radspreadprocessing-performance_2}} +```csharp Workbook workbook = new Workbook(); workbook.History.BeginUndoGroup(); // The code which generates the document workbook.History.EndUndoGroup(); -{{endregion}} +``` Note that if an exception is thrown between the two method calls, the ending of the undo group will not be performed, all the following actions will not be added to the history either and the UI will stop updating. You could ensure that whatever happens the undo group will be closed using __UpdateScope__. The code snippet in __Example 4__ demonstrates how to use it. -#### __[C#] Example 4: Combine steps in undo group using UndoScope__ +#### __Example 4: Combine steps in undo group using UndoScope__ -{{region cs-radspreadprocessing-performance_3}} +```csharp Workbook workbook = new Workbook(); using (new UpdateScope(workbook.History.BeginUndoGroup, workbook.History.EndUndoGroup)) { // The code which generates the document } -{{endregion}} +``` @@ -96,29 +96,29 @@ Note that if an exception is thrown between the two method calls, the ending of As you already know from the [Reduce the Number of Undo Steps section](#reduce-the-number-of-undo-steps), preserving the history steps can lower the performance of __RadSpreadProcessing__. If you do not want to preserve History while generating your document, you can simply turn the feature off. It can be easily switched on and off through the __IsEnabled__ Boolean property of the history like shown in __Example 5__. -#### __[C#] Example 5: Disable history__ +#### __Example 5: Disable history__ -{{region cs-radspreadprocessing-performance_4}} +```csharp workbook.History.IsEnabled = false; // The code which generates the document workbook.History.IsEnabled = true; -{{endregion}} +``` If an exception is thrown before enabling the history, it will not be enabled and the subsequent history steps will not be preserved. To ensure that the history will be enabled, you can use the __UpdateScope__ class. __Example 6__ shows how this can be achieved. -#### __[C#] Example 6: Disable and enable history using UndoScope__ +#### __Example 6: Disable and enable history using UndoScope__ -{{region cs-radspreadprocessing-performance_5}} +```csharp using (new UpdateScope( () => { workbook.History.IsEnabled = false; }, () => { workbook.History.IsEnabled = true; })) { // The code which generates the document } -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/working-with-cells/accessing-cells-of-worksheet.md b/libraries/radspreadprocessing/working-with-cells/accessing-cells-of-worksheet.md index 88316d96..942629a7 100644 --- a/libraries/radspreadprocessing/working-with-cells/accessing-cells-of-worksheet.md +++ b/libraries/radspreadprocessing/working-with-cells/accessing-cells-of-worksheet.md @@ -15,31 +15,31 @@ The document model offers multiple ways to create a __CellSelection__ object. Th Using a **CellIndex** object allows you to specify a single cell (identified by a row index and column index) from the sheet and create a CellSelection for this single cell. Then, you can get the [Value]({%slug radspreadprocessing-working-with-cells-cell-value-types%}) of the cell. -#### __[C#] Example 1: Create CellSelection using CellIndex__ +#### __Example 1: Create CellSelection using CellIndex__ -{{region cs-radspreadprocessing-working-with-cells-accessing-cells-of-worksheet_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellIndex cellIndex = new CellIndex(0, 5); CellSelection selection1 = worksheet.Cells[cellIndex]; -{{endregion}} +``` -#### __[C#] Example 2: Create CellSelection using CellRange__ +#### __Example 2: Create CellSelection using CellRange__ -{{region cs-radspreadprocessing-working-with-cells-accessing-cells-of-worksheet_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellRange cellRange = new CellRange(0, 0, 5, 5); CellSelection selection2 = worksheet.Cells[cellRange]; -{{endregion}} +``` -#### __[C#] Example 3: Create CellSelection using multiple CellRange objects__ +#### __Example 3: Create CellSelection using multiple CellRange objects__ -{{region cs-radspreadprocessing-working-with-cells-accessing-cells-of-worksheet_2}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -47,39 +47,39 @@ Using a **CellIndex** object allows you to specify a single cell (identified by ranges.Add(new CellRange(0, 0, 5, 5)); ranges.Add(new CellRange(0, 10, 5, 15)); CellSelection selection3 = worksheet.Cells[ranges]; -{{endregion}} +``` -#### __[C#] Example 4: Create CellSelection using two CellIndex instances that specify a CellRange__ +#### __Example 4: Create CellSelection using two CellIndex instances that specify a CellRange__ -{{region cs-radspreadprocessing-working-with-cells-accessing-cells-of-worksheet_3}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellIndex fromIndex = new CellIndex(0, 0); CellIndex toIndex = new CellIndex(5, 5); CellSelection selection4 = worksheet.Cells[fromIndex, toIndex]; -{{endregion}} +``` -#### __[C#] Example 5: Create CellSelection using two integers that indicate the CellIndex__ +#### __Example 5: Create CellSelection using two integers that indicate the CellIndex__ -{{region cs-radspreadprocessing-working-with-cells-accessing-cells-of-worksheet_4}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellSelection selection5 = worksheet.Cells[0, 5]; -{{endregion}} +``` -#### __[C#] Example 6: Create CellSelection using four integers that specify the CellRange__ +#### __Example 6: Create CellSelection using four integers that specify the CellRange__ -{{region cs-radspreadprocessing-working-with-cells-accessing-cells-of-worksheet_5}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellSelection selection6 = worksheet.Cells[0, 0, 5, 5]; -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/working-with-cells/cell-value-types.md b/libraries/radspreadprocessing/working-with-cells/cell-value-types.md index 7a79158a..e5defeb1 100644 --- a/libraries/radspreadprocessing/working-with-cells/cell-value-types.md +++ b/libraries/radspreadprocessing/working-with-cells/cell-value-types.md @@ -38,14 +38,14 @@ The SetValue() method has multiple overloads that allow you to pass a double, a __Example 1__ sets the Value of cell A1 to "Total". -#### __[C#] Example 1: Set string value__ +#### __Example 1: Set string value__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetValue("Total"); -{{endregion}} +``` @@ -55,15 +55,15 @@ Another option for setting the cell value is to use the Create() method of the C __Example 2__ creates a NumberCellValue with value 3.14 and assigns it to cell A1. -#### __[C#] Example 2: Create NumberCellValue__ +#### __Example 2: Create NumberCellValue__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); ICellValue value = CellValueFactory.Create(3.14); worksheet.Cells[0, 0].SetValue(value); -{{endregion}} +``` @@ -73,12 +73,12 @@ If you now retrieve the Value of cell A1, the GetValue() method will return an i __Example 3__ retrieves the value created in Example 2. -#### __[C#] Example 3: Retrieve cell value__ +#### __Example 3: Retrieve cell value__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_2}} +```csharp RangePropertyValue rangeValue = worksheet.Cells[0, 0].GetValue(); ICellValue value = rangeValue.Value; -{{endregion}} +``` @@ -90,9 +90,9 @@ Note that the GetValue() method does not return an ICellValue directly, but it p * __Value__: If the __IsIndeterminate__ property is set to false, __Value__ holds the ICellValue of the whole CellSelection region. If the __IsIndeterminate__ property is set to true, then the cells in the CellSelection region contain different values and the Value property is set to its default – __EmptyCellValue__. - #### __[C#] Example 4: Retrieve and use IsIndeterminate and Value properties__ + #### __Example 4: Retrieve and use IsIndeterminate and Value properties__ - {{region cs-radspreadprocessing-working-with-cells-cell-value-types_3}} + ```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -108,7 +108,7 @@ Note that the GetValue() method does not return an ICellValue directly, but it p RangePropertyValue twoCellsValue = worksheet.Cells[0, 0, 0, 1].GetStyleName(); //cells at [0, 0, 0, 1] twoCellsValue.IsIndeterminate is True, twoCellsValue.Value is Normal - {{endregion}} + ``` ## Empty Cell Value @@ -122,13 +122,13 @@ If a cell already contains another value, you can set an empty value for it usin __Example 5__ clears the value of cell A1. -#### __[C#] Example 5: Clear value__ +#### __Example 5: Clear value__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_4}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].ClearValue(); -{{endregion}} +``` @@ -140,14 +140,14 @@ As its name suggests, the __BooleanCellValue__ type contains a value of type boo __Example 6__ sets the values of cells A1 and B1 to true and false BooleanCellValues, respectively. -#### __[C#] Example 6: Set boolean value__ +#### __Example 6: Set boolean value__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_5}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetValue(true); worksheet.Cells[0, 1].SetValue(false); -{{endregion}} +``` @@ -157,16 +157,16 @@ Another way to assign cells Boolean values is through using the static __Create( __Example 7__ illustrates how to create a BooleanCellValue using the CellValueFactory class. -#### __[C#] Example 7: Create a BooleanCellValue using CellValueFactory__ +#### __Example 7: Create a BooleanCellValue using CellValueFactory__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_6}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); ICellValue booleanCellValueTrue = CellValueFactory.Create(true); ICellValue booleanCellValueFalse = CellValueFactory.Create(false); worksheet.Cells[0, 0].SetValue(booleanCellValueTrue); worksheet.Cells[0, 1].SetValue(booleanCellValueFalse); -{{endregion}} +``` @@ -181,13 +181,13 @@ The __SetValue()__ method has several overloads that produce a NumberCellValue. __Example 8__ shows how to set the value of cell A1 to 1.23. -#### __[C#] Example 8: Set number cell value__ +#### __Example 8: Set number cell value__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_7}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetValue("1.23"); -{{endregion}} +``` ## Date Values @@ -198,13 +198,13 @@ You can use the SetValue(string) method to assign dates. __Example 9__ sets the value of cell A1 to 6 October 1987 (in culture "en-US"). Once set, the value of A1 is a NumberCellValue with RawValue 32056. Because the document model detects that this is a date string, a date format is automatically applied to the cell, so that the value appears as a date. -#### __[C#] Example 9: Set date as number cell value__ +#### __Example 9: Set date as number cell value__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_8}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetValue("10/06/1987"); -{{endregion}} +``` @@ -213,9 +213,9 @@ Applied format: m/d/yyyy If you later access the value of the cell applied in **Example 9**, you will get its double representation - 32056. To obtain the date that this value represents, you can use the **ConvertDoubleToDateTime()** of the [FormatHelper](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Spreadsheet.Formatting.FormatHelper.html) class to convert the raw number to a date or the **GetValueAsString()** method, which will return the date as a string. Both approaches are demonstrated in **Example 10**. -#### __[C#] Example 10: Get date value__ +#### __Example 10: Get date value__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_17}} +```csharp ICellValue cellValue = worksheet.Cells[0, 0].GetValue().Value; CellValueFormat format = worksheet.Cells[0, 0].GetFormat().Value; @@ -224,7 +224,7 @@ If you later access the value of the cell applied in **Example 9**, you will get double rawValueAsNumber = Convert.ToDouble(cellValue.RawValue); DateTime? resultAsDateTime = FormatHelper.ConvertDoubleToDateTime(rawValueAsNumber).Value.Date; -{{endregion}} +``` ## Formula Cell Value @@ -241,13 +241,13 @@ You can set a FormulaCellValue through the SetValue() method by passing a string __Example 11__ shows how you can create a formula that refers to another cell. -#### __[C#] Example 11: Create formula referring to another cell__ +#### __Example 11: Create formula referring to another cell__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_9}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetValue("=A2"); -{{endregion}} +``` @@ -260,13 +260,13 @@ An expression can also contain a predefined function that performs a given calcu __Example 12__ illustrates the use of the SUM built-in function. -#### __[C#] Example 12: Use built-in function__ +#### __Example 12: Use built-in function__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_10}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetValue("=SUM(A2, 3)"); -{{endregion}} +``` @@ -276,9 +276,9 @@ Another way of setting a FormulaCellValue is passing an __ICellValue__ object to __Example 13__ creates a FormulaCellValue using the CellValueFactory class. -#### __[C#] Example 13: Create FormulaCellValue__ +#### __Example 13: Create FormulaCellValue__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_11}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellIndex cellIndex = new CellIndex(0, 0); @@ -287,7 +287,7 @@ __Example 13__ creates a FormulaCellValue using the CellValueFactory class. CellValueFormat newFormatValue; CellValueFactory.Create("=A2 + B2", worksheet, cellIndex, CellValueFormat.GeneralFormat, out cellValue, out newFormatValue); worksheet.Cells[cellIndex].SetValue(cellValue); -{{endregion}} +``` Using the __SetValue()__ method executes internal checks for the current cell value type using the current format and other conditions. If you are sure that the passed value is a formula, you can use the __SetValueAsFormula(string text)__ method directly which will improve the performance. @@ -296,20 +296,20 @@ Using the __SetValue()__ method executes internal checks for the current cell va __Example 14__ shows how you can use the method. -#### __[C#] Example 14: Create FormulaCellValue through SetValueAsFormula()__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_12}} +#### __Example 14: Create FormulaCellValue through SetValueAsFormula()__ +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellIndex cellIndex = new CellIndex(0, 0); worksheet.Cells[cellIndex].SetValueAsFormula("=B1+B2"); -{{endregion}} +``` Depending on your requirements, you can obtain the formula from the cell represented by its definition or by the evaluated result value. **Example 15** shows both possibilities. -#### __[C#] Example 15: Get the value of a cell containing formula__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_18}} +#### __Example 15: Get the value of a cell containing formula__ +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -320,7 +320,7 @@ Depending on your requirements, you can obtain the formula from the cell represe string valueAsString = cellValue.GetValueAsString(format); // =SUM(A2, 3) string resultValue = cellValue.GetResultValueAsString(format); // 13 -{{endregion}} +``` ## Text Cell Value @@ -333,13 +333,13 @@ You can set a TextCellValue using the __SetValue(string)__ method. Note that bef __Example 16__ sets the value of cell A1 to the string "some test". -#### __[C#] Example 16: Set TextCellValue__ +#### __Example 16: Set TextCellValue__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_13}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetValue("some text"); -{{endregion}} +``` @@ -349,23 +349,23 @@ If you would like to avoid the default parsing of the input string and always pr __Example 17__ enters the string "=1+2" into a cell, however, because of the applied cell value format, the cell is assigned a TextCellValue instead of a FormulaCellValue. -#### __[C#] Example 17: Explicitly apply text value type__ +#### __Example 17: Explicitly apply text value type__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_14}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetFormat(new CellValueFormat("@")); worksheet.Cells[0, 0].SetValue("=1+2"); -{{endregion}} +``` The same result could be achieved using the __Create()__ method of the __CellValueFactory__ class. __Example 18__ enters the string "=1+2" into a cell and applies cell value format. -#### __[C#] Example 18: Create TextCellValue__ +#### __Example 18: Create TextCellValue__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_15}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellIndex cellIndex = new CellIndex(0, 0); @@ -374,7 +374,7 @@ The same result could be achieved using the __Create()__ method of the __CellVal CellValueFormat newFormatValue; CellValueFactory.Create("=1 + 2", worksheet, cellIndex, new CellValueFormat("@"), out cellValue, out newFormatValue); worksheet.Cells[cellIndex].SetValue(cellValue); -{{endregion}} +``` If you are sure that the value is a string and need to create a text cell value, you can use the __SetValueAsText(string text)__ method directly. This would avoid the internal checks and parsing that are usually executed and improve the performance. @@ -382,14 +382,14 @@ If you are sure that the value is a string and need to create a text cell value, __Example 19__ shows how to utilize the __SetValueAsText()__ method. -#### __[C#] Example 19: Create TextCellValue through SetValueAsText__ -{{region cs-radspreadprocessing-working-with-cells-cell-value-types_16}} +#### __Example 19: Create TextCellValue through SetValueAsText__ +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellIndex cellIndex = new CellIndex(0, 0); worksheet.Cells[cellIndex].SetValueAsText("This is most certainly a text."); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/working-with-cells/get-set-clear-properties.md b/libraries/radspreadprocessing/working-with-cells/get-set-clear-properties.md index a6fdcb8b..e5a129fe 100644 --- a/libraries/radspreadprocessing/working-with-cells/get-set-clear-properties.md +++ b/libraries/radspreadprocessing/working-with-cells/get-set-clear-properties.md @@ -34,13 +34,13 @@ In order to access cell properties, you have to create a __CellSelection__ objec __Example 1__ creates a selection for cells in the range A1:F6. -#### __[C#] Example 1: Create CellSelection__ +#### __Example 1: Create CellSelection__ -{{region cs-radspreadprocessing-working-with-cells-get-set-clear-properties_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellSelection selection = worksheet.Cells[0, 0, 5, 5]; -{{endregion}} +``` @@ -101,9 +101,9 @@ As already mentioned, the __CellSelection__ class exposes methods that get, set __Example 2__ illustrates how to use these methods on the region A1:F6. -#### __[C#] Example 2: Use GetIsBold(), SetIsBold() and ClearIsBold() methods__ +#### __Example 2: Use GetIsBold(), SetIsBold() and ClearIsBold() methods__ -{{region cs-radspreadprocessing-working-with-cells-get-set-clear-properties_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellSelection selection = worksheet.Cells[0, 0, 5, 5]; @@ -111,7 +111,7 @@ __Example 2__ illustrates how to use these methods on the region A1:F6. selection.SetIsBold(true); bool isBold = selection.GetIsBold().Value; selection.ClearIsBold(); -{{endregion}} +``` @@ -130,15 +130,15 @@ The __GetValue()__ method retrieves the value of the property and returns an ins __Example 3__ illustrates who to retrieve the value of cell B2. -#### __[C#] Example 3: Retrieve value of cell__ +#### __Example 3: Retrieve value of cell__ -{{region cs-radspreadprocessing-working-with-cells-get-set-clear-properties_7}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellSelection selection = worksheet.Cells[1, 1]; ICellValue cellValue = selection.GetValue().Value; -{{endregion}} +``` @@ -148,9 +148,9 @@ As the document model supports different types of cell values, the __CellSelecti __Example 4__ demonstrates how to set the value of a given selection. -#### __[C#] Example 4: Set value of CellSelection__ +#### __Example 4: Set value of CellSelection__ -{{region cs-radspreadprocessing-working-with-cells-get-set-clear-properties_2}} +```csharp // set DateTime value selection.SetValue(DateTime.Now); @@ -166,7 +166,7 @@ __Example 4__ demonstrates how to set the value of a given selection. // set formula value selection.SetValue("=C1+C10"); -{{endregion}} +``` @@ -178,9 +178,9 @@ The __Borders__ property uses a __CellBorders__ object for getting and setting i __Example 5__ demonstrates how to set the value of the Borders of the regions B2:C4 and E2:F4. -#### __[C#] Example 5: Set value of Borders__ +#### __Example 5: Set value of Borders__ -{{region cs-radspreadprocessing-working-with-cells-get-set-clear-properties_3}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); ThemableColor purple = new ThemableColor(Color.FromArgb(255, 155, 89, 182)); @@ -200,7 +200,7 @@ __Example 5__ demonstrates how to set the value of the Borders of the regions B2 new CellBorder(CellBorderStyle.None, darkBlue)); // Diagonal down border worksheet.Cells[1, 4, 2, 5].SetBorders(darkBlueBorders); -{{endregion}} +``` @@ -221,9 +221,9 @@ As its name suggests, the __PatternFill__ object is used to fill the background __Example 6__ creates two PatternFill objects with a DiagonalStripe and Solid PatternType respectively. -#### __[C#] Example 6: Create and set PatternFill__ +#### __Example 6: Create and set PatternFill__ -{{region cs-radspreadprocessing-working-with-cells-get-set-clear-properties_4}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -232,7 +232,7 @@ __Example 6__ creates two PatternFill objects with a DiagonalStripe and Solid Pa PatternFill solidPatternFill = new PatternFill(PatternType.Solid, Color.FromArgb(255, 46, 204, 113), Colors.Transparent); worksheet.Cells[1, 0, 5, 5].SetFill(solidPatternFill); -{{endregion}} +``` @@ -247,16 +247,16 @@ The __GradientFill__ is used to set the background of a region of cells to a gra __Example 7__ assigns the region A1:F1 a smooth horizontal green gradient. -#### __[C#] Example 7: Create and set GradientFill__ +#### __Example 7: Create and set GradientFill__ -{{region cs-radspreadprocessing-working-with-cells-get-set-clear-properties_5}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Rows[0].SetHeight(new RowHeight(50, true)); GradientFill greenGradientFill = new GradientFill(GradientType.Horizontal, Color.FromArgb(255, 46, 204, 113), Color.FromArgb(255, 0, 134, 56)); worksheet.Cells[0, 0, 0, 5].SetFill(greenGradientFill); -{{endregion}} +``` @@ -271,16 +271,16 @@ The result of __Example 7__ is illustrated in __Figure 3__. In addition to the __GetIndent()__, __SetIndent()__ and __ClearIndent()__ methods, __CellSelection__ offers two more methods that are used to increase and decrease the value of the __Indent__ property. Those methods are __IncreaseIndent()__ and __DecreaseIndent()__ and neither of them takes arguments. __Example 8__ snippet shows how to use the methods. -#### __[C#] Example 8: Increase and decrease indent__ +#### __Example 8: Increase and decrease indent__ -{{region cs-radspreadprocessing-working-with-cells-get-set-clear-properties_6}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); CellSelection selection = worksheet.Cells[0, 0, 5, 5]; selection.IncreaseIndent(); selection.DecreaseIndent(); -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/working-with-cells/insert-remove-cells.md b/libraries/radspreadprocessing/working-with-cells/insert-remove-cells.md index 36e418e7..7413f049 100644 --- a/libraries/radspreadprocessing/working-with-cells/insert-remove-cells.md +++ b/libraries/radspreadprocessing/working-with-cells/insert-remove-cells.md @@ -28,9 +28,9 @@ Whenever cells insertion is performed, all values that appear to the right or be The __CellSelection__ class exposes an __Insert()__ method that takes one argument which indicates the direction of the shift. Also, the class offers a __CanInsertOrRemove()__ method that determines if the insertion is possible. __Example 1__ shows how to insert cells using methods mentioned above. -#### __[C#] Example 1: Insert cells__ +#### __Example 1: Insert cells__ -{{region cs-radspreadprocessing-working-with-cells-insert-remove-cells_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -41,7 +41,7 @@ The __CellSelection__ class exposes an __Insert()__ method that takes one argume { selection.Insert(InsertShiftType.Right); } -{{endregion}} +``` @@ -56,9 +56,9 @@ Whenever you remove cells, all values that appear to the right or below the Cell The __CellSelection__ class exposes a __Remove()__ method that takes one argument which indicates the direction of the shift. The class also offers a __CanInsertOrRemove()__ method that determines if the removal is possible. __Example 2__ shows how to remove cells using methods mentioned above. -#### __[C#] Example 2: Remove cells__ +#### __Example 2: Remove cells__ -{{region cs-radspreadprocessing-working-with-cells-insert-remove-cells_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -69,6 +69,6 @@ The __CellSelection__ class exposes a __Remove()__ method that takes one argumen { selection.Remove(RemoveShiftType.Up); } -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/working-with-cells/iterating-used-cells.md b/libraries/radspreadprocessing/working-with-cells/iterating-used-cells.md index 88e6f84d..2b8cedb5 100644 --- a/libraries/radspreadprocessing/working-with-cells/iterating-used-cells.md +++ b/libraries/radspreadprocessing/working-with-cells/iterating-used-cells.md @@ -19,9 +19,9 @@ This topic shows how you can access only the cells that are used in a worksheet The [Worksheet]({%slug radspreadprocessing-working-with-worksheets-what-is-worksheet%}) class enables you to obtain all the cells that are used. A cell is considered used when it has any property applied to it - not matter whether it will be a value or a foreground. The **UsedCellRange** property of the Worksheet class returns a cell range that starts from cell **A1** and holds all cells containing data or formatting. **Example 1** shows how to obtain this range of cells and iterate it. -#### __[C#] Example 1: Iterate UsedCellRange__ +#### __Example 1: Iterate UsedCellRange__ -{{region radspreadprocessing-working-with-cells-iterating-used-cells_0}} +```csharp CellRange usedCellRange = worksheet.UsedCellRange; for (int rowIndex = usedCellRange.FromIndex.RowIndex; rowIndex <= usedCellRange.ToIndex.RowIndex; rowIndex++) @@ -31,16 +31,16 @@ The [Worksheet]({%slug radspreadprocessing-working-with-worksheets-what-is-works CellSelection cell = worksheet.Cells[rowIndex, columnIndex]; } } -{{endregion}} +``` ## Working With a Filtered Range This section describes how you can obtain only the cells that have particular property applied to them and ignore the others. Often, the property that we are interested in is the value of a cell. With the **GetUsedCellRange()** method of [Worksheet]({%slug radspreadprocessing-working-with-worksheets-what-is-worksheet%}) you can pass an IEnumerable<[IPropertyDefinition](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Spreadsheet.PropertySystem.IPropertyDefinition-1.html)> object to get the used cell range, holding only the cells with specific property definitions. **Example 2** demonstrates how to get the used cell range of cells with value and iterate it to process each value. -#### __[C#] Example 2: Obtain and iterate a filtered UsedCellRange__ +#### __Example 2: Obtain and iterate a filtered UsedCellRange__ -{{region radspreadprocessing-working-with-cells-iterating-used-cells_1}} +```csharp CellRange usedCellRangeWithValues = worksheet.GetUsedCellRange(new IPropertyDefinition[] { CellPropertyDefinitions.ValueProperty }); for (int row = usedCellRangeWithValues.FromIndex.RowIndex; row <= usedCellRangeWithValues.ToIndex.RowIndex; row++) @@ -50,7 +50,7 @@ This section describes how you can obtain only the cells that have particular pr ICellValue value = worksheet.Cells[row, column].GetValue().Value; } } -{{endregion}} +``` >tip For more information on working with the values of the cells, check the [Get, Set and Clear Cell Properties]({%slug radspreadprocessing-working-with-cells-get-set-clear-properties%}) and [Cell Value Types]({%slug radspreadprocessing-working-with-cells-cell-value-types%}) topics. diff --git a/libraries/radspreadprocessing/working-with-rows-and-columns/hidden-rows-columns.md b/libraries/radspreadprocessing/working-with-rows-and-columns/hidden-rows-columns.md index 84f560ce..aa8e4aef 100644 --- a/libraries/radspreadprocessing/working-with-rows-and-columns/hidden-rows-columns.md +++ b/libraries/radspreadprocessing/working-with-rows-and-columns/hidden-rows-columns.md @@ -34,9 +34,9 @@ The __SetHidden()__ method is used to change the hidden state of the rows and co __Example 1__ shows how to retrieve and change the hidden state of several rows using the RowSelection class. The code checks if all the rows in the selection are visible and only then hides them. If the selection contains any hidden rows, the hidden state is cleared which will make all rows visible. -#### __[C#] Example 1: Change row hidden state__ +#### __Example 1: Change row hidden state__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-hiding_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -50,7 +50,7 @@ __Example 1__ shows how to retrieve and change the hidden state of several rows { rowSelection.ClearHidden(); } -{{endregion}} +``` ## Relationship with the Height and Width Properties @@ -59,9 +59,9 @@ When the hidden state property of a RowSelection or a ColumnSelection is set, th __Example 2__ shows how you can set the width of a group of columns and it would not affect the hidden state. -#### __[C#] Example 2: Change column width__ +#### __Example 2: Change column width__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-hiding_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -69,7 +69,7 @@ __Example 2__ shows how you can set the width of a group of columns and it would columnSelection.SetWidth(new ColumnWidth(0, true)); bool hiddenState = columnSelection.GetHidden().Value; -{{endregion}} +``` ## Relationship with the AutoFit Method @@ -77,9 +77,9 @@ Like setting the height or width through the SetHeight() and SetWidth() methods, __Example 3__ demonstrates this by hiding a row, autofitting it and then checking its hidden state. -#### __[C#] Example 3: Auto fit on hidden rows__ +#### __Example 3: Auto fit on hidden rows__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-hiding_2}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -89,7 +89,7 @@ __Example 3__ demonstrates this by hiding a row, autofitting it and then checkin rowSelection.AutoFitHeight(); bool hiddenState = rowSelection.GetHidden().Value; -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/working-with-rows-and-columns/insert-and-remove.md b/libraries/radspreadprocessing/working-with-rows-and-columns/insert-and-remove.md index d88f3f62..24d1733a 100644 --- a/libraries/radspreadprocessing/working-with-rows-and-columns/insert-and-remove.md +++ b/libraries/radspreadprocessing/working-with-rows-and-columns/insert-and-remove.md @@ -30,9 +30,9 @@ In order to insert rows, you need to create a __RowSelection__ instance that ind The __RowSelection__ class exposes __CanInsert()__ and __Insert()__ methods that indicate whether the insert is possible and perform the insert operation respectively. __Example 1__ shows how to insert rows using the two methods. -#### __[C#] Example 1: Insert rows__ +#### __Example 1: Insert rows__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-insert-and-remove_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -44,7 +44,7 @@ The __RowSelection__ class exposes __CanInsert()__ and __Insert()__ methods that RowSelection selection = worksheet.Rows[index, index + itemCount]; selection.Insert(); } -{{endregion}} +``` @@ -56,9 +56,9 @@ In order to remove rows, you need to create a __RowSelection__ instance that spe The __RowSelection__ class exposes a __Remove()__ method that performs the removal of the selected rows. __Example 2__ shows how to remove rows. -#### __[C#] Example 2: Remove rows__ +#### __Example 2: Remove rows__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-insert-and-remove_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -67,7 +67,7 @@ The __RowSelection__ class exposes a __Remove()__ method that performs the remov RowSelection selection = worksheet.Rows[startIndex, endIndex]; selection.Remove(); -{{endregion}} +``` @@ -79,9 +79,9 @@ In order to insert columns, you need to create a __ColumnSelection__ instance th The __ColumnSelection__ class exposes __CanInsert()__ and __Insert()__ methods that indicate whether the insert is possible and perform the insert operation respectively. __Example 3__ shows how to insert columns using the two methods. -#### __[C#] Example 3: Insert columns__ +#### __Example 3: Insert columns__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-insert-and-remove_2}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -93,7 +93,7 @@ The __ColumnSelection__ class exposes __CanInsert()__ and __Insert()__ methods t ColumnSelection selection = worksheet.Columns[index, index + itemCount]; selection.Insert(); } -{{endregion}} +``` @@ -105,9 +105,9 @@ In order to remove columns, you need to create a __ColumnSelection__ instance th The __ColumnSelection__ class exposes a __Remove()__ method that executes the removal of the selected columns. __Example 4__ illustrates how to remove columns. -#### __[C#] Example 4: Remove columns__ +#### __Example 4: Remove columns__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-insert-and-remove_3}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); @@ -116,7 +116,7 @@ The __ColumnSelection__ class exposes a __Remove()__ method that executes the re ColumnSelection selection = worksheet.Columns[startIndex, endIndex]; selection.Remove(); -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/working-with-rows-and-columns/resizing.md b/libraries/radspreadprocessing/working-with-rows-and-columns/resizing.md index 03e699ef..8b7709f3 100644 --- a/libraries/radspreadprocessing/working-with-rows-and-columns/resizing.md +++ b/libraries/radspreadprocessing/working-with-rows-and-columns/resizing.md @@ -49,16 +49,16 @@ The __SetHeight()__ method is used to change the height of rows. It takes a sing __Example 1__ shows how to retrieve and change the height of several rows. -#### __[C#] Example 1: Change row height__ +#### __Example 1: Change row height__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-resizing_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); RowSelection rowSelection = worksheet.Rows[5, 7]; double rowsHeight = rowSelection.GetHeight().Value.Value; rowSelection.SetHeight(new RowHeight(rowsHeight + 50, true)); -{{endregion}} +``` @@ -67,15 +67,15 @@ __Example 1__ shows how to retrieve and change the height of several rows. The autofit feature offers a handy approach for resizing multiple rows so that each of them chooses a height that fits its content. To autofit the height of rows, you need to create a __RowSelection__ instance that contains the rows that need to be resized and invoke the __AutoFitHeight()__ method of the __RowSelection__ object. __Example 2__ shows how to fit the height of rows with indexes 6, 7 and 8. -#### __[C#] Example 2: Fit height of rows__ +#### __Example 2: Fit height of rows__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-resizing_1}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); RowSelection rowSelection = worksheet.Rows[5, 7]; rowSelection.AutoFitHeight(); -{{endregion}} +``` > The expected behavior when calling the **AutoFitHeight** method on a row that contains merged and wrapped cells is to set the default [RowHeight](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.spreadsheet.model.rowheight) value instead of calculating the row height according to its content. In order to measure the cell content you can check the exposed by the [LayoutHelper class](#layouthelper-class) methods. @@ -102,45 +102,45 @@ The __SetWidth()__ method is used to change the width of columns. It takes a sin __Example 3__ shows how to retrieve and change the width of several columns. -#### __[C#] Example 3: Change columns width__ +#### __Example 3: Change columns width__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-resizing_2}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); ColumnSelection columnSelection = worksheet.Columns[5, 7]; double columnWidth = columnSelection.GetWidth().Value.Value; columnSelection.SetWidth(new ColumnWidth(columnWidth + 50, true)); -{{endregion}} +``` ## Auto Fit Columns Width The autofit feature offers a handy approach for resizing multiple columns so that each of them chooses a width that fits its content. To autofit the columns, you need to create a __ColumnSelection__ instance that holds the columns to be resized, and invoke its __AutoFitWidth()__ method. __Example 4__ shows how to fit the column width of columns F to H. -#### __[C#] Example 4: Fit width of columns__ +#### __Example 4: Fit width of columns__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-resizing_3}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); ColumnSelection columnSelection = worksheet.Columns[5, 7]; columnSelection.AutoFitWidth(); -{{endregion}} +``` Another way to auto fit column widths is to use the __ExpandToFitNumberValuesWidth()__ method. It affects cells that contain only number values and have a __ColumnWidth__ with __IsCustom__ property set to true. __Example 5__ demonstrates the alternative way to fit the column width. -#### __[C#] Example 5: Fit with ExpandToFitNumberValuesWidth()__ +#### __Example 5: Fit with ExpandToFitNumberValuesWidth()__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-resizing_4}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); ColumnSelection columnSelection = worksheet.Columns[5, 7]; columnSelection.ExpandToFitNumberValuesWidth(); -{{endregion}} +``` > The unit type used to set the width of the columns and the height of the rows in RadSpreadProcessing is [Device Independent Pixels]({%slug device-independent-pixels%}) (DIPs). You can convert it to points or other units using the [Unit](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Media.Unit.html) class. @@ -152,27 +152,27 @@ Another way to auto fit column widths is to use the __ExpandToFitNumberValuesWid __Example 6__ shows how to convert and set from pixel to MS Excel column width. -#### __[C#] Example 6: Convert from pixel column width to MS Excel column width__ +#### __Example 6: Convert from pixel column width to MS Excel column width__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-resizing_7}} +```csharp double pixelWidthToExcelWidth = UnitHelper.PixelWidthToExcelColumnWidth(workbook, 57); ColumnWidth newColumnWidth = new ColumnWidth(pixelWidthToExcelWidth, isCustom: true); worksheet.Columns[0].SetWidth(newColumnWidth); -{{endregion}} +``` * ExcelColumnWidthToPixelWidth: Converts MS Excel column width to pixels width. __Example 7__ shows how to convert and set from MS Excel to pixel column width. -#### __[C#] Example 7: Convert from MS Excel column width to pixel column width__ +#### __Example 7: Convert from MS Excel column width to pixel column width__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-resizing_8}} +```csharp double excelWidthToPixelWidth = UnitHelper.ExcelColumnWidthToPixelWidth(workbook, 8.11); ColumnWidth newColumnWidth = new ColumnWidth(excelWidthToPixelWidth, isCustom: true); worksheet.Columns[0].SetWidth(newColumnWidth); -{{endregion}} +``` The row height in MS Excel is measured in points so in order to set them you can convert this unit and set the exact number you are passing to the **SetHeight**() method for the height using the UnitHelper class. @@ -183,21 +183,21 @@ The [LayoutHelper](https://docs.telerik.com/devtools/document-processing/api/tel * **CalculateCellContentSize**: Calculates the size of the cell content. -#### __[C#] Example 8: Get the Size of the cell content__ +#### __Example 8: Get the Size of the cell content__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-resizing_9}} +```csharp Size cellContentSize = LayoutHelper.CalculateCellContentSize(worksheet, rowIndex, columnIndex); -{{endregion}} +``` * **CalculateCellLayoutBox**: Creates, arranges and returns the cell layout box. -#### __[C#] Example 9: Get the cell layout box__ +#### __Example 9: Get the cell layout box__ -{{region cs-radspreadprocessing-working-with-rows-and-columns-resizing_10}} +```csharp CellLayoutBox cellLayoutBox = LayoutHelper.CalculateCellLayoutBox(worksheet, rowIndex, columnIndex); -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/working-with-workbooks/create-open-and-save-workbooks.md b/libraries/radspreadprocessing/working-with-workbooks/create-open-and-save-workbooks.md index e14fb1c6..52f5b1c5 100644 --- a/libraries/radspreadprocessing/working-with-workbooks/create-open-and-save-workbooks.md +++ b/libraries/radspreadprocessing/working-with-workbooks/create-open-and-save-workbooks.md @@ -27,12 +27,12 @@ The fact that __RadSpreadProcessing__ is completely decoupled from UI enables nu __Example 1__ creates a new workbook and adds its first worksheet, which also becomes the __ActiveWorksheet__ of the workbook. -#### __[C#] Example 1: Create a workbook and add a worksheet to it__ +#### __Example 1: Create a workbook and add a worksheet to it__ -{{region cs-radspreadprocessing-working-with-workbooks-create-open-and-save-workbooks_0}} +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook(); Telerik.Windows.Documents.Spreadsheet.Model.Worksheet worksheet = workbook.Worksheets.Add(); -{{endregion}} +``` @@ -45,9 +45,9 @@ To import a workbook, you need to instantiate a specific [FormatProvider]({%slug __Example 2__ uses a WebClient to download a `xlsx` file stored on a server. Further, the code creates a [XlsxFormatProvider]({%slug radspreadprocessing-formats-and-conversion-xlsx-xlsxformatprovider%}) object and invokes its `public Workbook Import(Stream stream)` method. -#### __[C#] Example 2: Download and import xlsx file__ +#### __Example 2: Download and import xlsx file__ -{{region cs-radspreadprocessing-working-with-workbooks-create-open-and-save-workbooks_1}} +```csharp const string FilePath = @"http://localhost:54352/Resourses/SampleFile.xlsx"; WebClient webClient = new WebClient(); @@ -58,7 +58,7 @@ __Example 2__ uses a WebClient to download a `xlsx` file stored on a server. Fur }; webClient.OpenReadAsync(new Uri(FilePath)); -{{endregion}} +``` @@ -75,9 +75,9 @@ To export a workbook, you need to instantiate the [FormatProvider]({%slug radspr __Example 3__ demonstrates how to export an existing Workbook to a `XLSX` file. The snippet creates a new workbook with a single worksheet. Further, it creates a [XlsxFormatProvider]({%slug radspreadprocessing-formats-and-conversion-xlsx-xlsxformatprovider%}) object and invokes its `public void Export(Workbook workbook, Stream output)`. Saving to the other formats is done in the same way, using a different format provider class. -#### __[C#] Example 3: Save XLSX file__ +#### __Example 3: Save XLSX file__ -{{region cs-radspreadprocessing-working-with-workbooks-create-open-and-save-workbooks_3}} +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook(); workbook.Worksheets.Add(); @@ -88,7 +88,7 @@ __Example 3__ demonstrates how to export an existing Workbook to a `XLSX` file. { formatProvider.Export(workbook, output); } -{{endregion}} +``` For security purposes accessing files in *Silverlight* can be achieved only through user-initiated dialogs. That said, to save workbook's contents into a `csv` file, you need to use the `SaveFileDialog`. @@ -96,9 +96,9 @@ For security purposes accessing files in *Silverlight* can be achieved only thro __Example 4__ passes the stream returned by the dialog and the current workbook to the __Export()__ method of the [CsvFormatProvider]({%slug radspreadprocessing-formats-and-conversion-csv-csvformatprovider %}). -#### __[C#] Example 4: Save csv file using SaveFileDialog__ +#### __Example 4: Save csv file using SaveFileDialog__ -{{region cs-radspreadprocessing-working-with-workbooks-create-open-and-save-workbooks_2}} +```csharp Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook = new Telerik.Windows.Documents.Spreadsheet.Model.Workbook(); workbook.Worksheets.Add(); @@ -113,7 +113,7 @@ __Example 4__ passes the stream returned by the dialog and the current workbook formatProvider.Export(workbook, output); } } -{{endregion}} +``` >note Additional examples about export are available in the [Import/Load and Export/Save RadSpreadProcessing Workbook]({%slug import-export-save-load-workbook%}) knowledge base article. diff --git a/libraries/radspreadprocessing/working-with-worksheets/activate-worksheet.md b/libraries/radspreadprocessing/working-with-worksheets/activate-worksheet.md index f3eb5c91..86671f92 100644 --- a/libraries/radspreadprocessing/working-with-worksheets/activate-worksheet.md +++ b/libraries/radspreadprocessing/working-with-worksheets/activate-worksheet.md @@ -22,9 +22,9 @@ The workbook offers API that lets you change the __ActiveWorksheet__ effortlessl __Example 1__ creates a new workbook from scratch and subscribes to its __ActiveSheetChanged__ event. Further, the code adds two worksheets. Note that when the first worksheet is added it is automatically selected as the active worksheet, because it is the only worksheet in the workbook. That said, adding the first worksheet also triggers the __ActiveSheetChanged__ event. When the second worksheet is added, however, the active worksheet is not changed and, thus, the event is not thrown. Later, the snippet sets the second worksheet to be the active one, which triggers the __ActiveSheetChanged__ event. -#### __[C#] Example 1: Change active sheet__ +#### __Example 1: Change active sheet__ -{{region cs-radspreadprocessing-working-with-worksheets-activate-worksheet_0}} +```csharp public void ActivateWorksheetDemo() { Workbook workbook = new Workbook(); @@ -41,6 +41,6 @@ __Example 1__ creates a new workbook from scratch and subscribes to its __Active { // the active worksheet is changed } -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/working-with-worksheets/add-remove-worksheets.md b/libraries/radspreadprocessing/working-with-worksheets/add-remove-worksheets.md index 6dc38895..1295613b 100644 --- a/libraries/radspreadprocessing/working-with-worksheets/add-remove-worksheets.md +++ b/libraries/radspreadprocessing/working-with-worksheets/add-remove-worksheets.md @@ -21,12 +21,12 @@ Adding a new worksheet to a workbook can be easily achieved through its __Worksh __Example 1__ creates a workbook from scratch and adds a single worksheet to it. Since this is the first worksheet in the workbook, it is also set as the active worksheet. All worksheets added after it will not become active. -#### __[C#] Example 1: Create a workbook and add a worksheet to it__ +#### __Example 1: Create a workbook and add a worksheet to it__ -{{region cs-radspreadprocessing-working-with-worksheets-add-remove-worksheets_0}} +```csharp Workbook workbook = new Workbook(); Worksheet newWorksheet = workbook.Worksheets.Add(); -{{endregion}} +``` @@ -38,9 +38,9 @@ The __Worksheets__ collection of the workbook offers two methods for removing wo __Example 2__ creates a workbook and adds four worksheets. All worksheets are with their default names: Sheet1, Sheet2, Sheet3 and Sheet4. The code further demonstrates how to remove three worksheets using all of the aforementioned remove methods. -#### __[C#] Example 2: Add and remove worksheets__ +#### __Example 2: Add and remove worksheets__ -{{region cs-radspreadprocessing-working-with-worksheets-add-remove-worksheets_1}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); // Sheet1 Worksheet secondWorksheet = workbook.Worksheets.Add(); // Sheet2 @@ -51,16 +51,16 @@ __Example 2__ creates a workbook and adds four worksheets. All worksheets are wi workbook.Worksheets.Remove("Sheet1"); // Removed Sheet1 workbook.Worksheets.Remove(secondWorksheet); // Removed Sheet2 // the only worksheet left is Sheet3 -{{endregion}} +``` ## Reorder Worksheets If you would like to change the order the worksheets appear inside the workbook, you can use the **Move()** method of the **Sheets** collection. The method allows you to move one or more consecutive sheets to a specified position. In **Example 3**, you can see how you can insert 4 sheets and move the last one to the first position in the collection. When the workbook is visualized, the fourth sheet will be the first one visible in the sheet tabs. -#### __[C#] Example 3: Add and reorder worksheets__ +#### __Example 3: Add and reorder worksheets__ -{{region cs-radspreadprocessing-working-with-worksheets-add-remove-worksheets_2}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); // Sheet1 workbook.Worksheets.Add(); // Sheet2 @@ -69,4 +69,4 @@ If you would like to change the order the worksheets appear inside the workbook, workbook.Sheets.Move(3, 1, 0); // Move the fourth sheet to the first place -{{endregion}} \ No newline at end of file +``` \ No newline at end of file diff --git a/libraries/radspreadprocessing/working-with-worksheets/copy-worksheet.md b/libraries/radspreadprocessing/working-with-worksheets/copy-worksheet.md index 7f9ff360..dfd94b11 100644 --- a/libraries/radspreadprocessing/working-with-worksheets/copy-worksheet.md +++ b/libraries/radspreadprocessing/working-with-worksheets/copy-worksheet.md @@ -20,19 +20,19 @@ The __CopyFrom(Worksheet source)__ method of a Worksheet will copy the passed _s __Example 1__ illustrates how to copy a specific worksheet from a source Workbook into a new sheet in the desired target workbook. -#### __[C#] Example 1: Copy worksheet__ -{{region cs-radspreadprocessing-working-with-worksheets-copy-worksheet_0}} +#### __Example 1: Copy worksheet__ +```csharp Worksheet clonedSheet = target.Worksheets.Add(); clonedSheet.CopyFrom(source.Sheets[0] as Worksheet); -{{endregion}} +``` -#### __[VB.NET] Example 1: Copy worksheet__ +#### __Example 1: Copy worksheet__ -{{region vb-radspreadprocessing-working-with-worksheets-copy-worksheet_2}} +```csharp Dim clonedSheet As Worksheet = target.Worksheets.Add() clonedSheet.CopyFrom(TryCast(source.Sheets(0), Worksheet)) -{{endregion}} +``` >If the sheet that you're copying is in a document where a [DocumentTheme]({%slug radspreadprocessing-features-styling-document-themes%}) has been applied, the theme will not be copied. Themes are information preserved in the __Workbook__ and you may need to transfer them additionally. @@ -43,8 +43,8 @@ Copying a worksheet can be done both in a newly created worksheet and an existin __Example 2__ demonstrates a slightly more complex scenario in which a sheet is copied into an existing workbook. If the workbook contains a worksheet with the same name, the sheet to clone is copied into it. Otherwise, a new worksheet is created and its Name is copied from the source document. -#### __[C#] Example 2: Copy to existing workbook__ -{{region cs-radspreadprocessing-working-with-worksheets-copy-worksheet_1}} +#### __Example 2: Copy to existing workbook__ +```csharp bool containsSameName = false; foreach (var worksheet in targetWorkbook.Worksheets) @@ -66,12 +66,12 @@ __Example 2__ demonstrates a slightly more complex scenario in which a sheet is clonedSheet.CopyFrom(sheetToClone); clonedSheet.Name = sheetToClone.Name; } -{{endregion}} +``` -#### __[VB.NET] Example 2: Copy to existing workbook__ +#### __Example 2: Copy to existing workbook__ -{{region vb-radspreadprocessing-working-with-worksheets-copy-worksheet_3}} +```csharp Dim containsSameName As Boolean = False For Each worksheet As var In targetWorkbook.Worksheets @@ -88,7 +88,7 @@ __Example 2__ demonstrates a slightly more complex scenario in which a sheet is clonedSheet.CopyFrom(sheetToClone) clonedSheet.Name = sheetToClone.Name End If -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/working-with-worksheets/iterate-through-worksheets.md b/libraries/radspreadprocessing/working-with-worksheets/iterate-through-worksheets.md index 04093fcc..ff4f0c48 100644 --- a/libraries/radspreadprocessing/working-with-worksheets/iterate-through-worksheets.md +++ b/libraries/radspreadprocessing/working-with-worksheets/iterate-through-worksheets.md @@ -15,9 +15,9 @@ In a number of scenarios you may need to iterate through all worksheets in a giv __Example 1__ illustrates how to retrieve worksheets that have already been added to the workbook. -#### __[C#] Example 1: Retrieve worksheet__ +#### __Example 1: Retrieve worksheet__ -{{region cs-radspreadprocessing-working-with-worksheets-iterate-through-worksheets_0}} +```csharp Workbook workbook = new Workbook(); WorksheetCollection worksheets = workbook.Worksheets; @@ -26,13 +26,13 @@ __Example 1__ illustrates how to retrieve worksheets that have already been adde Worksheet firstWorksheet = worksheets[0]; Worksheet secondWorksheet = worksheets["Sheet2"]; -{{endregion}} +``` __Example 2__ creates a new workbook with three worksheets. The code further iterates through all worksheets and sets the value of cell *A1* to the name of the corresponding worksheet. The example also sets the ForeColor and BackgrounFill of the cell. -#### __[C#] Example 2: Iterate worksheets__ +#### __Example 2: Iterate worksheets__ -{{region cs-radspreadprocessing-working-with-worksheets-iterate-through-worksheets_1}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); @@ -50,7 +50,7 @@ __Example 2__ creates a new workbook with three worksheets. The code further ite cell.SetForeColor(foregroundColor); cell.SetFill(backgroundFill); } -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/working-with-worksheets/rename-worksheet.md b/libraries/radspreadprocessing/working-with-worksheets/rename-worksheet.md index 1ca54df6..048e96dc 100644 --- a/libraries/radspreadprocessing/working-with-worksheets/rename-worksheet.md +++ b/libraries/radspreadprocessing/working-with-worksheets/rename-worksheet.md @@ -48,21 +48,21 @@ The name of the worksheet cannot exceed 31 characters. __Example 1__ creates a new workbook, adds a single worksheet to it and renames the newly added worksheet. -#### __[C#] Example 1: Create and rename a worksheet__ +#### __Example 1: Create and rename a worksheet__ -{{region cs-radspreadprocessing-working-with-worksheets-rename-worksheet_0}} +```csharp Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Name = "Sam's Worksheet"; -{{endregion}} +``` __Example 2__ creates a new workbook and adds two worksheets to it. The snippet illustrates how to rename the worksheet with index 0 to "July's Worksheet". To ensure name uniqueness the sample code checks if the workbook already contains a worksheet with the name we would like to set. -#### __[C#] Example 2: Rename a worksheet__ +#### __Example 2: Rename a worksheet__ -{{region cs-radspreadprocessing-working-with-worksheets-rename-worksheet_1}} +```csharp Workbook workbook = new Workbook(); workbook.Worksheets.Add(); workbook.Worksheets.Add(); @@ -80,6 +80,6 @@ __Example 2__ creates a new workbook and adds two worksheets to it. The snippet { // There already exists worksheet with this name } -{{endregion}} +``` diff --git a/libraries/radspreadprocessing/working-with-worksheets/sheets-visiblility.md b/libraries/radspreadprocessing/working-with-worksheets/sheets-visiblility.md index 3c54a086..80c7ef58 100644 --- a/libraries/radspreadprocessing/working-with-worksheets/sheets-visiblility.md +++ b/libraries/radspreadprocessing/working-with-worksheets/sheets-visiblility.md @@ -30,9 +30,9 @@ There are two available options when hiding sheets. The first option is by setti > The VeryHidden can be set only from the provided API, while the Hidden state is designed for UI purposes. -#### **[C#] Example 1: Setting the SheetVisibility to Hidden/VeryHidden** +#### **Example 1: Setting the SheetVisibility to Hidden/VeryHidden** -{{region cs-radspreadprocessing-working-with-worksheets-sheets-visibility_0}} +```csharp // Change the visibility of the active sheet workbook.ActiveSheet.Visibility = SheetVisibility.Hidden; @@ -42,21 +42,21 @@ There are two available options when hiding sheets. The first option is by setti // OR change the visibility of the first sheet from the WorksheetCollection workbook.Worksheets[0].Visibility = SheetVisibility.Hidden; -{{endregion}} +``` The other option is to use the **Hide** method exposed by both the SheetCollection and WorksheetCollection classes. The Hide method provides several overloads and supports hiding a sheet by passing: * a sheet at the specified index; * a specified sheet; * an active sheet. (available on SheetCollection only) -#### **[C#] Example 2: Hiding sheets using the Hide method** +#### **Example 2: Hiding sheets using the Hide method** -{{region cs-radspreadprocessing-working-with-worksheets-sheets-visibility_1}} +```csharp Worksheet worksheet = workbook.Worksheets.First(); // Hiding the first sheet from the WorksheetCollection workbook.Worksheets.Hide(worksheet); -{{endregion}} +``` ## Unhiding Sheets @@ -65,28 +65,28 @@ As with hiding, unhiding can be done both through setting the Sheet Visibility p The following code snippets exemplify the two approaches. -#### **[C#] Example 3: Setting the SheetVisibility to Visible** +#### **Example 3: Setting the SheetVisibility to Visible** -{{region cs-radspreadprocessing-working-with-worksheets-sheets-visibility_2}} +```csharp // Change the visibility of the first sheet from the SheetCollection workbook.Sheets[0].Visibility = SheetVisibility.Visible; -{{endregion}} +``` The **Unhide** method provides two overloads and supports unhiding a sheet by: * a sheet at the specified index. * a specified sheet. -#### **[C#] Example 4: Unhiding sheets using the Unhide method** +#### **Example 4: Unhiding sheets using the Unhide method** -{{region cs-radspreadprocessing-working-with-worksheets-sheets-visibility_3}} +```csharp // Unhiding sheet at the specified index workbook.Worksheets.Unhide(0); // OR unhiding the first sheet from the WorksheetCollection workbook.Worksheets.Unhide(workbook.Worksheets.First()); -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadprocessing/working-with-worksheets/view-state.md b/libraries/radspreadprocessing/working-with-worksheets/view-state.md index aa386e23..f933dc97 100644 --- a/libraries/radspreadprocessing/working-with-worksheets/view-state.md +++ b/libraries/radspreadprocessing/working-with-worksheets/view-state.md @@ -18,22 +18,22 @@ The following sections describe the members of the WorskheetViewState class. Allows you to get or set the current scale factor of the worksheet. You can use this property to zoom in or out according to your needs. The values you can apply are between 0.5 and 4, corresponding to 50% and 400% respectively. -#### __[C#] Example 1: Set the zoom level of a worksheet to 50%__ -{{region cs-radspreadprocessing-working-with-worksheets-view-state_0}} +#### __Example 1: Set the zoom level of a worksheet to 50%__ +```csharp workbook.Worksheets[0].ViewState.ScaleFactor = new Size(0.5, 0.5); -{{endregion}} +``` ### **TopLeftCellIndex** Determines the top left cell visible on the screen. You can use this property to ensure that the data you would like to visualize when the worksheet is opened is in the user viewport. -#### __[C#] Example 2: Set the top left cell to be C11__ -{{region cs-radspreadprocessing-working-with-worksheets-view-state_1}} +#### __Example 2: Set the top left cell to be C11__ +```csharp workbook.Worksheets[0].ViewState.TopLeftCellIndex = new CellIndex(10, 2); -{{endregion}} +``` ### **SelectionState** @@ -41,8 +41,8 @@ Gets or sets the state of the selection inside the worksheet. **Example 3** demonsrates how you can create two selection ranges (one from B3 to E9 and one from D6 to G13) and change the active cell inside that selection. -#### __[C#] Example 3: Change the selection__ -{{region cs-radspreadprocessing-working-with-worksheets-view-state_2}} +#### __Example 3: Change the selection__ +```csharp CellIndex selectionActiveCellIndex = new CellIndex(5, 2); // C6 List selectionRanges = new List() @@ -53,7 +53,7 @@ Gets or sets the state of the selection inside the worksheet. SelectionState selectionState = new SelectionState(selectionRanges, selectionActiveCellIndex, ViewportPaneType.Scrollable); workbook.Worksheets[0].ViewState.SelectionState = selectionState; -{{endregion}} +``` #### Figure 1: Selection in worksheet ![](images/ViewState_Selection.png) @@ -66,19 +66,19 @@ Gets or sets a value indicating whether the sheet is selected. Allows you to get or set a boolean value determining whether the gridlines should be visualized when the document is rendered. -#### __[C#] Example 4: Remove grid lines__ -{{region cs-radspreadprocessing-working-with-worksheets-view-state_3}} +#### __Example 4: Remove grid lines__ +```csharp workbook.Worksheets[0].ViewState.ShowGridLines = false; -{{endregion}} +``` ### **ShowRowColHeaders** Determines whether the headers of the rows and columns should be visualized when the document is rendered. -#### __[C#] Example 5: Remove row and column headers__ -{{region cs-radspreadprocessing-working-with-worksheets-view-state_4}} +#### __Example 5: Remove row and column headers__ +```csharp workbook.Worksheets[0].ViewState.ShowRowColHeaders = false; -{{endregion}} +``` #### Figure 2: Worksheet with hidden row/column headers and grid lines ![](images/ViewState_HideLinesHeaders.png) @@ -99,10 +99,10 @@ Allows you to freeze panes. Read more about this feature and its usage in the [F Allows you to set the color of the worksheet's tab. -#### __[C#] Example 6: Change the color of the tab__ -{{region cs-radspreadprocessing-working-with-worksheets-view-state_5}} +#### __Example 6: Change the color of the tab__ +```csharp workbook.Worksheets[0].ViewState.TabColor = new ThemableColor(Colors.Green); -{{endregion}} +``` #### Figure 3: Worskheet with green tab ![](images/ViewState_TabColor.png) diff --git a/libraries/radspreadprocessing/working-with-worksheets/what-is-worksheet.md b/libraries/radspreadprocessing/working-with-worksheets/what-is-worksheet.md index b97d2d74..d85c878b 100644 --- a/libraries/radspreadprocessing/working-with-worksheets/what-is-worksheet.md +++ b/libraries/radspreadprocessing/working-with-worksheets/what-is-worksheet.md @@ -37,11 +37,11 @@ The main characteristics of worksheets can be summarized in the following list: * __UsedCellRange and GetUsedCellRange()__: Since each worksheet contains over a million rows and more than sixteen thousand columns, it is unlikely to use the full capacity of a worksheet. Typically, a worksheet uses only a part of the available cells. That said, in a number of scenarios you might want to know which part of the worksheet contains your data and ignore the rest of the cells. The UsedCellRange property of the __Worksheet__ class returns a cell range that starts from cell A1 and holds all cells containing data or formatting. With the GetUsedCellRange() method you can pass and IEnumerable<[IPropertyDefinition](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Spreadsheet.PropertySystem.IPropertyDefinition-1.html)> object to get the used cell range, holding only the cells with specific property definitions. __Example 1__ demonstrates how to get the used cell range of cells with value. - #### __[C#] Example 1: Get the used cell range of cells with value__ + #### __Example 1: Get the used cell range of cells with value__ - {{region cs-radspreadprocessing-working-with-worksheets-what-is-worksheet_0}} + ```csharp CellRange result = worksheet.GetUsedCellRange(new IPropertyDefinition[] { CellPropertyDefinitions.ValueProperty }); - {{endregion}} + ``` >More information and examples of working with the used cell range of a worksheet are available in the [Iterating Used Cells]({%slug radspreadprocessing-working-with-cells-iterating-used-cells%}) topic. diff --git a/libraries/radspreadstreamprocessing/export.md b/libraries/radspreadstreamprocessing/export.md index df601477..d6974328 100644 --- a/libraries/radspreadstreamprocessing/export.md +++ b/libraries/radspreadstreamprocessing/export.md @@ -27,12 +27,12 @@ The supported formats require to follow different patterns when writing a docume >As of R3 2017, the encoding used to export **CSV** documents is **UTF-8 with BOM**. -#### **[C#] Example 1: Specify export format** +#### **Example 1: Specify export format** -{{region radspreadstreamprocessing-export_0}} +```csharp IWorkbookExporter workbook = SpreadExporter.CreateWorkbookExporter(SpreadDocumentFormat.Csv, stream); -{{endregion}} +``` Instantiating IWorkbookExporter directly starts the creation of the file using the Stream instance passed as a parameter to the CreateWorkbookExporter() method. Writing the document content finishes once the [IWorkbookExporter]({%slug radspreadstreamprocessing-model-workbook%}) instance is disposed. diff --git a/libraries/radspreadstreamprocessing/features/cell-styles.md b/libraries/radspreadstreamprocessing/features/cell-styles.md index 97c856ba..6c92e431 100644 --- a/libraries/radspreadstreamprocessing/features/cell-styles.md +++ b/libraries/radspreadstreamprocessing/features/cell-styles.md @@ -81,12 +81,12 @@ When you apply a style to a cell with locally set properties, the end result is **Example 1** shows what applying the Number group looks like. -#### **[C#] Example 1: Get a built-in style and apply a number group** +#### **Example 1: Get a built-in style and apply a number group** -{{region cs-radspreadstreamprocessing-features-styling-cell-styles_0}} +```csharp SpreadCellStyle style = workbook.CellStyles.GetByName("Good"); style.ApplyNumberFormat = true; -{{endregion}} +``` Through the API you can add, modify or remove styles from the **CellStyles** collection of [IWorkbookExporter]({%slug radspreadstreamprocessing-model-workbook%}). @@ -97,9 +97,9 @@ Through the API you can add, modify or remove styles from the **CellStyles** col Creating a new style is pretty straight-forward. All you have to do is invoke the Add() method of workbook's CellStyles collection. The method returns an object of type SpreadCellStyle, which you can manipulate. -#### **[C#] Example 2: Create SpreadCellStyle and apply it to a cell** +#### **Example 2: Create SpreadCellStyle and apply it to a cell** -{{region cs-radspreadstreamprocessing-features-styling-cell-styles_1}} +```csharp SpreadBorder border = new SpreadBorder(SpreadBorderStyle.Thick, new SpreadThemableColor(new SpreadColor(255, 0, 0))); SpreadCellStyle style = workbook.CellStyles.Add("MyStyle"); @@ -125,7 +125,7 @@ Creating a new style is pretty straight-forward. All you have to do is invoke th { CellStyle = style }); -{{endregion}} +``` ## Modify a Style @@ -133,12 +133,12 @@ Modifying a style is even easier than creating one. All you need to do is retrie **Example 3** obtains the Bad style from the cell styles collection of a workbook and modifies it. -#### **[C#] Example 3: Modify a built-in style** +#### **Example 3: Modify a built-in style** -{{region cs-radspreadstreamprocessing-features-styling-cell-styles_2}} +```csharp SpreadCellStyle style = workbook.CellStyles.GetByName("Bad"); style.IsBold = true; -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadstreamprocessing/features/culture-spesific-predefined-formats.md b/libraries/radspreadstreamprocessing/features/culture-spesific-predefined-formats.md index 2688cc9b..f638d083 100644 --- a/libraries/radspreadstreamprocessing/features/culture-spesific-predefined-formats.md +++ b/libraries/radspreadstreamprocessing/features/culture-spesific-predefined-formats.md @@ -54,9 +54,9 @@ Starting with R3 2021, __SpreadStreamProcessing__ exposes the __BuiltInNumberFor Example 1 demonstrates how you can get specific format and set it when exporting a cell. -#### [C#] Example 1: Using BuiltInNumberFormats class +#### Example 1: Using BuiltInNumberFormats class -{{region radspreadstreamprocessing-features-culture-spesific-predefined-formats_0}} +```csharp SpreadCellFormat format = new SpreadCellFormat(); format.NumberFormat = BuiltInNumberFormats.GetFraction(); @@ -67,4 +67,4 @@ Example 1 demonstrates how you can get specific format and set it when exporting cell.SetFormat(format); } -{{endregion}} +``` diff --git a/libraries/radspreadstreamprocessing/features/page-setup-exportedr.md b/libraries/radspreadstreamprocessing/features/page-setup-exportedr.md index 74603cbf..d5a43490 100644 --- a/libraries/radspreadstreamprocessing/features/page-setup-exportedr.md +++ b/libraries/radspreadstreamprocessing/features/page-setup-exportedr.md @@ -23,9 +23,9 @@ The __PageSetupExporter__ allows you to export the page settings for printing. T An important part is that you need to place the **PageSetupExporer** after the code for exporting all cells on the sheet. Example 1 demonstrates how you can create the **PageSetupExporter** and where to place it. -#### **[C#] Example 1: Using PageSetupExporter** +#### **Example 1: Using PageSetupExporter** -{{region cs-radspreadstreamprocessing-features-page-setup-exporter_0}} +```csharp using (FileStream stream = File.Open(fileName, FileMode.OpenOrCreate)) { @@ -48,7 +48,7 @@ An important part is that you need to place the **PageSetupExporer** after the c } } -{{endregion}} +``` >IPageSetupExporter inherits from [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx). Make sure the object is disposed when you are done with it. Otherwise, the content won't be written in the exported file. The best way to ensure this is handled properly is to wrap it in a *using* statement. \ No newline at end of file diff --git a/libraries/radspreadstreamprocessing/features/text-measuring.md b/libraries/radspreadstreamprocessing/features/text-measuring.md index e4dfb453..7e6cfdc7 100644 --- a/libraries/radspreadstreamprocessing/features/text-measuring.md +++ b/libraries/radspreadstreamprocessing/features/text-measuring.md @@ -52,9 +52,9 @@ GetCellContentSize exposes an overload that allows you pass separate values for The following example shows how you can create a spreadsheet document, measure the content of the cells and apply width to the columns in a way that these columns auto fit their content. -#### [C#] Example 1: Create spreadsheet with auto fit columns width +#### Example 1: Create spreadsheet with auto fit columns width -{{region radspreadstreamprocessing-features-text-measuring_0}} +```csharp public static void ExportSpreadsheet(SpreadDocumentFormat documentFormat, string fileName) { @@ -119,7 +119,7 @@ The following example shows how you can create a spreadsheet document, measure t } } -{{endregion}} +``` ## See Also diff --git a/libraries/radspreadstreamprocessing/features/worksheet-view-exporter.md b/libraries/radspreadstreamprocessing/features/worksheet-view-exporter.md index 86cd653b..7186e9b1 100644 --- a/libraries/radspreadstreamprocessing/features/worksheet-view-exporter.md +++ b/libraries/radspreadstreamprocessing/features/worksheet-view-exporter.md @@ -29,14 +29,14 @@ The **IWorksheetViewExporter** interface allows you to manipulate the way the ex You can create an instance of the IWorksheetViewExporter interface using the corresponding method of [IWorksheetExporter]({%slug radspreadstreamprocessing-model-worksheet%}). -#### **[C#] Example 1: Create IWorksheetViewExporter instance** +#### **Example 1: Create IWorksheetViewExporter instance** -{{region cs-radspreadstreamprocessing-features-worksheet-view-exporter_0}} +```csharp using (IWorksheetViewExporter worksheetView = worksheetExporter.CreateWorksheetViewExporter()) { // ... } -{{endregion}} +``` >IWorksheetViewExporter inherits from [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx). Make sure the object is disposed when you are done with it. Otherwise, the content won't be written in the exported file. The best way to ensure this is handled properly is to wrap it in a *using* statement. @@ -48,9 +48,9 @@ The IWorksheetViewExporter interface allows you perform the following operations With the IWorksheetViewExporter interface you can set the first visible cell. This cell will be positioned at the top left position of the visible area when the document is rendered. **Example 2** shows how you can generate a document containing one worksheet, which, when visualized, will show the C5 cell as the top left cell. -#### **[C#] Example 2: Export a document with first visible cell C5** +#### **Example 2: Export a document with first visible cell C5** -{{region cs-radspreadstreamprocessing-features-worksheet-view-exporter_1}} +```csharp using (IWorksheetExporter worksheetExporter = workbookExporter.CreateWorksheetExporter("Sheet 1")) { using (IWorksheetViewExporter worksheetView = worksheetExporter.CreateWorksheetViewExporter()) @@ -59,16 +59,16 @@ With the IWorksheetViewExporter interface you can set the first visible cell. Th } // Fill the worksheet. } -{{endregion}} +``` ### Add Selection to a Document IWorksheetViewExporter defines methods that allow you apply selection to the exported document so that it contains selection ranges when visualized. You can also change the position of the selection's active cell. -#### **[C#] Example 3: Export a document with applied multiple selection ranges** +#### **Example 3: Export a document with applied multiple selection ranges** -{{region cs-radspreadstreamprocessing-features-worksheet-view-exporter_2}} +```csharp using (IWorksheetExporter worksheetExporter = workbookExporter.CreateWorksheetExporter("Sheet 1")) { using (IWorksheetViewExporter worksheetView = worksheetExporter.CreateWorksheetViewExporter()) @@ -79,12 +79,12 @@ IWorksheetViewExporter defines methods that allow you apply selection to the exp } // Fill the worksheet. } -{{endregion}} +``` -#### **[C#] Example 4: Export a document with selection range and specified active cell of the selection** +#### **Example 4: Export a document with selection range and specified active cell of the selection** -{{region cs-radspreadstreamprocessing-features-worksheet-view-exporter_3}} +```csharp using (IWorksheetExporter worksheet = workbookExporter.CreateWorksheetExporter("Sheet 1")) { using (IWorksheetViewExporter worksheetView = worksheet.CreateWorksheetViewExporter()) @@ -94,7 +94,7 @@ IWorksheetViewExporter defines methods that allow you apply selection to the exp } // Fill the worksheet with data. } -{{endregion}} +``` #### Figure 1: Selection with specified active cell ![](images/RadSpreadStreamProcessing_Features_WorksheetViewExporter_01.png) @@ -104,45 +104,45 @@ IWorksheetViewExporter defines methods that allow you apply selection to the exp You can apply a scale factor to the exported document. -#### **[C#] Example 5: Set scale factor** +#### **Example 5: Set scale factor** -{{region cs-radspreadstreamprocessing-features-worksheet-view-exporter_4}} +```csharp worksheetView.SetScaleFactor(0.5); -{{endregion}} +``` ### Hide Grid Lines and Row or Column Headers IWorksheetViewExporter enables you to set whether the resultant document should be visualized with grid lines and headers. **Example 6** demonstrates how you can hide both, grid lines and row/column headers. -#### **[C#] Example 6: Hide grid lines and row/column headers** +#### **Example 6: Hide grid lines and row/column headers** -{{region cs-radspreadstreamprocessing-features-worksheet-view-exporter_5}} +```csharp worksheetView.SetShouldShowGridLines(false); worksheetView.SetShouldShowRowColumnHeaders(false); -{{endregion}} +``` ### Freeze Panes You can freeze panes in the spreadsheet document using the SetFreezePanes() method. -#### **[C#] Example 7: Set freeze panes** +#### **Example 7: Set freeze panes** -{{region cs-radspreadstreamprocessing-features-worksheet-view-exporter_6}} +```csharp worksheetView.SetFreezePanes(4, 6); -{{endregion}} +``` #### Figure 2: Frozen panes ![](images/RadSpreadStreamProcessing_Features_WorksheetViewExporter_02.png) An overload of the SetFreezePanes() method enables you to change the first visible cell of the scrollable pane (the right-bottom pane). -#### **[C#] Example 8: Set freeze panes and change the first visible cell of the scrollable pane** +#### **Example 8: Set freeze panes and change the first visible cell of the scrollable pane** -{{region cs-radspreadstreamprocessing-features-worksheet-view-exporter_7}} +```csharp worksheetView.SetFreezePanes(4, 6, 10, 10); -{{endregion}} +``` In **Figure 3**, you can see that the first visible cell of the scrollable pane is K11. diff --git a/libraries/radspreadstreamprocessing/getting-started.md b/libraries/radspreadstreamprocessing/getting-started.md index 68f4088d..ef8532d6 100644 --- a/libraries/radspreadstreamprocessing/getting-started.md +++ b/libraries/radspreadstreamprocessing/getting-started.md @@ -77,9 +77,9 @@ When creating a document with **RadSpreadStreamProcessing**, the order in which **Example 1** shows how you could create a simple document. -#### [C#] Example 1: Create a document +#### Example 1: Create a document -{{region radspreadstreamprocessing-getting-started_0}} +```csharp using (FileStream stream = File.OpenWrite("sample.xlsx")) { using (IWorkbookExporter workbook = SpreadExporter.CreateWorkbookExporter(SpreadDocumentFormat.Xlsx, stream)) @@ -131,7 +131,7 @@ When creating a document with **RadSpreadStreamProcessing**, the order in which } } } -{{endregion}} +``` **Figure 1** shows the result of executing the code from **Example 1**. @@ -156,9 +156,9 @@ When reading a document with **RadSpreadStreamProcessing**, the order of parsing **Example 2** demonstrates how you could read the data from an existing document. -#### [C#] Example 2: Read data from a document +#### Example 2: Read data from a document -{{region radspreadstreamprocessing-getting-started_1}} +```csharp using (FileStream fs = new FileStream(fileName, FileMode.Open)) { @@ -177,7 +177,7 @@ When reading a document with **RadSpreadStreamProcessing**, the order of parsing } } -{{endregion}} +``` For more complete examples head to the [Developer Focused Examples]({%slug radspreadstreamprocessing-sdk-examples%}) section of the library. diff --git a/libraries/radspreadstreamprocessing/import.md b/libraries/radspreadstreamprocessing/import.md index ed5e8c06..dd742020 100644 --- a/libraries/radspreadstreamprocessing/import.md +++ b/libraries/radspreadstreamprocessing/import.md @@ -36,9 +36,9 @@ To read the data from a file, you should parse the desired elements in a sequenc 5. Read Cells -#### [C#] Example 1: Read data from a document +#### Example 1: Read data from a document -{{region radspreadstreamprocessing-import_0}} +```csharp using (System.IO.FileStream fs = new System.IO.FileStream(fileName, FileMode.Open)) { @@ -57,7 +57,7 @@ To read the data from a file, you should parse the desired elements in a sequenc } } -{{endregion}} +``` Through the importer objects, you can access the properties of the different elements. diff --git a/libraries/radspreadstreamprocessing/model/cells.md b/libraries/radspreadstreamprocessing/model/cells.md index 2b05a57d..9a157434 100644 --- a/libraries/radspreadstreamprocessing/model/cells.md +++ b/libraries/radspreadstreamprocessing/model/cells.md @@ -27,14 +27,14 @@ If you need to read the cell data and its properties, you should use the [**ICel A concrete instance of ICellExporter could be created through the **CreateCellExporter()** method of [IRowExporter]({%slug radspreadstreamprocessing-model-rows%}). **Example 1** demonstrates how you can add a cell to a row. -#### **[C#] Example 1: Using ICellExporter** +#### **Example 1: Using ICellExporter** -{{region cs-radspreadstreamprocessing-model-cells_0}} +```csharp using (ICellExporter cell = row.CreateCellExporter()) { } -{{endregion}} +``` >ICellExporter inherits from [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx). Make sure the object is disposed when you are done with it. Otherwise, the content won't be written in the exported file. The best way to ensure this is handled properly is to wrap it in a *using* statement. @@ -51,28 +51,28 @@ The **SetValue()** method exposes several overloads allowing you to set values f > In order to visualize a value as a date or time, you will need to set an appropriate Number format of the cell. Otherwise, it will be treated as a number. -#### **[C#] Example 2: Setting a value to a cell** +#### **Example 2: Setting a value to a cell** -{{region cs-radspreadstreamprocessing-model-cells_1}} +```csharp using (ICellExporter cell = row.CreateCellExporter()) { cell.SetValue(123.456); } -{{endregion}} +``` ### Set a Formula In order to allow you setting a formula as a value of a cell, ICellExporter defines the SetFormula() method. This method accepts a string, representing the formula as a parameter. **Example 4** shows how you could use it. -#### **[C#] Example 4: Setting a formula to a cell** +#### **Example 4: Setting a formula to a cell** -{{region cs-radspreadstreamprocessing-model-cells_3}} +```csharp using (ICellExporter cell = row.CreateCellExporter()) { cell.SetFormula("=Sum(A1, B2)"); } -{{endregion}} +``` >All formulas should be set in **InvariantCulture**. For example, the decimal separator should be “.”, the list separator should be “,”. @@ -84,9 +84,9 @@ The cells in a document are exported one by one from left to right starting from In some cases you may need to skip several cells and start filling the data in the next one. The [**IRowExporter**]({%slug radspreadstreamprocessing-model-rows%}) interface declares a method that allows you to implement such scenario. **Example 3** shows how to skip 5 cells and set a value and a vertical alignment to the sixth one. -#### **[C#] Example 3: Skip cells** +#### **Example 3: Skip cells** -{{region cs-radspreadstreamprocessing-model-cells_2}} +```csharp row.SkipCells(5); using (ICellExporter cell = row.CreateCellExporter()) { @@ -96,20 +96,20 @@ In some cases you may need to skip several cells and start filling the data in t VerticalAlignment = SpreadVerticalAlignment.Center }); } -{{endregion}} +``` ### Merge Cells **Example 5** shows how several cells could be merged in a single one through [IWorksheetExporter]({%slug radspreadstreamprocessing-model-worksheet%}). -#### **[C#] Example 5: Merge cells** +#### **Example 5: Merge cells** -{{region cs-radspreadstreamprocessing-model-cells_4}} +```csharp using (IWorksheetExporter worksheet = workbook.CreateWorksheetExporter("Sheet 1")) { worksheet.MergeCells(3, 3, 10, 10); } -{{endregion}} +``` >important Due to the importance of the order the content is inserted in a document, the Merge operation must be the last operation before disposing IWorksheetExporter. @@ -165,8 +165,8 @@ Another method, exposed by **ICellExporter** - SetFormat() - enables you to chan - Fill properties -#### **[C#] Example 6: Format cells** -{{region cs-radspreadstreamprocessing-model-cells_5}} +#### **Example 6: Format cells** +```csharp SpreadBorder border = new SpreadBorder(SpreadBorderStyle.Thick, new SpreadThemableColor(new SpreadColor(255, 0, 0))); SpreadCellFormat cellFormat = new SpreadCellFormat() @@ -191,13 +191,13 @@ Another method, exposed by **ICellExporter** - SetFormat() - enables you to chan }; cell.SetFormat(cellFormat); -{{endregion}} +``` In addition to the listed properties, the SpreadCellFormat class allows you to set a style to a cell. For more information on cell styles, check [this topic]({%slug radspreadstreamprocessing-features-styling-cell-styles%}) -#### **[C#] Example 7: Set the value format to string, date or a number** +#### **Example 7: Set the value format to string, date or a number** -{{region cs-radspreadstreamprocessing-model-cells_6}} +```csharp using (ICellExporter cell = row.CreateCellExporter()) { SpreadCellFormat format = new SpreadCellFormat() @@ -231,7 +231,7 @@ In addition to the listed properties, the SpreadCellFormat class allows you to s cell.SetValue(42370.12); } -{{endregion}} +``` A SpreadCellFormat instance could be applied on multiple cells. However, if a property of the format changes, the new settings will be applied to the cells formatted after the modification. @@ -241,9 +241,9 @@ A SpreadCellFormat instance could be applied on multiple cells. However, if a pr A concrete instance of ICellImporter could be obtained through the Cells collection of [IRowImporter]({%slug radspreadstreamprocessing-model-rows%}). **Example 8** demonstrates how you can read the cells of a row. -#### **[C#] Example 8: Create ICellImporter** +#### **Example 8: Create ICellImporter** -{{region cs-radspreadstreamprocessing-model-cells_7}} +```csharp foreach (ICellImporter cell in rowImporter.Cells) { @@ -252,7 +252,7 @@ A concrete instance of ICellImporter could be obtained through the Cells collect SpreadCellFormat format = cell.Format; SpreadCellStyle style = cell.Format.CellStyle; } -{{endregion}} +``` The ICellImporter interface exposes the following properties: diff --git a/libraries/radspreadstreamprocessing/model/column.md b/libraries/radspreadstreamprocessing/model/column.md index 308e6ad4..805e33ef 100644 --- a/libraries/radspreadstreamprocessing/model/column.md +++ b/libraries/radspreadstreamprocessing/model/column.md @@ -25,14 +25,14 @@ To read a column and its properties, you should use the [**IColumnImporter** int A concrete instance of IColumnExporter could be created through the CreateColumnExporter() method of [IWorksheetExporter]({%slug radspreadstreamprocessing-model-worksheet%}). **Example 1** demonstrates how you can add a column to a worksheet. -#### **[C#] Example 1: Create IColumnExporter** +#### **Example 1: Create IColumnExporter** -{{region cs-radspreadstreamprocessing-model-columns_0}} +```csharp using (IColumnExporter column = worksheet.CreateColumnExporter()) { } -{{endregion}} +``` >IColumnExporter inherits from [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx). Make sure the object is disposed when you are done with it. Otherwise, the content won't be written in the exported file. The best way to ensure this is handled properly is to wrap it in a *using* statement. @@ -47,14 +47,14 @@ In order to customize the way a column appears, you could use one of the followi * **SetHidden()**: Sets a boolean value that indicates whether the column should be hidden or not. -#### **[C#] Example 2: Set properties to IColumnExporter** +#### **Example 2: Set properties to IColumnExporter** -{{region cs-radspreadstreamprocessing-model-columns_1}} +```csharp using (IColumnExporter column = worksheet.CreateColumnExporter()) { column.SetWidthInPixels(100); } -{{endregion}} +``` \* Due to the specifics of the library, RadSpreadStreamProcessing doesn't support auto fitting the width of the columns. You can find information on how you can calculate the width needed for specific content in the [Get Cell Content Size]({%slug radspreadstreamprocessing-features-text-measuring%}) topic. @@ -64,15 +64,15 @@ The columns in a document are exported one by one from left to right starting fr In some cases you may need to skip several columns and start filling the data in the next one. The [**IWorksheetExporter**]({%slug radspreadstreamprocessing-model-worksheet%}) interface declares a method that allows you to implement such scenario. **Example 3** shows how to skip 5 columns. -#### **[C#] Example 3: Skip columns** +#### **Example 3: Skip columns** -{{region cs-radspreadstreamprocessing-model-columns_2}} +```csharp worksheet.SkipColumns(5); using (IColumnExporter column = worksheet.CreateColumnExporter()) { column.SetHidden(true); // The sixth (F) column will be hidden. } -{{endregion}} +``` ## Read a Column @@ -80,14 +80,14 @@ In some cases you may need to skip several columns and start filling the data in A concrete instance of IColumnImporter could be obtained through the Columns collection of [IWorksheetImporter]({%slug radspreadstreamprocessing-model-worksheet%}). **Example 4** demonstrates how you can start reading a row from a worksheet. -#### **[C#] Example 4: Create IColumnImporter** +#### **Example 4: Create IColumnImporter** -{{region cs-radspreadstreamprocessing-model-columns_3}} +```csharp foreach (IColumnImporter column in worksheetImporter.Columns) { } -{{endregion}} +``` The IColumnImporter interface exposes the following properties: diff --git a/libraries/radspreadstreamprocessing/model/row.md b/libraries/radspreadstreamprocessing/model/row.md index 2a5bda7f..d4c1ec28 100644 --- a/libraries/radspreadstreamprocessing/model/row.md +++ b/libraries/radspreadstreamprocessing/model/row.md @@ -26,14 +26,14 @@ To read a row and its properties, you should use [**IRowImporter** interface](ht A concrete instance of IRowExporter could be created through the CreateRowExporter() method of [IWorksheetExporter]({%slug radspreadstreamprocessing-model-worksheet%}). **Example 1** demonstrates how you can add a row to a worksheet. -#### **[C#] Example 1: Create IRowExporter** +#### **Example 1: Create IRowExporter** -{{region cs-radspreadstreamprocessing-model-rows_0}} +```csharp using (IRowExporter row = worksheet.CreateRowExporter()) { } -{{endregion}} +``` >IRowExporter inherits from [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx). Make sure the object is disposed when you are done with it. Otherwise, the content won't be written in the exported file. The best way to ensure this is handled properly is to wrap it in a *using* statement. @@ -48,14 +48,14 @@ In order to customize the way a row appears, you could use one of the following * **SetHidden()**: Sets a boolean value that indicates whether the row should be hidden or not. -#### **[C#] Example 2: Set properties to IRowExporter** +#### **Example 2: Set properties to IRowExporter** -{{region cs-radspreadstreamprocessing-model-rows_1}} +```csharp using (IRowExporter row = worksheet.CreateRowExporter()) { row.SetHeightInPixels(200); } -{{endregion}} +``` \* Due to the specifics of the library, RadSpreadStreamProcessing doesn't support auto fitting the height of the rows. You can find information on how you can calculate the height needed for specific content in the [Get Cell Content Size]({%slug radspreadstreamprocessing-features-text-measuring%}) topic. @@ -65,15 +65,15 @@ The rows in a document are exported one by one from top to bottom starting from In some cases you may need to skip several rows and start filling the data in the next one. The [**IWorksheetExporter**]({%slug radspreadstreamprocessing-model-worksheet%}) interface declares a method that allows you to implement such scenario. **Example 3** shows how to skip 5 rows. -#### **[C#] Example 3: Skip rows** +#### **Example 3: Skip rows** -{{region cs-radspreadstreamprocessing-model-rows_2}} +```csharp worksheet.SkipRows(5); using (IRowExporter row = worksheet.CreateRowExporter()) { row.SetHidden(true); // The sixth row will be hidden. } -{{endregion}} +``` ## Read a Row @@ -81,14 +81,14 @@ In some cases you may need to skip several rows and start filling the data in th A concrete instance of IRowImporter could be obtained through the Rows collection of [IWorksheetImporter]({%slug radspreadstreamprocessing-model-worksheet%}). **Example 4** demonstrates how you can start reading a row from a worksheet. -#### **[C#] Example 4: Create IRowImporter** +#### **Example 4: Create IRowImporter** -{{region cs-radspreadstreamprocessing-model-rows_3}} +```csharp foreach (IRowImporter rowImporter in worksheetImporter.Rows) { } -{{endregion}} +``` The IRowImporter interface exposes the following properties to allow you access its data: diff --git a/libraries/radspreadstreamprocessing/model/workbook.md b/libraries/radspreadstreamprocessing/model/workbook.md index 2605f60d..f57f1529 100644 --- a/libraries/radspreadstreamprocessing/model/workbook.md +++ b/libraries/radspreadstreamprocessing/model/workbook.md @@ -30,9 +30,9 @@ You can obtain an instance of IWorkbookExporter through the **CreateWorkbookExpo The code from **Example 1** creates an empty workbook and exports it to an XLSX file. -#### **[C#] Example 1: Create IWorkbookExporter** +#### **Example 1: Create IWorkbookExporter** -{{region cs-radspreadstreamprocessing-model-workbook_0}} +```csharp using (FileStream stream = File.OpenWrite("sample.xlsx")) { using (IWorkbookExporter workbook = SpreadExporter.CreateWorkbookExporter(SpreadDocumentFormat.Xlsx, stream)) @@ -45,32 +45,32 @@ The code from **Example 1** creates an empty workbook and exports it to an XLSX } } } -{{endregion}} +``` ### Append Content to an Existing Document The __CreateWorkbookExporter__ method creates a new workbook which overrides the content of the document contained in the stream if it's not empty. You can change that by using the second overload of the CreateWorkbookExporter method and pass the export mode explicitly. You can do that via the last parameter of the method (exportMode) which is of type __SpreadExportMode__. SpreadExportMode is an enum that exposes two constants - __Create__ and __Append__. The default export mode is Create, which overrides the stream's content. If you set the export mode to __Append__, an existing workbook from the stream will be opened if there is any content in it. Then you can append the new content to the already existing document. -#### **[C#] Example 2: Create IWorkbookExporter and append the content from the stream** +#### **Example 2: Create IWorkbookExporter and append the content from the stream** -{{region cs-radspreadstreamprocessing-model-workbook_1}} +```csharp IWorkbookExporter workbook = SpreadExporter.CreateWorkbookExporter(SpreadDocumentFormat.Xlsx, stream, SpreadExportMode.Append); -{{endregion}} +``` >IWorkbookExporter inherits from [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx). Make sure the object is disposed when you are done with it. Otherwise, the content won't be written in the exported file. The best way to ensure this is handled properly is to wrap it in a *using* statement. In the spreadsheet documents, the names of the sheets are unique. If you try to add a sheet with a name that is already present in the workbook, you will get an **ArgumentException**. This is where the **GetSheetInfos()** method comes in handy. The method returns information about the sheets currently present in the workbook (imported or added). It could be used to check whether a particular sheet name is available (not already present) when appending a worksheet to an existing workbook. **Example 3** demonstrates how you can use it. -#### **[C#] Example 3: Using IWorkbookExporter.GetSheetInfos()** +#### **Example 3: Using IWorkbookExporter.GetSheetInfos()** -{{region cs-radspreadstreamprocessing-model-workbook_2}} +```csharp using (IWorkbookExporter workbookExporter = SpreadExporter.CreateWorkbookExporter(SpreadDocumentFormat.Xlsx, stream)) { IEnumerable sheetInfos = workbookExporter.GetSheetInfos(); string firstNameSheet = sheetInfos.First().Name; } -{{endregion}} +``` Since the CSV format doesn't have the concept for multiple sheets, invoking GetSheetInfos() for a CSV document returns an empty collection. diff --git a/libraries/radspreadstreamprocessing/model/worksheet.md b/libraries/radspreadstreamprocessing/model/worksheet.md index eda7da0b..26afff18 100644 --- a/libraries/radspreadstreamprocessing/model/worksheet.md +++ b/libraries/radspreadstreamprocessing/model/worksheet.md @@ -32,14 +32,14 @@ In **RadSpreadStreamProcessing**, a worksheet could be exported through the [**I A concrete instance of IWorksheetExporter could be created through the CreateWorksheetExporter() method of [IWorkbookExporter]({%slug radspreadstreamprocessing-model-workbook%}). **Example 1** demonstrates how you can add a worksheet to a workbook. -#### **[C#] Example 1: Create IWorksheetExporter** +#### **Example 1: Create IWorksheetExporter** -{{region cs-radspreadstreamprocessing-model-worksheet_0}} +```csharp using (IWorksheetExporter worksheet = workbook.CreateWorksheetExporter("My sheet")) { // Fill the worksheet with data and set the desired properties } -{{endregion}} +``` >IWorksheetExporter inherits from [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx). Make sure the object is disposed when you are done with it. Otherwise, the content won't be written in the exported file. The best way to ensure this is handled properly is to wrap it in a *using* statement. diff --git a/libraries/radwordsprocessing/concepts/document-themes.md b/libraries/radwordsprocessing/concepts/document-themes.md index b1c25b17..d467648c 100644 --- a/libraries/radwordsprocessing/concepts/document-themes.md +++ b/libraries/radwordsprocessing/concepts/document-themes.md @@ -43,7 +43,7 @@ The twelve color types above are used for creating __ThemableColor__ objects. Th __Example 1__ demonstrates how to create a __ThemeColorScheme__ object. Note that the example passes a name and twelve colors to the constructor. Every color has a comment next to it, so you can see its corresponding __ThemeColorType__. -#### __[C#] Example 1: Create a ThemeColorScheme object__ +#### __Example 1: Create a ThemeColorScheme object__ @@ -70,7 +70,7 @@ There are several ways to create a __ThemableColor__ object: In order to create colors that depend on the current document theme, you need to use __ThemableColor__ objects. -#### __[C#] Example 2: Create a ThemableColor object__ +#### __Example 2: Create a ThemableColor object__ @@ -88,7 +88,7 @@ A font scheme is represented by the __ThemeFontScheme__ class. Every font scheme The code in __Example 3__ illustrates how to create a __ThemeFontScheme__ object. A name and two font family names are passed to the font scheme constructor. The former font family name corresponds to the Major ThemeFontType and the latter - to the Minor. -#### __[C#] Example 3: Create a ThemeFontScheme__ +#### __Example 3: Create a ThemeFontScheme__ @@ -106,7 +106,7 @@ In order to use the document theme's fonts you need to use __ThemableFontFamily_ When you need to create a font that depends on the current document theme, you need to use __ThemableFontFamily__ objects. -#### __[C#] Example 4: Create a ThemableFontFamily object__ +#### __Example 4: Create a ThemableFontFamily object__ @@ -116,19 +116,19 @@ When you need to create a font that depends on the current document theme, you n Now that you have a color and a font schemes, you can create a new __DocumentTheme__. You need to specify a name and pass the already created color and font schemes. -#### __[C#] Example 5: Create a DocumentTheme object__ +#### __Example 5: Create a DocumentTheme object__ There are a number of predefined color and font schemes. You can find them in a static class called [PredefinedThemeSchemes](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Spreadsheet.Theming.PredefinedThemeSchemes.html). The class exposes the properties __ColorSchemes__ and __FontSchemes__ that hold all predefined schemes. -#### __[C#] Example 6: Using a predefined scheme__ +#### __Example 6: Using a predefined scheme__ Changing the current document theme is as easy as setting a single property. -#### __[C#] Example 7: Change the document theme__ +#### __Example 7: Change the document theme__ @@ -238,12 +238,12 @@ RadWordsProcessing offers a set of predefined ThemeFontSchemes listed in the tab In order to get the actual value from __ThemableColor__ or __ThemableFontFamily__, you need to call the __GetActualValue()__ method on the corresponding object. -#### __[C#] Example 8: Get actual value from ThemableColor__ +#### __Example 8: Get actual value from ThemableColor__ -#### __[C#] Example 9: Get actual value from ThemableFont__ +#### __Example 9: Get actual value from ThemableFont__ diff --git a/libraries/radwordsprocessing/concepts/fields/compare-field.md b/libraries/radwordsprocessing/concepts/fields/compare-field.md index 12538d7f..72839508 100644 --- a/libraries/radwordsprocessing/concepts/fields/compare-field.md +++ b/libraries/radwordsprocessing/concepts/fields/compare-field.md @@ -39,7 +39,7 @@ In the table bellow are listed all the comparison operators. Inserting a Compare Field is easily achieved through the [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%})'s __InsertField()__ method. It accepts code as first argument and result as second argument. -#### __[C#] Example 1: Insert a CompareField__ +#### __Example 1: Insert a CompareField__ diff --git a/libraries/radwordsprocessing/concepts/fields/customcodefield.md b/libraries/radwordsprocessing/concepts/fields/customcodefield.md index b0072047..38170aca 100644 --- a/libraries/radwordsprocessing/concepts/fields/customcodefield.md +++ b/libraries/radwordsprocessing/concepts/fields/customcodefield.md @@ -44,7 +44,7 @@ Here are some commonly used fields. The complete list of field codes and the swi **Example 1** shows how to insert a __PAGE__ field representing the current page number in the document. -#### __[C#] Example 1: Insert PAGE field__ +#### __Example 1: Insert PAGE field__
    
 	editor.InsertField("PAGE  \\* ROMAN", "«VII»");
@@ -59,7 +59,7 @@ The __\\* ROMAN__ is general formatting switch that formats a numeric result usi
 **Example 2** demonstrates how a combination of __PAGE__ and __NUMPAGES__ fields can be inserted to show which is the current page as well as the total page count in the document.
             
 
-#### __[C#] Example 2: Insert NUMPAGES field__
+#### __Example 2: Insert NUMPAGES field__
 
 
          
 	editor.InsertText("Page ");
@@ -73,7 +73,7 @@ The __\\* ROMAN__ is general formatting switch that formats a numeric result usi
 
 In **Example 3** is demonstrated how to insert __AUTHOR__ field showing the name of the author of the document.
 
-#### __[C#]  Example 3: Insert AUTHOR field__
+#### __ Example 3: Insert AUTHOR field__
 
 
            
 	editor.InsertField("AUTHOR  \\* Upper", "«JOHN DOE»");
@@ -87,7 +87,7 @@ The __\\* Upper__ switch will convert all letters in the result to uppercase.
 
 **Example 4** shows how to insert a table of contents (TOC) field.
             
-#### __[C#]  Example 4: Insert Table of Contents field__
+#### __ Example 4: Insert Table of Contents field__
 
 
           
 	FieldInfo tocField = editor.InsertField("TOC \\o \"1-3\" \\h \\z \\u", "«result»");
diff --git a/libraries/radwordsprocessing/concepts/fields/date-field.md b/libraries/radwordsprocessing/concepts/fields/date-field.md
index d0991907..1892b23d 100644
--- a/libraries/radwordsprocessing/concepts/fields/date-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/date-field.md
@@ -38,7 +38,7 @@ Inserting a Date Field is easily achieved through the [RadFlowDocumentEditor]({%
 __Example 1__ demonstrates how you can insert a date field.
         
 
-#### __[C#] Example 1: Insert date field__
+#### __Example 1: Insert date field__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/document-variables.md b/libraries/radwordsprocessing/concepts/fields/document-variables.md
index 78e75456..7356a07d 100644
--- a/libraries/radwordsprocessing/concepts/fields/document-variables.md
+++ b/libraries/radwordsprocessing/concepts/fields/document-variables.md
@@ -18,7 +18,7 @@ position: 4
 [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}) has a __DocumentVariableCollection__ property, which holds document variable records. The collection maps string keys to string values. You can add a record in it through an indexer or with the collection's __Add()__ method. __Example 1__ demonstrates both approaches.
         
 
-#### __[C#] Example 1: Add document variable record__
+#### __Example 1: Add document variable record__
 
 
 
@@ -33,7 +33,7 @@ The same two methods can be used to modify the value of an existing variable in
 Removing defined variables can be achieved by using the __Remove()__ method of the variables collection. It accepts the name of the variable as a parameter.
         
 
-#### __[C#] Example 2: Remove document variable record__
+#### __Example 2: Remove document variable record__
 
 
 
@@ -58,7 +58,7 @@ A __DocumentVariable__ field can be inserted through [RadFlowDocumentEditor]({%s
 __Example 3__ shows insertion of the field created in __Example 1__.
         
 
-#### __[C#] Example 3: Insert document variable field__
+#### __Example 3: Insert document variable field__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/expression-field.md b/libraries/radwordsprocessing/concepts/fields/expression-field.md
index 8d1ecb1d..65ea96f9 100644
--- a/libraries/radwordsprocessing/concepts/fields/expression-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/expression-field.md
@@ -90,7 +90,7 @@ Specifies the display of a numeric result. This switch is called a "picture" swi
 Inserting an Expression Field is easily achieved through the [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%})'s **InsertField()** method. It accepts code as first argument and result as second argument.
        
 
-#### __[C#] Example 1: Insert an Expression field__
+#### __Example 1: Insert an Expression field__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/fields.md b/libraries/radwordsprocessing/concepts/fields/fields.md
index e6cfe01a..43a8571a 100644
--- a/libraries/radwordsprocessing/concepts/fields/fields.md
+++ b/libraries/radwordsprocessing/concepts/fields/fields.md
@@ -77,14 +77,14 @@ In the document object model Fields are represented by the [Field](https://docs.
 The suggested way to insert field is to use the __InsertField()__ method of [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}) class. It takes care of creating and inserting the code and result fragments as well as placing the appropriate field character inlines to separate them. The __InsertField()__ method returns an instance of the __FieldInfo__ class. It holds references to the start, separate and end field characters and also provides an API for getting the code and result fragments and updating the field.
         
 
-#### __[C#] Example 1: Create a document containing a Date field using RadFlowDocumentEditor__
+#### __Example 1: Create a document containing a Date field using RadFlowDocumentEditor__
 
 
 
 
 You can also create and insert all the parts of the field manually by creating a __FieldInfo__ instance and adding all the inlines to the document structure. **Example 2** demonstrates how to achieve the same result as in **Example 1**.
         
-#### __[C#] Example 2: Create a document containing a Date field using the RadDocument model and FieldInfo__
+#### __Example 2: Create a document containing a Date field using the RadDocument model and FieldInfo__
 
 
 
@@ -109,7 +109,7 @@ If the field type is not one of the above, the result will not be updated and th
 
 Updating a single field is done with the __UpdateField()__ method of the __FieldInfo__ class as demonstrated in **Example 3**.
 
-#### __[C#] Example 3: Update a field__
+#### __Example 3: Update a field__
 
 
 
@@ -118,7 +118,7 @@ Updating a single field is done with the __UpdateField()__ method of the __Field
 
 All fields in the document can be updated using __UpdateFields()__ of __RadFlowDocument__. **Example 4** shows how to use this method.        
 
-#### __[C#] Example 4: Update all fields in a document__
+#### __Example 4: Update all fields in a document__
 
 
 
@@ -130,7 +130,7 @@ In R3 2022 the above fields were introduced. Their evaluation requires calculati
 
 You can register the provider with the following code:
 
-#### __[C#] Example 5: Register the default NumberingFieldsProvider__
+#### __Example 5: Register the default NumberingFieldsProvider__
 
 
 
@@ -168,7 +168,7 @@ Fields can also be nested in each other. If there are nested fields inside the c
 
 **Example 5** creates a field, which will be evaluated to appropriate greeting based on the time of the day.
 
-#### __[C#] Example 6: Create a nested field__
+#### __Example 6: Create a nested field__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/hyperlink-field.md b/libraries/radwordsprocessing/concepts/fields/hyperlink-field.md
index b64b09c4..0730c283 100644
--- a/libraries/radwordsprocessing/concepts/fields/hyperlink-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/hyperlink-field.md
@@ -56,7 +56,7 @@ The possible switches for a Hyperlink field are:
 Inserting a Hyperlink field is easily achieved through the [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}). It provides two options for this:
 * __InsertHyperlink()__ method. It accepts the hyperlink text, URI, IsAnchor value and tooltip as parameters.
 
-	#### __[C#] Example 1: Insert a Hyperlink using InsertHyperlink method__
+	#### __Example 1: Insert a Hyperlink using InsertHyperlink method__
 
 	
 
@@ -69,7 +69,7 @@ Inserting a Hyperlink field is easily achieved through the [RadFlowDocumentEdito
 
 * __InsertField()__ method. It accepts code as first argument and result as second argument.
 
-	#### __[C#] Example 2: Insert a Hyperlink field using InsertField method__
+	#### __Example 2: Insert a Hyperlink field using InsertField method__
 
 	
 
@@ -81,7 +81,7 @@ Inserting a Hyperlink field is easily achieved through the [RadFlowDocumentEdito
 
 Hyperlinks can also point to a [Bookmark]({%slug radwordsprocessing-model-bookmark%}) inside the document. **Example 3** shows how to create a document containing a bookmark and a hyperlink pointing to that bookmark.
 
-#### __[C#] Example 3: Insert a hyperlink pointing to a bookmark__
+#### __Example 3: Insert a hyperlink pointing to a bookmark__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/if-field.md b/libraries/radwordsprocessing/concepts/fields/if-field.md
index e311a450..7e002fb9 100644
--- a/libraries/radwordsprocessing/concepts/fields/if-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/if-field.md
@@ -42,7 +42,7 @@ Text that results when the comparison is true (TrueText) or false (FalseText). I
 
 Inserting an If field is easily achieved through the [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%})'s __InsertField()__ method. It accepts code as first argument and result as second argument. 
 
-#### __[C#] Example 1: Insert If field__
+#### __Example 1: Insert If field__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/merge-field.md b/libraries/radwordsprocessing/concepts/fields/merge-field.md
index 72486606..ff87a996 100644
--- a/libraries/radwordsprocessing/concepts/fields/merge-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/merge-field.md
@@ -53,16 +53,16 @@ The possible switches for a Merge field are:
 Inserting a Merge field is easily achieved through the [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%})'s __InsertField()__ method. It accepts code as first argument and result as second argument.
   
 
-#### __[C#] Example 1: Insert Merge field__
+#### __Example 1: Insert Merge field__
 
 
   
 
-#### __[C#] Example 2: Insert Merge field with switches__
+#### __Example 2: Insert Merge field with switches__
 
 
 
-#### __[C#] Example 3: Insert Merge field with a Date-Time format switch__
+#### __Example 3: Insert Merge field with a Date-Time format switch__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/numbering-fields-provider.md b/libraries/radwordsprocessing/concepts/fields/numbering-fields-provider.md
index 53aaafb0..123e346d 100644
--- a/libraries/radwordsprocessing/concepts/fields/numbering-fields-provider.md
+++ b/libraries/radwordsprocessing/concepts/fields/numbering-fields-provider.md
@@ -19,7 +19,7 @@ To use the default implementation of the __NumberingFieldsProvider__ you need to
 
 The default provider can be set with the following code:
 
-#### __[C#] Example 1: Register the default NumberingFieldsProvider__
+#### __Example 1: Register the default NumberingFieldsProvider__
 
 
 
@@ -27,7 +27,7 @@ The default provider can be set with the following code:
 
 This method allows you to use a custom numbering style converter.
 
-#### __[C#] Example 2: Register custom NumberingStyleConverter__
+#### __Example 2: Register custom NumberingStyleConverter__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/numpages-fields.md b/libraries/radwordsprocessing/concepts/fields/numpages-fields.md
index 82c148d0..7c2c9c72 100644
--- a/libraries/radwordsprocessing/concepts/fields/numpages-fields.md
+++ b/libraries/radwordsprocessing/concepts/fields/numpages-fields.md
@@ -27,7 +27,7 @@ Inserting this field is easily achieved through the [RadFlowDocumentEditor]({%sl
 __Example 1__ demonstrates how you can insert a NumPages field.
         
 
-#### __[C#] Example 1: Insert NumPages field__
+#### __Example 1: Insert NumPages field__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/page-field.md b/libraries/radwordsprocessing/concepts/fields/page-field.md
index cf17f43c..3c6f5b50 100644
--- a/libraries/radwordsprocessing/concepts/fields/page-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/page-field.md
@@ -40,7 +40,7 @@ Inserting this field is easily achieved through the [RadFlowDocumentEditor]({%sl
 __Example 1__ demonstrates how you can insert a date field.
         
 
-#### __[C#] Example 1: Insert page field__
+#### __Example 1: Insert page field__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/pageref-field.md b/libraries/radwordsprocessing/concepts/fields/pageref-field.md
index 31f33eb4..b67f9023 100644
--- a/libraries/radwordsprocessing/concepts/fields/pageref-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/pageref-field.md
@@ -40,7 +40,7 @@ Inserting this field is easily achieved through the [RadFlowDocumentEditor]({%sl
 
 __Example 1__ demonstrates how you can insert a PageRef field.
  
-#### __[C#] Example 1: Insert PageRef field__
+#### __Example 1: Insert PageRef field__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/section.md b/libraries/radwordsprocessing/concepts/fields/section.md
index 2080d32a..12849b05 100644
--- a/libraries/radwordsprocessing/concepts/fields/section.md
+++ b/libraries/radwordsprocessing/concepts/fields/section.md
@@ -27,7 +27,7 @@ Inserting a Section field is easily achieved through the [RadFlowDocumentEditor]
 
 __Example 1__ demonstrates how you can insert a section field.
          
-#### __[C#] Example 1: Insert section field__
+#### __Example 1: Insert section field__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/sectionpages-field.md b/libraries/radwordsprocessing/concepts/fields/sectionpages-field.md
index 4b8bdc06..95e9b7ee 100644
--- a/libraries/radwordsprocessing/concepts/fields/sectionpages-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/sectionpages-field.md
@@ -27,7 +27,7 @@ Inserting SectionPages field is easily achieved through the [RadFlowDocumentEdit
 
 __Example 1__ demonstrates how you can insert a SectionPages field.
  
-#### __[C#] Example 1: Insert SectionPages field__
+#### __Example 1: Insert SectionPages field__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/fields/sequence-field.md b/libraries/radwordsprocessing/concepts/fields/sequence-field.md
index 0c6bc953..7d8b25ba 100644
--- a/libraries/radwordsprocessing/concepts/fields/sequence-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/sequence-field.md
@@ -46,7 +46,7 @@ The possible switches for a Sequence field are:
 
 Inserting a SEQ fields can be easily achieved when inserting number to tables, figures, and other items in a document.
 
-#### __[C#] Example 1: Insert Sequence field__ using InsertField() method__
+#### __Example 1: Insert Sequence field__ using InsertField() method__
 
 The suggested approach for inserting code fields is by using [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}). The InsertField() method accepts code as a first argument and the result as a second argument.
 
diff --git a/libraries/radwordsprocessing/concepts/fields/ta-field.md b/libraries/radwordsprocessing/concepts/fields/ta-field.md
index 19210487..ad40df61 100644
--- a/libraries/radwordsprocessing/concepts/fields/ta-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/ta-field.md
@@ -38,7 +38,7 @@ Inserting this field is easily achieved through the [RadFlowDocumentEditor]({%sl
 __Example 1__ demonstrates how you can insert a TA field.
         
 
-#### __[C#] Example 1: Insert TA field__
+#### __Example 1: Insert TA field__
 
 

     var document = new RadFlowDocument();
diff --git a/libraries/radwordsprocessing/concepts/fields/tc-field.md b/libraries/radwordsprocessing/concepts/fields/tc-field.md
index 696b86d4..45057167 100644
--- a/libraries/radwordsprocessing/concepts/fields/tc-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/tc-field.md
@@ -38,7 +38,7 @@ Inserting this field is easily achieved through the [RadFlowDocumentEditor]({%sl
 __Example 1__ demonstrates how you can insert a TC field.
         
 
-#### __[C#] Example 1: Insert TC field__
+#### __Example 1: Insert TC field__
 
 
 

diff --git a/libraries/radwordsprocessing/concepts/fields/time-field.md b/libraries/radwordsprocessing/concepts/fields/time-field.md
index e9e7a379..4b1b6572 100644
--- a/libraries/radwordsprocessing/concepts/fields/time-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/time-field.md
@@ -38,7 +38,7 @@ Inserting a merge field is easily achieved through the [RadFlowDocumentEditor]({
 
 __Example 1__ demonstrates how you can insert a merge field.  
 
-#### __[C#] Example 1: Insert merge field__
+#### __Example 1: Insert merge field__
 
 
        
 	editor.InsertField("TIME \\@ \"h:mm:ss am/pm\"", "«to be updated»");
diff --git a/libraries/radwordsprocessing/concepts/fields/toa-field.md b/libraries/radwordsprocessing/concepts/fields/toa-field.md
index c28af8d5..bd88ac25 100644
--- a/libraries/radwordsprocessing/concepts/fields/toa-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/toa-field.md
@@ -40,7 +40,7 @@ Inserting this field is easily achieved through the [RadFlowDocumentEditor]({%sl
 __Example 1__ demonstrates how you can insert a TOA field.
         
 
-#### __[C#] Example 1: Insert TOA field__
+#### __Example 1: Insert TOA field__
 
 

     var document = new RadFlowDocument();
diff --git a/libraries/radwordsprocessing/concepts/fields/toc-field.md b/libraries/radwordsprocessing/concepts/fields/toc-field.md
index e9a9c13c..57f2818c 100644
--- a/libraries/radwordsprocessing/concepts/fields/toc-field.md
+++ b/libraries/radwordsprocessing/concepts/fields/toc-field.md
@@ -64,7 +64,7 @@ Inserting this field is easily achieved through the [RadFlowDocumentEditor]({%sl
 __Example 1__ demonstrates how you can insert a TOC field.
         
 
-#### __[C#] Example 1: Insert TOC field__
+#### __Example 1: Insert TOC field__
 
 

     var document = new RadFlowDocument();
diff --git a/libraries/radwordsprocessing/concepts/lists.md b/libraries/radwordsprocessing/concepts/lists.md
index d5aa5716..61137c32 100644
--- a/libraries/radwordsprocessing/concepts/lists.md
+++ b/libraries/radwordsprocessing/concepts/lists.md
@@ -98,7 +98,7 @@ In order to add one of the list templates to the document, you need to pass a __
 __Example 1__ adds a default bulleted list to a predefined RadFlowDocument.
         
 
-#### __[C#] Example 1: Add list template__
+#### __Example 1: Add list template__
 
 
 
@@ -112,7 +112,7 @@ The next tutorial will get you through the creation of a list.
 1. Define a new __RadFlowDocument__ and add a __Section__ in it.
             
 
-	#### __[C#] Step 1: Create RadFlowDocument__
+	#### __Step 1: Create RadFlowDocument__
 	
 	
 
@@ -121,7 +121,7 @@ The next tutorial will get you through the creation of a list.
 1. Create a __List__ object and associate it with the document by adding it to the __Lists__ collection.
             
 
-	#### __[C#] Step 2: Create list__
+	#### __Step 2: Create list__
 	
 	
 	
@@ -131,7 +131,7 @@ The next tutorial will get you through the creation of a list.
 1. Iterate over the collection of __Levels__ the list has.
             
 
-	#### __[C#] Step 3: Iterate levels__
+	#### __Step 3: Iterate levels__
 	
 	
 
@@ -140,7 +140,7 @@ The next tutorial will get you through the creation of a list.
 1. Specify some properties for each level.
             
 
-	#### __[C#] Step 4: Customize list levels__
+	#### __Step 4: Customize list levels__
 	
 	
 	
@@ -155,7 +155,7 @@ The tutorial in the [previous section](#create-a-list) demonstrates how you can
 __Example 6__ demonstrates how you can apply the list created in Steps 1-4 above.
         
 
-#### __[C#] Example 6: Apply list__
+#### __Example 6: Apply list__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/style-properties.md b/libraries/radwordsprocessing/concepts/style-properties.md
index d679938f..b6c66afb 100644
--- a/libraries/radwordsprocessing/concepts/style-properties.md
+++ b/libraries/radwordsprocessing/concepts/style-properties.md
@@ -73,7 +73,7 @@ Document elements expose sets of style properties through the __Properties__ pro
 __Example 1__ is an example for equivalent getting of a value with CLR property and style property.
             
 
-#### __[C#] Example 1: Get a value__
+#### __Example 1: Get a value__
 
 
 
@@ -81,7 +81,7 @@ __Example 1__ is an example for equivalent getting of a value with CLR property
 __Example 2__ is an example for an equivalent setting of a value with CLR property and style property.
             
 
-#### __[C#] Example 2: Set a value__
+#### __Example 2: Set a value__
 
 
 
@@ -95,7 +95,7 @@ The style properties in a style are accessible through the following property se
 __Example 3__ illustrates how to get the local value of a style property in a style.
             
 
-#### __[C#] Example 3: Get the local value__
+#### __Example 3: Get the local value__
 
 
 
@@ -104,7 +104,7 @@ __Example 3__ illustrates how to get the local value of a style property in a st
 __Example 4__ shows how to get the actual value of style property in style.
             
 
-#### __[C#] Example 4: Get the actual value__
+#### __Example 4: Get the actual value__
 
 
 
@@ -118,7 +118,7 @@ The default values of all style properties are available in their [StyleProperty
 The code in __Example 5__ illustrates how to get the default value for a style property.
         
 
-#### __[C#] Example 5: Get the default value__
+#### __Example 5: Get the default value__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/styles.md b/libraries/radwordsprocessing/concepts/styles.md
index d5ef1526..8321ea81 100644
--- a/libraries/radwordsprocessing/concepts/styles.md
+++ b/libraries/radwordsprocessing/concepts/styles.md
@@ -71,7 +71,7 @@ A style can contain one or more of five different sets of style properties, depe
 A style should be added to __RadFlowDocument__'s style repository in order to be further applied to elements and participate in style properties evaluation process. For example, the code from __Example 1__ creates a table style and adds it to the style repository.
         
 
-#### __[C#] Example 1: Create a table style and add it to the style repository__
+#### __Example 1: Create a table style and add it to the style repository__
 
 
 
@@ -80,7 +80,7 @@ A style should be added to __RadFlowDocument__'s style repository in order to be
 
 To apply a style to a spesific element you neet to set its __StyleId__ proerty.
 
-#### __[C#] Example 2: Apply a custom style to an element__
+#### __Example 2: Apply a custom style to an element__
 
 
 
@@ -99,7 +99,7 @@ Default style is a style which, according to its style type, is applied to objec
 
  You can change the default styling properties for a document through the DefaultStyle property of RadFlowDocument. **Example 3** shows how you can do that for the font-family, and similar code can be used for the other styling properties for the runs and paragraphs inside a document.
           
-#### __[C#] Example 3: Set a default font-family__
+#### __Example 3: Set a default font-family__
 
 
 
@@ -112,7 +112,7 @@ Built-in styles are commonly used styles, which are predefined for convenience.
 [BuiltInStyleNames](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Flow.Model.Styles.BuiltInStyleNames.html) static class contains properties and methods for getting the IDs of all built-in styles. __Example 4__ shows how to get the ID of the "Heading 1" built-in style.
         
 
-#### __[C#] Example 4: Get the ID of a built-in style__
+#### __Example 4: Get the ID of a built-in style__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/tabstop.md b/libraries/radwordsprocessing/concepts/tabstop.md
index 678b1d82..61ace331 100644
--- a/libraries/radwordsprocessing/concepts/tabstop.md
+++ b/libraries/radwordsprocessing/concepts/tabstop.md
@@ -57,7 +57,7 @@ The __TabStopCollection__ class exposes the following members:
 Excluding the default constructor, the __TabStopCollection__ class exposes an overload allowing you to directly pass a collection of __TabStop__ objects:
 
 
-#### __[C#] Example 1: Create a TabStopCollection__
+#### __Example 1: Create a TabStopCollection__
 
 
 
@@ -66,7 +66,7 @@ Excluding the default constructor, the __TabStopCollection__ class exposes an ov
 
 In __Example 2__ is illustrated how to insert items in the __TabStopCollection__ created in [Example 1](#example1). Keep in mind that due to the fact that this collection is immutable, the __Insert()__ method will return a **new instance** of the class.
 
-#### __[C#] Example 2: Insert item in a TabStopCollection__
+#### __Example 2: Insert item in a TabStopCollection__
 
 
 
@@ -74,7 +74,7 @@ In __Example 2__ is illustrated how to insert items in the __TabStopCollection__
 
 The snippet below shows how to remove an item from the __TabStopCollection__ created in [Example 1](#example1). Keep in mind that due to the fact that this collection is immutable, the Remove() method will return new instance of the class.
 
-#### __[C#] Example 3: Remove item from a TabStopCollection__
+#### __Example 3: Remove item from a TabStopCollection__
 
 
 
@@ -88,7 +88,7 @@ In __RadWordsProcessing__ the tab stops are stored as a collection in the [Parag
 The code from __Example 4__ demonstrates how to create a tab stop.
 
 
-#### __[C#] Example 4: Create a TabStop__
+#### __Example 4: Create a TabStop__
 
 
 
@@ -96,7 +96,7 @@ The code from __Example 4__ demonstrates how to create a tab stop.
 
 __Example 5__ shows how to add the tab stop created in [Example 1](#example1) to an existing __Paragraph__ through the _TabStops_ property of type __TabStopCollection__.
 
-#### __[C#] Example 5: Insert a TabStop__
+#### __Example 5: Insert a TabStop__
 
 
 
@@ -104,7 +104,7 @@ __Example 5__ shows how to add the tab stop created in [Example 1](#example1) to
 
 The following code-snippet illustrates how to remove the created in [Example 4](#example4) TabStop:
 
-#### __[C#] Example 6: Remove a TabStop__
+#### __Example 6: Remove a TabStop__
 
 
 
@@ -112,7 +112,7 @@ The following code-snippet illustrates how to remove the created in [Example 4](
 
 Once you have applied the desired tab stops to a paragraph, you need to insert tabs (\t) so that the content can be aligned to the specified tab stops. The code in **Example 7** inserts tab stops at three positions with different properties and aligns three words on the tab stop positions using tabs.
 
-#### __[C#] Example 7: Add tabs to align to the tab stops__
+#### __Example 7: Add tabs to align to the tab stops__
 
 
 
diff --git a/libraries/radwordsprocessing/concepts/watermark.md b/libraries/radwordsprocessing/concepts/watermark.md
index c93fd1b8..a1cd0c17 100644
--- a/libraries/radwordsprocessing/concepts/watermark.md
+++ b/libraries/radwordsprocessing/concepts/watermark.md
@@ -41,7 +41,7 @@ Creating a watermark through the constructor of the class requires to pass as a
 __Example 1__ demonstrates the creation of a text watermark.
 
 
-#### __[C#] Example 1: Create text watermark__
+#### __Example 1: Create text watermark__
 
 
 
@@ -49,7 +49,7 @@ __Example 1__ demonstrates the creation of a text watermark.
 Creating image watermark is very similar to creating a text one. __Example 2__ shows how to create an image watermark.
 
 
-#### __[C#] Example 2: Create image watermark__
+#### __Example 2: Create image watermark__
 
 
 
@@ -62,7 +62,7 @@ Watermarks are preserved in the header of the section to which the watermark is
 
 __Example 3__ demonstrates how you can add the watermark created in __Example 1__ to a __RadFlowDocument__ by creating a __Header__ for its first __Section__.
 
-#### __[C#] Example 3: Add watermark to header__
+#### __Example 3: Add watermark to header__
 
 
 
@@ -74,7 +74,7 @@ There is another way to set a watermark in a document - through the [RadFlowDocu
 __Example 4__ demonstrates how to set the watermark created in __Example 2__ through __RadFlowDocumentEditor__ to the first page of a section. The method will create the __Header__ element for you, and you only need to specify its type.
 
 
-#### __[C#] Example 4: Set watermark with RadFlowDocumentEditor__
+#### __Example 4: Set watermark with RadFlowDocumentEditor__
 
 
 
diff --git a/libraries/radwordsprocessing/editing/clone-and-merge.md b/libraries/radwordsprocessing/editing/clone-and-merge.md
index e7eed7e3..75fd71e8 100644
--- a/libraries/radwordsprocessing/editing/clone-and-merge.md
+++ b/libraries/radwordsprocessing/editing/clone-and-merge.md
@@ -24,7 +24,7 @@ position: 0
 __RadWordsProcessing__ allows you to merge two __RadFlowDocument__ instance using the __Merge()__ method overloads. The document to which you wish to add content is called *target* and the document from which you wish to take the content is called *source*.
         
 
-#### __[C#] Example 1: Merge two instances of RadFlowDocument__
+#### __Example 1: Merge two instances of RadFlowDocument__
 
 
 
@@ -50,7 +50,7 @@ The __MergeOptions__ parameter can be passed as an argument to the __Merge()__ m
 __Example 2__ shows how to merge documents by specifying the __MergeOptions__ parameter.
         
 
-#### __[C#] Example 2: Merge documents with MergeOptions__
+#### __Example 2: Merge documents with MergeOptions__
 
 
 
@@ -62,7 +62,7 @@ __Example 2__ shows how to merge documents by specifying the __MergeOptions__ pa
 __RadFlowDocument__ provides a __Clone()__ method, which creates a deep copy of the whole document structure, including all document elements and styles:
         
 
-#### __[C#] Example 3: Clone a RadFlowDocument__
+#### __Example 3: Clone a RadFlowDocument__
 
 
 
@@ -90,7 +90,7 @@ The __Clone()__ method has two overloads:
 * __Clone(RadFlowDocument)__: Creates a deep copy of the element and associates it with the provided __RadFlowDocument__. This allows cloned elements to be added to the element tree of the provided RadFlowDocument at a later time and is convenient if you want to "move" an element from one document to another.
             
 
-#### __[C#] Example 4: Clone a section__
+#### __Example 4: Clone a section__
 
 
 
diff --git a/libraries/radwordsprocessing/editing/find-and-replace/find-and-replace-text.md b/libraries/radwordsprocessing/editing/find-and-replace/find-and-replace-text.md
index 55ed9b9b..a28437c1 100644
--- a/libraries/radwordsprocessing/editing/find-and-replace/find-and-replace-text.md
+++ b/libraries/radwordsprocessing/editing/find-and-replace/find-and-replace-text.md
@@ -35,7 +35,7 @@ Both methods return a collection of **FindResult** instances, which in turn expo
 
 **Example 1** shows how to create a **RadFlowDocumentEditor** instance and use it to find all matches of the word "code".
 
-#### **[C#] Example 1: Find text**
+#### **Example 1: Find text**
 
 
 
@@ -52,7 +52,7 @@ To find all instances of a string and replace it with another one, you can use t
 **Example 2** shows how to create a **RadFlowDocumentEditor** instance and use it to replace all matches of the word "code" with the phrase "source code".
 
 
-#### **[C#] Example 2: Replace text**
+#### **Example 2: Replace text**
 
 
 
@@ -72,7 +72,7 @@ __RadFlowDocumentEditor__ gives you the ability to format all occurrences of a s
 **Example 3** shows how to apply a red highlight color to all occurrences of the word "alert".
 
 
-#### **[C#] Example 3: Replace character properties**
+#### **Example 3: Replace character properties**
 
 
 
diff --git a/libraries/radwordsprocessing/editing/find-and-replace/replace-document-elements.md b/libraries/radwordsprocessing/editing/find-and-replace/replace-document-elements.md
index 0c297c6a..2db0f2d3 100644
--- a/libraries/radwordsprocessing/editing/find-and-replace/replace-document-elements.md
+++ b/libraries/radwordsprocessing/editing/find-and-replace/replace-document-elements.md
@@ -26,11 +26,11 @@ You can search and replace text  using [RadFlowDocumentEditor]({%slug radwordspr
 * __ReplaceText(Regex regex, InlineBase inline):__ Replaces all matches of the passed **Regex** with a single inline. 
 * __ReplaceText(Regex regex, IEnumerable\ inlines):__ Replaces all matches of the passed **Regex** with multiple inlines. 
 
-#### __[C#] Example 1: Replace text with a single inline__
+#### __Example 1: Replace text with a single inline__
 
 
 
-#### __[C#] Example 2: Replace text with multiple inlines__
+#### __Example 2: Replace text with multiple inlines__
 
 
 
@@ -41,11 +41,11 @@ You can search and replace text  using [RadFlowDocumentEditor]({%slug radwordspr
 * __ReplaceText(Regex regex, BlockBase block):__ Replaces all matches of the passed **Regex** with a single block. 
 * __ReplaceText(Regex regex, IEnumerable\ blocks):__ Replaces all matches of the passed **Regex** with multiple blocks. 
 
-#### __[C#] Example 3: Replace text with a single block__
+#### __Example 3: Replace text with a single block__
 
 
 
-#### **[C#] Example 4: Replace text with multiple blocks**
+#### **Example 4: Replace text with multiple blocks**
 
 
 
diff --git a/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/complete-context-question-processor.md b/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/complete-context-question-processor.md
index 73ed872f..6374bfa8 100644
--- a/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/complete-context-question-processor.md
+++ b/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/complete-context-question-processor.md
@@ -56,7 +56,7 @@ The **CompleteContextProcessorSettings** class defines configuration options for
 
 The following example demonstrates how to use the **CompleteContextQuestionProcessor** to ask questions about a Word document, including working with specific document pages. For setting up the AI client as shown in this example, see the [AI Provider Setup]({%slug radwordsprocessing-features-gen-ai-powered-document-insights-prerequisites%}#ai-provider-setup) section:
 
-#### __[C#] Example 1: Using CompleteContextQuestionProcessor__
+#### __Example 1: Using CompleteContextQuestionProcessor__
 
 
 
diff --git a/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/getting-started.md b/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/getting-started.md
index 86bb9076..8bb5b7e3 100644
--- a/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/getting-started.md
+++ b/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/getting-started.md
@@ -16,7 +16,7 @@ The following example demonstrates how to use the GenAI-powered Document Insight
 
 >important For .NET {{site.mindotnetversion}}+ (Target OS Windows) with [Packages for .NET {{site.mindotnetversion}} and .NET {{site.maxdotnetversion}} for Windows]({%slug available-nuget-packages%}#packages-for-net-framework-and-net-{{site.mindotnetversion}}-and-net-{{site.maxdotnetversion}}-for-windows), an [IEmbedder]({%slug radwordsprocessing-features-gen-ai-powered-document-insights-partial-context-question-processor%}#implementing-custom-iembedder) implementation is required for the [PartialContextQuestionProcessor]({%slug radwordsprocessing-features-gen-ai-powered-document-insights-partial-context-question-processor%}).
 
-#### __[C#] Example 1: Using GenAI-powered Document Insights__
+#### __Example 1: Using GenAI-powered Document Insights__
 
 
 
diff --git a/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/prerequisites.md b/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/prerequisites.md
index 0d3fad1f..9e641a38 100644
--- a/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/prerequisites.md
+++ b/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/prerequisites.md
@@ -69,7 +69,7 @@ Before using the GenAI-powered Document Insights functionality, you need to set
 
 >caution The following code snippet is valid for Microsoft.Extensions.AI.OpenAI 9.3. The specific **IChatClient** initialization may be different according to the specific version.
 
-#### __[C#] Example 1: Setting up Azure OpenAI__
+#### __Example 1: Setting up Azure OpenAI__
 
 
 
@@ -78,7 +78,7 @@ Before using the GenAI-powered Document Insights functionality, you need to set
 1. Create an OpenAI account.
 2. Get your API key from the OpenAI dashboard.
 
-#### __[C#] Example 2: Setting up OpenAI__
+#### __Example 2: Setting up OpenAI__
 
 
 
@@ -90,7 +90,7 @@ Ollama allows you to run AI models locally on your machine. This is useful for d
 2. Pull the model you want to use.
 3. Start the Ollama server.
 
-#### __[C#] Example 3: Setting up Ollama__
+#### __Example 3: Setting up Ollama__
 
 
 
diff --git a/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/summarization-processor.md b/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/summarization-processor.md
index ec70c351..ac179306 100644
--- a/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/summarization-processor.md
+++ b/libraries/radwordsprocessing/editing/gen-ai-powered-document-insights/summarization-processor.md
@@ -46,7 +46,7 @@ The **SummarizationProcessorSettings** class defines configuration options for t
 * **ModelMaxInputTokenLimit**: The maximum input token limit for the model.
 * **PromptAddition**: An addition for the prompt used for summarization. It can be used for clarification purposes.
 
-#### __[C#] Example 1: Configuring SummarizationProcessorSettings__
+#### __Example 1: Configuring SummarizationProcessorSettings__
 
 
 
@@ -64,7 +64,7 @@ For large documents that exceed the token limit of the model, **SummarizationPro
 
 This approach allows the processor to efficiently handle documents of any size, but it increases the number of API calls required. The **SummaryResourcesCalculated** event provides information about the expected resource usage, allowing you to decide whether to proceed with the operation.
 
-#### __[C#] Example 2: Using SummarizationProcessor__
+#### __Example 2: Using SummarizationProcessor__
 
 
 
diff --git a/libraries/radwordsprocessing/editing/import-document-element.md b/libraries/radwordsprocessing/editing/import-document-element.md
index 9be855e4..0503990c 100644
--- a/libraries/radwordsprocessing/editing/import-document-element.md
+++ b/libraries/radwordsprocessing/editing/import-document-element.md
@@ -26,7 +26,7 @@ The constructor of the **DocumentElementImporter** class accepts three parameter
 * **conflictingStylesResolutionMode**: Represents the resolution mode, which will be used if a style conflict appears during the style repositories merging. Could be set to one of the values of the [ConflictingStylesResolutionMode enumeration]( https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Flow.Model.ConflictingStylesResolutionMode.html).
 
 
-#### __[C#] Example 1: Create DocumentElementImporter__
+#### __Example 1: Create DocumentElementImporter__
 
 
 
@@ -36,7 +36,7 @@ The constructor of the **DocumentElementImporter** class accepts three parameter
 
 The **DocumentElementImporter** class exposes the Import<T>() method, which is used to prepare a document element from the source document for import into the target document. **Example 2** demonstrates how you could work with this method, using the **DocumentElementImporter** instance, created in [Example 1](#example1).
 
-#### __[C#] Example 2: Import a document element__
+#### __Example 2: Import a document element__
 
 
 
diff --git a/libraries/radwordsprocessing/editing/insert-documents.md b/libraries/radwordsprocessing/editing/insert-documents.md
index 19ee95f7..68b5670b 100644
--- a/libraries/radwordsprocessing/editing/insert-documents.md
+++ b/libraries/radwordsprocessing/editing/insert-documents.md
@@ -29,7 +29,7 @@ You could merge documents at a specific position using the InsertDocument() meth
 
 **Example 1** demonstrates how to use the InsertDocument() method.
 
-#### __[C#] Example 1: Insert source document into target document__
+#### __Example 1: Insert source document into target document__
 
 
 
diff --git a/libraries/radwordsprocessing/editing/mail-merge.md b/libraries/radwordsprocessing/editing/mail-merge.md
index 70316022..34a6b2e4 100644
--- a/libraries/radwordsprocessing/editing/mail-merge.md
+++ b/libraries/radwordsprocessing/editing/mail-merge.md
@@ -20,7 +20,7 @@ Merge fields are a type of [Fields]({%slug radwordsprocessing-concepts-fields%})
 The code snippet in __Example 1__ shows how to initialize a RadFlodDocumentEditor instance and insert a merge field.
         
 
-#### __[C#] Example 1: Insert a merge field__
+#### __Example 1: Insert a merge field__
 
 
 
@@ -29,7 +29,7 @@ The code snippet in __Example 1__ shows how to initialize a RadFlodDocumentEdito
 Additionally, a field can be added to a Paragraph manually by creating a __FieldInfo__ instance and placing its start, code, separator, result and end in the block. __Example 2__ shows the manual approach for adding a merge field.
         
 
-#### __[C#] Example 2: Add a merge field manually__
+#### __Example 2: Add a merge field manually__
 
 
 
@@ -46,7 +46,7 @@ During the operation, each MergeField is replaced with the corresponding informa
 Example 3 shows a simple example data source.
         
 
-#### __[C#] Example 3: Sample data source__
+#### __Example 3: Sample data source__
 
 
 
@@ -55,7 +55,7 @@ Example 3 shows a simple example data source.
 __Example 4__ performs the mail merge operation over a previously defined template document using the data source from __Example 3__.
         
 
-#### __[C#] Example 4: Perform mail merge__
+#### __Example 4: Perform mail merge__
 
 
 
@@ -84,13 +84,13 @@ The following example demonstrates how you can use the nested mail merge:
 
 First you need to define a data source that contains an `IEnumerable` of objects.
 
-#### __[C#] Example 5: Nested mail merge data source__
+#### __Example 5: Nested mail merge data source__
 
 
 
 Now you need to add the fields using the specific supported names. In this example, we are adding the fields to the table and we will use the TableStart/TableEnd tags, but this is not mandatory and you can use a tag of your choosing.
 
-#### __[C#] Example 6: Perform nested mail merge__
+#### __Example 6: Perform nested mail merge__
 
 
 
diff --git a/libraries/radwordsprocessing/editing/radflowdocumenteditor.md b/libraries/radwordsprocessing/editing/radflowdocumenteditor.md
index 8a31df2d..851934eb 100644
--- a/libraries/radwordsprocessing/editing/radflowdocumenteditor.md
+++ b/libraries/radwordsprocessing/editing/radflowdocumenteditor.md
@@ -26,7 +26,7 @@ Although __RadFlowDocument__ can be created and modified by using the style prop
 __RadFlowDocumentEditor__ is always associated with a single document, which it takes as a constructor parameter when it is created.
         
 
-#### __[C#] Example 1: Create a RadFlowDocumentEditor__
+#### __Example 1: Create a RadFlowDocumentEditor__
 
 
 
@@ -46,14 +46,14 @@ The editor maintains an internal position inside the document. This position poi
 The code from __Example 2__ demonstrates how to position the editor after the second inline in the first paragraph of the document.
         
 
-#### __[C#] Example 2: Changing the position of RadFlowDocumentEditor__
+#### __Example 2: Changing the position of RadFlowDocumentEditor__
 
 
 
 Note that it is possible to create a __RadFlowDocumentEditor__ for an empty document (one with no sections). In this case, a section and a paragraph are automatically created when you call an insert method. __Example 3__ creates a document with one section, containing one paragraph with the text "Hello word!".
         
 
-#### __[C#] Example 3: Insert text in a document__
+#### __Example 3: Insert text in a document__
 
 
 
@@ -74,7 +74,7 @@ Both methods return the newly inserted __Run__ element. If, however, there are n
 The code in __Example 4__ inserts a run containing a new line.
             
 
-#### __[C#] Example 4: Insert a run with a new line__
+#### __Example 4: Insert a run with a new line__
 
 
 
@@ -91,7 +91,7 @@ The result looks like __Figure 1__ shows.
 You can start a new [Paragraph]({%slug radwordsprocessing-model-paragraph%}) with the __InsertParagraph()__ method. The current __ParagraphFormatting__ is applied to the new paragraph and the paragraph is returned.
             
 
-#### __[C#] Example 5: Insert a paragraph__
+#### __Example 5: Insert a paragraph__
 
 
 
@@ -106,7 +106,7 @@ If you call __InsertParagraph()__ method while the editor is positioned in the m
 
 Inserting [Section]({%slug radwordsprocessing-model-section%}) elements can be achieved with the __InsertSection()__ method. A paragraph with the new section’s properties will be added and the new __Section__ element will be returned.
 
-#### __[C#] Example 6: Insert a section__
+#### __Example 6: Insert a section__
 
 
 >If you call the __InsertSection()__ method while the editor is positioned in a TableCell, the Table will be split at the current row. This means that if the table contains 3 rows, and the editor is positioned in a cell which is on the second row, the table will be split into two tables – one with one row, which will be added to the previous section and one with 2 rows (containing the TableCell where the editor position was). The later will be added to the newly inserted Section.
@@ -120,7 +120,7 @@ public Hyperlink InsertHyperlink(string text, string uri, bool isAnchor, string
 It automatically applies "Hyperlink" built-in style to the inserted hyperlink if there is no explicitly set style in the __CharacterFormatting__ options of the editor.
             
 
-#### __[C#] Example 7: Insert a hyperlink__
+#### __Example 7: Insert a hyperlink__
 
 
 
@@ -136,7 +136,7 @@ public Field InsertField(string code, string result)
 __Example 8__ shows how to add page numbering in the header of a document:
             
 
-#### __[C#] Example 8: Add page numbering in a header__
+#### __Example 8: Add page numbering in a header__
 
 
 
@@ -166,7 +166,7 @@ __RadFlowDocumentEditor__ provides several methods for inserting [ImageInline]({
 __Example 9__ shows how an image can be inserted using a stream:
             
 
-#### __[C#] Example 9: Insert an image from a Stream__
+#### __Example 9: Insert an image from a Stream__
 
 
 
@@ -190,7 +190,7 @@ The following methods can be used to insert [Table]({%slug radwordsprocessing-mo
 Here is how to insert a table with the "TableGrid" built-in style:
             
 
-#### __[C#] Example 10: Insert a table with a style__
+#### __Example 10: Insert a table with a style__
 
 
 
@@ -218,7 +218,7 @@ When you use the insert methods of the __RadFlowDocumentEditor__ the editor crea
 Formatting options are most useful when inserting multiple elements that should have consistent styling. For example, the code  from __Example 11__ inserts multiple paragraphs with no spacing between them and with text (Runs) in "Consolas" font:
         
 
-#### __[C#] Example 11: Insert content with specified styles__
+#### __Example 11: Insert content with specified styles__
 
 
 
@@ -228,7 +228,7 @@ Formatting options are most useful when inserting multiple elements that should
 
 ## Deleting Content
 
-#### __[C#] Example 12: Delete content between existing elements__
+#### __Example 12: Delete content between existing elements__
 
 
 
diff --git a/libraries/radwordsprocessing/formats-and-conversion/html/htmlformatprovider.md b/libraries/radwordsprocessing/formats-and-conversion/html/htmlformatprovider.md
index 76286f25..7a7ab0cf 100644
--- a/libraries/radwordsprocessing/formats-and-conversion/html/htmlformatprovider.md
+++ b/libraries/radwordsprocessing/formats-and-conversion/html/htmlformatprovider.md
@@ -26,7 +26,7 @@ In order to import an HTML document you can use the overloads of the __HtmlForma
 __Example 1__ shows how to use HtmlFormatProvider to import an HTML document from a file.
         
 
-#### __[C#] Example 1: Import HTML file__
+#### __Example 1: Import HTML file__
 
 
 
@@ -35,7 +35,7 @@ __Example 1__ shows how to use HtmlFormatProvider to import an HTML document fro
 __Example 2__ shows how you can import an HTML string.
         
 
-#### __[C#] Example 2: Import HTML string__
+#### __Example 2: Import HTML string__
 
 
 
@@ -52,7 +52,7 @@ In order to export a document to HTML you can use the overloads of the __HtmlFor
 __Example 3__ shows how to use the HtmlFormatProvider to export an instance of RadFlowDocument to a file:
         
 
-#### __[C#] Example 3: Export HTML to file__
+#### __Example 3: Export HTML to file__
 
 
 
@@ -61,7 +61,7 @@ __Example 3__ shows how to use the HtmlFormatProvider to export an instance of R
 You can also export the document to a string variable like shown in __Example 4__.
         
 
-#### __[C#] Example 4: Export HTML to string__
+#### __Example 4: Export HTML to string__
 
 
 
diff --git a/libraries/radwordsprocessing/formats-and-conversion/html/settings.md b/libraries/radwordsprocessing/formats-and-conversion/html/settings.md
index c055e49c..965da1c9 100644
--- a/libraries/radwordsprocessing/formats-and-conversion/html/settings.md
+++ b/libraries/radwordsprocessing/formats-and-conversion/html/settings.md
@@ -34,7 +34,7 @@ The default value, for example, specifies that "b" elements should be imported w
 
 You can set the value of the property to any valid CSS document. **Example 1** shows how you can add styling in addition to the default ones. 
 
-#### [C#] Example 1: Add CSS to the DefaultStyleSheet
+#### Example 1: Add CSS to the DefaultStyleSheet
 
           
 
@@ -55,7 +55,7 @@ The __LoadImageFromUri__ event uses the __LoadImageFromUriEventArgs__ object whi
 
 __Example 2__ Shows how you can use the __LoadImageFromUri__ event to download an image.
 
-#### __[C#] Example 2: Use the LoadImageFromUri__
+#### __Example 2: Use the LoadImageFromUri__
 
 
 The __LoadStyleSheetFromUri__ event uses the __LoadStyleSheetFromUriEventArgs__ object which exposes the following properties: 
@@ -65,7 +65,7 @@ The __LoadStyleSheetFromUri__ event uses the __LoadStyleSheetFromUriEventArgs__
 
 __Example 3__ Shows how you can use the __LoadStyleSheetFromUri__ event.
             
-#### __[C#] Example 3: Use the LoadStyleSheetFromUri event__
+#### __Example 3: Use the LoadStyleSheetFromUri event__
 
 
 ## UriImageSource Class
@@ -85,7 +85,7 @@ When importing HTML, which contains images with URI source, the **HtmlFormatProv
 
 The **UriImageSource** objects are always exported as images with URI as their source independently of the export settings. If you need to export this object as an embedded or external image, you could convert the **UriImageSource** to **ImageSource** object. 
 
-#### __[C#] Example 4: Convert UriImageSource to ImageSource__
+#### __Example 4: Convert UriImageSource to ImageSource__
 
 
 
@@ -203,7 +203,7 @@ The event is only raised when the __StylesExportMode__ property is set to __Exte
 __Example 5__ demonstrates how you can create export settings.
             
 
-#### __[C#] Example 5: Create HtmlExportSettings__
+#### __Example 5: Create HtmlExportSettings__
 
 
 
diff --git a/libraries/radwordsprocessing/formats-and-conversion/pdf/pdfformatprovider.md b/libraries/radwordsprocessing/formats-and-conversion/pdf/pdfformatprovider.md
index 73e8d3ab..6a53fc5e 100644
--- a/libraries/radwordsprocessing/formats-and-conversion/pdf/pdfformatprovider.md
+++ b/libraries/radwordsprocessing/formats-and-conversion/pdf/pdfformatprovider.md
@@ -32,7 +32,7 @@ The code snippet in __Example 1__ shows how to create a __PdfFormatProvider__ in
         
 >The PdfFormatProvider class of RadWordsProcessing is located in the **Telerik.Windows.Documents.Flow.FormatProviders.Pdf namespace**.
 
-#### __[C#] Example 1: Export to PDF file__
+#### __Example 1: Export to PDF file__
 
 
 
@@ -42,7 +42,7 @@ The result from the method is a document that can be opened in any application t
 __Example 2__ demonstrates how to export the contents of a __RadFlowDocument__ to a __RadFIxedDocument__. 
 
 
-#### __[C#] Example 2: Export to RadFixedDocument__
+#### __Example 2: Export to RadFixedDocument__
 
 
 
diff --git a/libraries/radwordsprocessing/formats-and-conversion/pdf/settings.md b/libraries/radwordsprocessing/formats-and-conversion/pdf/settings.md
index b2eb812e..3f732503 100644
--- a/libraries/radwordsprocessing/formats-and-conversion/pdf/settings.md
+++ b/libraries/radwordsprocessing/formats-and-conversion/pdf/settings.md
@@ -19,7 +19,7 @@ __Example 1__ demonstrates how to export a __RadFlowDocument__ instance to PDF a
 
 >tipIn order to specify export settings to the PdfFormatProvider you need to add both the Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export and Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export namespaces. In __Example 1__ the *Fixed* alias corresponds to the *Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export* namespace.
 
-#### __[C#] Example 1: Export PDF/A compliant document__
+#### __Example 1: Export PDF/A compliant document__
 
 
 
@@ -34,7 +34,7 @@ ExtensibilityManager provides an option to control how lists with different __Nu
 __Example 2__ shows how to register a custom *ChineseCountingConverter* class instance that converts a number with NumberingStyle.ChineseCounting.
 
 
-#### __[C#] Example 2: Register numbering style converter__
+#### __Example 2: Register numbering style converter__
 
 
 
diff --git a/libraries/radwordsprocessing/formats-and-conversion/plain-text/txt-txtformatprovider.md b/libraries/radwordsprocessing/formats-and-conversion/plain-text/txt-txtformatprovider.md
index 75ba03ef..0f110228 100644
--- a/libraries/radwordsprocessing/formats-and-conversion/plain-text/txt-txtformatprovider.md
+++ b/libraries/radwordsprocessing/formats-and-conversion/plain-text/txt-txtformatprovider.md
@@ -29,7 +29,7 @@ In order to import a plain text document, you need to use the __Import()__ metho
 __Example 1__ shows how to use __TxtFormatProvider__ to import a document from a file.
         
 
-#### __[C#] Example 1: Import document from a file__
+#### __Example 1: Import document from a file__
 
 
 
@@ -38,7 +38,7 @@ __Example 1__ shows how to use __TxtFormatProvider__ to import a document from a
 And here is how you can import a document from string:
         
 
-#### __[C#] Example 2: Import document from a string__
+#### __Example 2: Import document from a string__
 
 
 
@@ -55,7 +55,7 @@ In order to export a document to plain text, you need to use the __Export()__ me
 __Example 3__ shows how to use __TxtFormatProvider__ to export __RadFlowDocument__ to a file.
         
 
-#### __[C#] Example 3: Export a document to a file__
+#### __Example 3: Export a document to a file__
 
 
 
@@ -64,7 +64,7 @@ __Example 3__ shows how to use __TxtFormatProvider__ to export __RadFlowDocument
 You can also export the document to a string and preserve it in a database.
         
 
-#### __[C#] Example 4: Export a document to a string__
+#### __Example 4: Export a document to a string__
 
 
 
diff --git a/libraries/radwordsprocessing/formats-and-conversion/rtf/rtfformatprovider.md b/libraries/radwordsprocessing/formats-and-conversion/rtf/rtfformatprovider.md
index 6b03ac7c..115b8789 100644
--- a/libraries/radwordsprocessing/formats-and-conversion/rtf/rtfformatprovider.md
+++ b/libraries/radwordsprocessing/formats-and-conversion/rtf/rtfformatprovider.md
@@ -29,7 +29,7 @@ In order to import an RTF document, you need to use the __Import()__ method of _
 The code from __Example 1__ shows how to use __RtfFormatProvider__ to import an RTF document from a file.
         
 
-#### __[C#] Example 1: Import document from a file__
+#### __Example 1: Import document from a file__
 
 
 
@@ -38,7 +38,7 @@ The code from __Example 1__ shows how to use __RtfFormatProvider__ to import an
 And here is how you can import a document from string containing the RTF document:
         
 
-#### __[C#] Example 2: Import document from a string__
+#### __Example 2: Import document from a string__
 
 
 
@@ -55,7 +55,7 @@ In order to export a document to RTF, you need to use the __Export()__ method of
 __Example 3__ shows how to use __RtfFormatProvider__ to export __RadFlowDocument__ to a file.
         
 
-#### __[C#] Example 3: Export a document to a file__
+#### __Example 3: Export a document to a file__
 
 
 
@@ -64,7 +64,7 @@ __Example 3__ shows how to use __RtfFormatProvider__ to export __RadFlowDocument
 You can also export the document to a string and preserve it in a database.
         
 
-#### __[C#] Example 4: Export a document to a string__
+#### __Example 4: Export a document to a string__
 
 
 
diff --git a/libraries/radwordsprocessing/formats-and-conversion/rtf/settings.md b/libraries/radwordsprocessing/formats-and-conversion/rtf/settings.md
index fcddb25f..88c4ea9a 100644
--- a/libraries/radwordsprocessing/formats-and-conversion/rtf/settings.md
+++ b/libraries/radwordsprocessing/formats-and-conversion/rtf/settings.md
@@ -29,7 +29,7 @@ The default value for this setting is __false__.
 The code from __Example 1__ demonstrates how you can create and specify particular export settings to RtfFormatProvider.
         
 
-#### __[C#] Example 1: Create a RtfExportSettings__
+#### __Example 1: Create a RtfExportSettings__
 
 
 
diff --git a/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/doc/docformatprovider.md b/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/doc/docformatprovider.md
index ce5a2868..23b23774 100644
--- a/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/doc/docformatprovider.md
+++ b/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/doc/docformatprovider.md
@@ -33,14 +33,14 @@ To use **DocFormatProvider**, you should add references to the packages listed b
 
 To import a DOC or DOT file, you should use the **Import()** method of **DocFormatProvider**.
 
-#### **[C#] Example 1: Import document from a file**
+#### **Example 1: Import document from a file**
 
 
 
 
 And here is how you can import a document from a byte array containing the document:
 
-#### **[C#] Example 2: Import document from a byte array**
+#### **Example 2: Import document from a byte array**
 
 
 
diff --git a/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx/docxformatprovider.md b/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx/docxformatprovider.md
index 894d5c2d..7c1d3166 100644
--- a/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx/docxformatprovider.md
+++ b/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx/docxformatprovider.md
@@ -34,7 +34,7 @@ In order to import a DOCX document, you need to use the __Import()__ method of _
 The code in __Example 1__ shows how to use __DocxFormatProvider__ to import a DOCX document from a file.
         
 
-#### __[C#] Example 1: Import document from a file__
+#### __Example 1: Import document from a file__
 
 
 
@@ -43,7 +43,7 @@ The code in __Example 1__ shows how to use __DocxFormatProvider__ to import a DO
 And here is how you can import a document from byte array containing the DOCX document:
         
 
-#### __[C#] Example 2: Import document from a byte array__
+#### __Example 2: Import document from a byte array__
 
 
 
@@ -58,14 +58,14 @@ In order to export a document to DOCX, you need to use the __Export()__ method o
 __Example 3__ shows how to use __DocxFormatProvider__ to export __RadFlowDocument__ to a file.
         
 
-#### __[C#] Example 3: Export a document to a file__
+#### __Example 3: Export a document to a file__
 
 
 
 You can also export the document to a byte array and preserve it in a database.
         
 
-#### __[C#] Example 4: Export a document to a byte array__
+#### __Example 4: Export a document to a byte array__
 
 
 The resulting documents can be opened in any application that supports DOCX documents.
diff --git a/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx/settings.md b/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx/settings.md
index d8869422..677e4189 100644
--- a/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx/settings.md
+++ b/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx/settings.md
@@ -40,7 +40,7 @@ The __AutoUpdateFields__ setting indicates if fields should be auto-updated when
 __Example 1__ shows how you can create and specify particular export settings to DocxFormatProvider.
         
 
-#### __[C#] Example 1: Create DocxExportSettings__
+#### __Example 1: Create DocxExportSettings__
 
 
 
diff --git a/libraries/radwordsprocessing/getting-started.md b/libraries/radwordsprocessing/getting-started.md
index 8285ec56..48a6bf1a 100644
--- a/libraries/radwordsprocessing/getting-started.md
+++ b/libraries/radwordsprocessing/getting-started.md
@@ -107,7 +107,7 @@ Here is a list of packages that contain the __RadWordsProcessing__ functionality
 Here is how to create a [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}) and insert some text content with the help of [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}).
         
 
-#### __[C#] Example 1: Create RadFlowDocument programmatically__
+#### __Example 1: Create RadFlowDocument programmatically__
 
 
 
@@ -125,7 +125,7 @@ You need to add using directive to the following namespaces:
 Exporting the document to Docx file can be achieved with the [DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%}). Here is how to create a provider instance and save a document with it:
         
 
-#### __[C#] Example 2: Export RadFlowDocument to Docx__
+#### __Example 2: Export RadFlowDocument to Docx__
 
 
 
diff --git a/libraries/radwordsprocessing/model/bookmark.md b/libraries/radwordsprocessing/model/bookmark.md
index e6be9b58..d8fb99e3 100644
--- a/libraries/radwordsprocessing/model/bookmark.md
+++ b/libraries/radwordsprocessing/model/bookmark.md
@@ -23,7 +23,7 @@ A __Bookmark__ refers to a location in the document and has a unique name, which
 __Example 1__ shows how to create a __Bookmark__ and add its BookmarkRangeStart and BookmarkRangeEnd elements in a [Paragraph]({%slug radwordsprocessing-model-paragraph%}):
         
 
-#### __[C#] Example 1: Add a bookmark to a paragraph__
+#### __Example 1: Add a bookmark to a paragraph__
 
 
 
@@ -35,7 +35,7 @@ Note, that the paragraph should belong to the same document that is passed to th
 Inserting a __Bookmark__ in the document can also be done with the [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}) class like shown in __Example 2__:
         
 
-#### __[C#] Example 2: Insert a bookmark using RadFlowDocumentEditor__
+#### __Example 2: Insert a bookmark using RadFlowDocumentEditor__
 
 
 
@@ -52,7 +52,7 @@ You can remove an inserted __Bookmark__ by using __RadFlowDocumentEditor__'s __D
 __Example 3__ demonstrates how you can delete the bookmark created in __Example 2__.
         
 
-#### __[C#] Example 3: Delete bookmark using RadFlowDocumentEditor__
+#### __Example 3: Delete bookmark using RadFlowDocumentEditor__
 
 
 
diff --git a/libraries/radwordsprocessing/model/break.md b/libraries/radwordsprocessing/model/break.md
index 7eafc14b..3ec552e0 100644
--- a/libraries/radwordsprocessing/model/break.md
+++ b/libraries/radwordsprocessing/model/break.md
@@ -31,7 +31,7 @@ All inline-level elements in a __RadFlowDocument__ need to be placed within anot
 __Example 1__ shows how to create a __Break__ element and add it to a [Paragraph]({%slug radwordsprocessing-model-paragraph%}).
         
 
-#### __[C#] Example 1: Create break__
+#### __Example 1: Create break__
 
 
 
@@ -43,7 +43,7 @@ Note, that the paragraph should belong to the same document that is passed to th
 __Example 2__ shows how you can change the type of the break created in __Example 1__.
         
 
-#### __[C#] Example 2: Change BreakType__
+#### __Example 2: Change BreakType__
 
 
 
@@ -55,7 +55,7 @@ Inserting a break in the document can also be done with the __InsertBreak()__ me
 __Example 3__ shows how you can insert a break through __RadFlowDocumentEditor__.
         
 
-#### __[C#] Example 3: Insert break using RadFlowDocumentEditor__
+#### __Example 3: Insert break using RadFlowDocumentEditor__
 
 
 
@@ -81,7 +81,7 @@ The __Break__ element exposes several properties that allow you to customize it.
 __Example 4__ shows how you can insert a Break through __RadFlowDocumentEditor__ and modify it later.
         
 
-#### __[C#] Example 4: Customize a break__
+#### __Example 4: Customize a break__
 
 
 
diff --git a/libraries/radwordsprocessing/model/comment.md b/libraries/radwordsprocessing/model/comment.md
index e4427980..1b7e49b4 100644
--- a/libraries/radwordsprocessing/model/comment.md
+++ b/libraries/radwordsprocessing/model/comment.md
@@ -23,7 +23,7 @@ A __Comment__ holds annotation markers, which specify for which range of documen
 __Example 1__ shows how to create a __Comment__ and add its CommentRangeStart and CommentRangeEnd elements in a paragraph.
         
 
-#### __[C#] Example 1: Add a comment to a paragraph__
+#### __Example 1: Add a comment to a paragraph__
 
 
 
@@ -35,7 +35,7 @@ The __AddComment()__ method of the __Comments__ collection of a document creates
 __Example 2__ shows how you can insert a previously created __Comment__ object in a document by using [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}). The InsertComment() method will insert the comment's start and end elements.
         
 
-#### __[C#] Example 2: Insert previously created comment__
+#### __Example 2: Insert previously created comment__
 
 
 
@@ -44,7 +44,7 @@ __Example 2__ shows how you can insert a previously created __Comment__ object i
 __Example 3__ demonstrates how you can use another overload of __RadFlowDocumentEditor__'s __InsertComment()__ method. In this case, a string representing the text of the Comment and two inline elements are passed. The two inline elements specify the element prior, which the CommentRangeStart should be added and the element after which the CommentRangeEnd should be added.
         
 
-#### __[C#] Example 3: Insert comment around run__
+#### __Example 3: Insert comment around run__
 
 
 
@@ -68,7 +68,7 @@ Comment derives BlockContainerBase [BlockContainerBase](https://docs.telerik.com
 __Example 4__ shows how you can add a Table to a Comment.
         
 
-#### __[C#] Example 4: Add blocks to a comment__
+#### __Example 4: Add blocks to a comment__
 
 
 
diff --git a/libraries/radwordsprocessing/model/content-controls/content-controls.md b/libraries/radwordsprocessing/model/content-controls/content-controls.md
index 6c7b3b55..9b1e620b 100644
--- a/libraries/radwordsprocessing/model/content-controls/content-controls.md
+++ b/libraries/radwordsprocessing/model/content-controls/content-controls.md
@@ -70,7 +70,7 @@ The above content controls share the following properties:
 
 The __CheckBox__ content control exposes two properties __CheckedState__ and __UnCheckedState__. Both properties are of type __SdtCheckBoxState__ which allows you to set the respective character and its font. The __Checked__ property specifies whether the checkbox is checked.
 
-#### __C# Example 1: Setting CheckBox properties__ 
+#### __Example 1: Setting CheckBox properties__ 
 
 
 
@@ -89,7 +89,7 @@ The __ComboBox__ and __DropDownList__ provide the user with options to choose fr
     - __DisplayText:__ This property holds the displayed in the ComboBox/DropdownList text.
     - __Value:__ This property holds the value, which can be propagated through a data-binding relation.
 
-#### __C# Example 2: Setting ComboBox properties__
+#### __Example 2: Setting ComboBox properties__
 
 
 
@@ -102,7 +102,7 @@ The __Date__ content control allows you to enter a date by using a calendar. The
 * __Calendar:__ Allows you to select the calendar type.
 * __DateMappingType:__ Gets or sets the data type (e.g. Date, DateTime, and Text) that is used for storing mapped date time value. 
 
-#### __C# Example 3: Setting Date properties__ 
+#### __Example 3: Setting Date properties__ 
 
 
 
@@ -111,7 +111,7 @@ The __Date__ content control allows you to enter a date by using a calendar. The
 The __Text__ content control allows you to enter plain text. The text content control has the following property:
 * __IsMultiline:__ Gets or sets a value that indicates whether the SDT supports new lines in its content.
 
-#### __C# Example 4: Setting Text properties__ 
+#### __Example 4: Setting Text properties__ 
 
 
 
@@ -120,7 +120,7 @@ The __Text__ content control allows you to enter plain text. The text content co
 * __SectionTitle:__ Gets or sets the title of the section.
 * __AllowInsertAndDeleteSections:__ Gets or sets a value that indicates whether the underlying sections can be modified.
 
-#### __C# Example 5: Setting RepeatingSection properties__ 
+#### __Example 5: Setting RepeatingSection properties__ 
 
 
 
diff --git a/libraries/radwordsprocessing/model/content-controls/working-with-content-controls.md b/libraries/radwordsprocessing/model/content-controls/working-with-content-controls.md
index 9a7f39c2..5b331108 100644
--- a/libraries/radwordsprocessing/model/content-controls/working-with-content-controls.md
+++ b/libraries/radwordsprocessing/model/content-controls/working-with-content-controls.md
@@ -17,7 +17,7 @@ This article shows some examples of how you can insert content controls, access
 
 The content controls can be retrieved by using the __EnumerateChildrenOfType()__ method of any document element. 
 
-#### __C# Example 1: Get all content controls__
+#### __Example 1: Get all content controls__
 
 
 
@@ -25,7 +25,7 @@ The content controls can be retrieved by using the __EnumerateChildrenOfType()__
 
 This example shows how one can iterate the items and add an item to an existing ComboBox content control. 
 
-#### __C# Example 2: Adding items to a ComboBox or a DropDownList__
+#### __Example 2: Adding items to a ComboBox or a DropDownList__
 
 
 
@@ -35,23 +35,23 @@ New content controls can be inserted through the **InsertStructuredDocumentTag**
 
 >note If adding content controls with the InsertStructuredDocumentTag(SdtType) method without specifying the content, the resulting document will only have the annotation range start and end of the control. The desired content should be manually added afterwards. 
 
-#### __C# Example 3: Inserting a content control using content control type__
+#### __Example 3: Inserting a content control using content control type__
 
 
 
-#### __C# Example 4: Inserting a Rich Text content control using content control properties__
+#### __Example 4: Inserting a Rich Text content control using content control properties__
 
 
 
-#### __C# Example 5: Inserting a CheckBox content control using content control properties__
+#### __Example 5: Inserting a CheckBox content control using content control properties__
 
 
 
-#### __C# Example 6: Remove a content control__
+#### __Example 6: Remove a content control__
 
 
 
-#### __C# Example 7: Insert a content control to a specific position__
+#### __Example 7: Insert a content control to a specific position__
 
 >note When using the InsertStructuredDocumentTag() method and passing start and end elements, make sure that the elements are not already part of a content control.  An exception to the rule are the rich text and repeating section content controls, which can fully contain other controls, with the restriction that they cannot intersect their ranges. 
 
diff --git a/libraries/radwordsprocessing/model/floatingimage.md b/libraries/radwordsprocessing/model/floatingimage.md
index 4c91abab..863e7ef1 100644
--- a/libraries/radwordsprocessing/model/floatingimage.md
+++ b/libraries/radwordsprocessing/model/floatingimage.md
@@ -19,7 +19,7 @@ __FloatingImage__ is an inline-level anchor flow document element linked with a
 __Example 1__ shows how to create a FloatingImage and add it to a [Paragraph]({%slug radwordsprocessing-model-paragraph%}).
         
 
-#### __[C#] Example 1: Create a floating image and insert it in a paragraph__
+#### __Example 1: Create a floating image and insert it in a paragraph__
 
 
 
@@ -31,7 +31,7 @@ __Example 1__ shows how to create a FloatingImage and add it to a [Paragraph]({%
 You can add an image at a specific index in the __Inlines__ collection of a paragraph using the __Insert()__ method. Here is how to add a FloatingImage at the beginning of a paragraph:
         
 
-#### __[C#] Example 2: Add a floating image to a specific position__
+#### __Example 2: Add a floating image to a specific position__
 
 
 
@@ -40,7 +40,7 @@ You can add an image at a specific index in the __Inlines__ collection of a para
 You can also use the __AddFloatingImage()__ method of the __Inlines__ collection of a paragraph. The method creates a new __FloatingImage__, adds it to the paragraph and returns it.
         
 
-#### __[C#] Example 3: Using AddFloatingImage() method__
+#### __Example 3: Using AddFloatingImage() method__
 
 
 
@@ -49,7 +49,7 @@ You can also use the __AddFloatingImage()__ method of the __Inlines__ collection
 Inserting __FloatingImage__ element in RadFlowDocument can also be achieved with [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}).
         
 
-#### __[C#] Example 4: Insert a floating image using RadFlowDocumentEditor__
+#### __Example 4: Insert a floating image using RadFlowDocumentEditor__
 
 
 
diff --git a/libraries/radwordsprocessing/model/headers-footers.md b/libraries/radwordsprocessing/model/headers-footers.md
index 259420b4..624eba3e 100644
--- a/libraries/radwordsprocessing/model/headers-footers.md
+++ b/libraries/radwordsprocessing/model/headers-footers.md
@@ -39,7 +39,7 @@ Headers and Footers are properties of the __Section__ element and each Section c
 Headers of all __HeaderFooterType__ types can be created using the code snippet in __Example 1__:
         
 
-#### __[C#] Example 1: Create a header__
+#### __Example 1: Create a header__
 
 
 
@@ -48,7 +48,7 @@ Headers of all __HeaderFooterType__ types can be created using the code snippet
 Footers can be created using the code snippet from __Example 2__:
         
 
-#### __[C#] Example 2: Create a footer__
+#### __Example 2: Create a footer__
 
 
 
@@ -62,7 +62,7 @@ Footers can be created using the code snippet from __Example 2__:
 You can obtain the Headers and Footers in a Section through the __Default__, __Even__ and __First__ properties of its __Headers__ or __Footers__ property. For example, if you want to get the default Header element of a Section element, you can use the following line of code:
         
 
-#### __[C#] Example 3: Get the default header of a section__
+#### __Example 3: Get the default header of a section__
 
 
 
@@ -71,7 +71,7 @@ You can obtain the Headers and Footers in a Section through the __Default__, __E
 Similarly to the Header, the Footer element can be obtained as follows:
         
 
-#### __[C#] Example 4: Get the default footer of a section__
+#### __Example 4: Get the default footer of a section__
 
 
 
@@ -83,7 +83,7 @@ Similarly to the Header, the Footer element can be obtained as follows:
 __Example 5__ demonstrates how to add different headers for odd and even pages:
         
 
-#### __[C#] Example 5: Add headers for even and odd pages__
+#### __Example 5: Add headers for even and odd pages__
 
 
 
diff --git a/libraries/radwordsprocessing/model/imageinline.md b/libraries/radwordsprocessing/model/imageinline.md
index f6509b21..2be7159c 100644
--- a/libraries/radwordsprocessing/model/imageinline.md
+++ b/libraries/radwordsprocessing/model/imageinline.md
@@ -33,7 +33,7 @@ With **WordsProcessing**, you can work with images from the following file forma
 __Example 1__ demonstrates how you can create an ImageInline and add it to a [Paragraph]({%slug radwordsprocessing-model-paragraph%}):
         
 
-#### __[C#] Example 1: Create an image inline and insert it in a paragraph__
+#### __Example 1: Create an image inline and insert it in a paragraph__
 
 
 
@@ -45,7 +45,7 @@ __Example 1__ demonstrates how you can create an ImageInline and add it to a [Pa
 You can add an image at a specific index in the __Inlines__ collection of a paragraph using the __Insert()__ method. Here is how to add an ImageInline at the beginning of a paragraph:
         
 
-#### __[C#] Example 2: Add an image inline to a specific position__
+#### __Example 2: Add an image inline to a specific position__
 
 
 
@@ -54,7 +54,7 @@ You can add an image at a specific index in the __Inlines__ collection of a para
 You can also use the __AddImageInline()__ method of the __Inlines__ collection of a paragraph. The method creates a new ImageInline, adds it to the paragraph and returns it.
         
 
-#### __[C#] Example 3: Using AddImageInline() method__
+#### __Example 3: Using AddImageInline() method__
 
 
 
@@ -63,7 +63,7 @@ You can also use the __AddImageInline()__ method of the __Inlines__ collection o
 Inserting __ImageInline__ element in RadFlowDocument can also be achieved with [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}).
         
 
-#### __[C#] Example 4: Insert an image inline using RadFlowDocumentEditor__
+#### __Example 4: Insert an image inline using RadFlowDocumentEditor__
 
 
 
diff --git a/libraries/radwordsprocessing/model/paragraph.md b/libraries/radwordsprocessing/model/paragraph.md
index 83cf9710..f254458d 100644
--- a/libraries/radwordsprocessing/model/paragraph.md
+++ b/libraries/radwordsprocessing/model/paragraph.md
@@ -28,7 +28,7 @@ Paragraphs can be added as a child of a [BlockContainer](https://docs.telerik.co
 The code snippet from __Example 1__ creates and inserts a __Paragraph__ in a __Section__.
         
 
-#### __C# Example 1: Insert paragraph in section__
+#### __Example 1: Insert paragraph in section__
 
 
 
@@ -38,21 +38,21 @@ The code snippet from __Example 1__ creates and inserts a __Paragraph__ in a __S
 You can add a paragraph at a specific index in the __Blocks__ collection of a __BlockContainer__ using the __Insert()__ method. In __Example 2__ is demonstrated how to add a paragraph at the beginning of a section.
         
 
-#### __C# Example 2: Insert a paragraph at a specific position of the Blocks collection__
+#### __Example 2: Insert a paragraph at a specific position of the Blocks collection__
 
 
 
 You can also use the __AddParagraph()__ method of the __Blocks__ collection of a __BlockContainer__. The method creates a new __Paragraph__ instance, adds it to the container and returns it.
         
 
-#### __C# Example 3: Create a new paragraph and add it to a section__
+#### __Example 3: Create a new paragraph and add it to a section__
 
 
 
 Inserting a new __Paragraph__ in the document can also be achieved with the [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}) class.
         
 
-#### __C#  Example 4: Insert a paragraph using the RadFlowDocumentEditor__
+#### __Example 4: Insert a paragraph using the RadFlowDocumentEditor__
 
 
 
@@ -135,7 +135,7 @@ You can add inline elements to a __Paragraph__ instance.
 In __Example 5__ is illustrated how to add a run to an existing paragraph.
             
 
-#### __C# Example 5: Insert run in a paragraph__
+#### __Example 5: Insert run in a paragraph__
 
 
 
@@ -149,7 +149,7 @@ For more information about __Run__ element, you can read [this article]({%slug r
 __Example 6__ adds an inline image to an existing paragraph.
             
 
-#### __C# Example 6: Insert image inline__
+#### __Example 6: Insert image inline__
 
 
 
@@ -163,7 +163,7 @@ For more information about __ImageInline__ element, you can read [this article](
 The code snippet from __Example 7__  adds a floating image to an existing paragraph.
             
 
-#### __C# Example 7: Add floating image__
+#### __Example 7: Add floating image__
 
 
 
@@ -175,7 +175,7 @@ For more information about __FloatingImage__ element, you can read [this article
 
 In __Example 8__ it is demonstrated how to add a tab stop to the paragraph's collection.
 
-#### __C# Example 8: Insert TabStop__
+#### __Example 8: Insert TabStop__
 
 
 
@@ -185,7 +185,7 @@ You can refer to the [TabStop article]({%slug radwordsprocessing-concepts-tabsto
 
 __Example 9__ shows how to create Borders and set them to a Paragraph.
 
-#### __C# Example 9: Setting Borders__
+#### __Example 9: Setting Borders__
 
 
 
diff --git a/libraries/radwordsprocessing/model/permissionrange.md b/libraries/radwordsprocessing/model/permissionrange.md
index 62f92b99..e73c7618 100644
--- a/libraries/radwordsprocessing/model/permissionrange.md
+++ b/libraries/radwordsprocessing/model/permissionrange.md
@@ -38,7 +38,7 @@ Creating a __PermissionRange__ requires passing an instance of the __PermissionR
 __Example 1__ demonstrates how to create permission credentials for a single user specified by email and a permission range in a [Paragraph]({%slug radwordsprocessing-model-paragraph%}).
 
 
-#### __[C#] Example 1: Add PermissionRange to paragraph__
+#### __Example 1: Add PermissionRange to paragraph__
 
 
 
@@ -49,7 +49,7 @@ Inserting a __PermissionRange__ in the document can be achieved through [RadFlow
 
 __Example 2__ demonstrates how to specify that a __TableCell__ can be edited by everyone when protection is enforced.
 
-#### __[C#] Example 2: Insert PermissionRange for TableCell__
+#### __Example 2: Insert PermissionRange for TableCell__
 
 
 
@@ -70,7 +70,7 @@ __ProtectionMode__ exposes the following members:
 
 __Example 3__ shows how to protect and unprotect a document using the various overloads of the methods.
 
-#### __[C#] Example 3: Protect and unprotect document through RadFlowDocumentEditor__
+#### __Example 3: Protect and unprotect document through RadFlowDocumentEditor__
 
 
 
@@ -81,7 +81,7 @@ __Example 3__ shows how to protect and unprotect a document using the various ov
 
 __RadFlowDocument__ exposes a property of type __ProtectionSettings__ - ProtectionSettings. Enforcing protection directly through the document is possible by setting the  __Enforced__ property as demonstrated in __Example 4__.
 
-#### __[C#] Example 4: Enforce protection through RadFlowDocument__
+#### __Example 4: Enforce protection through RadFlowDocument__
 
 
 
diff --git a/libraries/radwordsprocessing/model/radflowdocument.md b/libraries/radwordsprocessing/model/radflowdocument.md
index 000e1b02..ea1eb307 100644
--- a/libraries/radwordsprocessing/model/radflowdocument.md
+++ b/libraries/radwordsprocessing/model/radflowdocument.md
@@ -19,7 +19,7 @@ __RadFlowDocument__ hosts flow document content and is the root element in the d
 The code from __Example 1__ shows how you can create a new __RadFlowDocument__.
         
 
-#### __[C#] Example 1: Create RadFlowDocument__
+#### __Example 1: Create RadFlowDocument__
 
 
 
@@ -66,7 +66,7 @@ There are different actions which you can execute with the help of the __RadFlow
 You can create a __RadFlowDocument__ from scratch and add Sections to it as follows:
             
 
-#### __[C#] Example 2: Add a Section to a RadFlowDocument__
+#### __Example 2: Add a Section to a RadFlowDocument__
 
 
 
@@ -78,7 +78,7 @@ The Sections property of the document is of type __SectionCollection__ and allow
 Alternatively, you could create a section by passing to its constructor the document it should be associated with.
             
 
-#### __[C#] Example 3: Create a section__
+#### __Example 3: Create a section__
 
 
 
@@ -89,7 +89,7 @@ Alternatively, you could create a section by passing to its constructor the docu
 You can merge a __RadFlowDocument__ within another document by using the __Merge()__ method and pass the source document as a parameter to it:
             
 
-#### __[C#] Example 4: Merge documents__
+#### __Example 4: Merge documents__
 
 
 
@@ -104,7 +104,7 @@ Additionally, you have the opportunity to specify the __MergeOptions__ which con
     * __RenameSourceStyle__: If a conflict between styles with the same IDs appears, the style of the __source__ document is renamed and used.
                     
 
-#### __[C#] Example 5: Merge documents using MergeOptions__
+#### __Example 5: Merge documents using MergeOptions__
 
 
 
@@ -118,7 +118,7 @@ __RadFlowDocument__ exposes an __UpdateFields()__ method which allows you to upd
 The snippet from __Example 6__ shows how all fields in a document can be updated simultaneously.
             
 
-#### __[C#] Example 6: Update all fields in a document__
+#### __Example 6: Update all fields in a document__
 
 
 
diff --git a/libraries/radwordsprocessing/model/run.md b/libraries/radwordsprocessing/model/run.md
index e5297efd..b08192f7 100644
--- a/libraries/radwordsprocessing/model/run.md
+++ b/libraries/radwordsprocessing/model/run.md
@@ -19,7 +19,7 @@ __Run__ element is an inline-level flow content element intended to contain a ru
 
 The code in __Example 1__ creates a __Run__ element and adds it to a [Paragraph]({%slug radwordsprocessing-model-paragraph%}).      
 
-#### __[C#] Example 1: Create and add a run to a paragraph__
+#### __Example 1: Create and add a run to a paragraph__
 
 
 
@@ -27,19 +27,19 @@ The code in __Example 1__ creates a __Run__ element and adds it to a [Paragraph]
 
 You can add a run at a specific index in the __Inlines__ collection of a paragraph using the __Insert()__ method. __Example 2__ demonstrates how to add a run at the beginning of a paragraph.     
 
-#### __[C#] Example 2: Create and add a run at a specific index of a paragraph's Inlines collection__
+#### __Example 2: Create and add a run at a specific index of a paragraph's Inlines collection__
 
 
 
 You can also use the __AddRun()__ method of the __Inlines__ collection of a paragraph. The method creates a new __Run__ instance, adds it to the container and returns it:     
 
-#### __[C#] Example 3: Create and add a run to a paragraph__
+#### __Example 3: Create and add a run to a paragraph__
 
 
 
 Inserting text in the document can also be achieved with the [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}) class:
         
-#### __[C#] Example 4: Insert a run using RadFlowDocumentEditor__
+#### __Example 4: Insert a run using RadFlowDocumentEditor__
 
 
 
diff --git a/libraries/radwordsprocessing/model/section.md b/libraries/radwordsprocessing/model/section.md
index 3555c379..1d814e07 100644
--- a/libraries/radwordsprocessing/model/section.md
+++ b/libraries/radwordsprocessing/model/section.md
@@ -22,14 +22,14 @@ __Section__ is a BlockContainer element which can contain other block elements.
 You can use the code snippet from __Example 1__ to create a __Section__ element and add it to a [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}).
     
 
-#### __[C#] Example 1: Create a section and add it to a RadFlowDocument__
+#### __Example 1: Create a section and add it to a RadFlowDocument__
 
 
 
 
 You can also use the __AddSection()__ method of the __Sections__ collection of a document. The method creates a new __Section__ element, adds it to the document and returns it.
         
-#### __[C#] Example 2: Create a section and add it to a RadFlowDocument__
+#### __Example 2: Create a section and add it to a RadFlowDocument__
 
 
 
@@ -41,27 +41,27 @@ The __Section__ exposes several properties that allow you to customize the layou
 * __PageMargins__: Represents the margin towards the edges of the page.
             
 
-	#### __[C#] Example 3: Change margins of a section__
+	#### __Example 3: Change margins of a section__
 	
 	
 
 * __PageOrientation__: Specifies whether the pages in the section should be in *Portrait* or in *Landscape* orientation. This property is used to determine the actual size of the paper to use on the printer and does not reflect document's visualization. In order to affect __Section__'s appearance you should change PageSize and PageMargin properties, or use the [Rotate method](#rotating-a-section), which will change them according to the desired page orientation.
             
-	#### __[C#] Example 4: Change orienation of a section__
+	#### __Example 4: Change orienation of a section__
 	
 	
 
 
 * __PageSize__: Specifies the size of the pages in the section. The width and height are in device independent pixels (1/96 inch). The __PaperTypeConverter__ class and the [PaperTypes](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Model.PaperTypes.html) enumeration provide convenient API and predefined sizes out of the box.         
 	
-	#### __[C#] Example 5: Change page size of a section__
+	#### __Example 5: Change page size of a section__
 	
 	
 
 
 * __Headers and Footers__: Each __Section__ has three Headers and three Footers - __Default__ (used all through the section), __First__ (used on the first page of the section) and __Even__ (used on even pages of the document). The three Headers are contained in the Headers class accessible through the __Section.Headers__ property. The three Footers are contained in the Footers class accessible through the __Section.Footers__ property. __Example 6__ shows how you can create default Header.
             
-	#### __[C#] Example 6: Create a header of a section__
+	#### __Example 6: Create a header of a section__
 	
 	
 
@@ -105,7 +105,7 @@ The __Section__ exposes several properties that allow you to customize the layou
 __Section__ derives [BlockContainerBase](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Flow.Model.BlockContainerBase.html), inheriting Blocks property of BlockCollection type. You can add [Paragraph]({%slug radwordsprocessing-model-paragraph%}) and [Table]({%slug radwordsprocessing-model-table%}) objects to that collection.
         
 
-#### __[C#] Example 7: Add elements to a section__
+#### __Example 7: Add elements to a section__
 
 
 
@@ -114,7 +114,7 @@ __Section__ derives [BlockContainerBase](https://docs.telerik.com/devtools/docum
 
 The __Section__ can be rotated in order to visualize its pages in Portrait or Landscape mode.
 
-#### __[C#] Example 8: Rotate a section__
+#### __Example 8: Rotate a section__
 
 
 ## See Also
diff --git a/libraries/radwordsprocessing/model/table.md b/libraries/radwordsprocessing/model/table.md
index 9b06b74f..fd4d7e8d 100644
--- a/libraries/radwordsprocessing/model/table.md
+++ b/libraries/radwordsprocessing/model/table.md
@@ -29,7 +29,7 @@ When creating an instance of the Table class, you should pass the document that
 The code snippet from __Example 1__ creates and inserts a Table to a Section.
         
 
-#### __[C#] Example 1: Create and insert a table to a section__
+#### __Example 1: Create and insert a table to a section__
 
 
 
@@ -41,7 +41,7 @@ The code snippet from __Example 1__ creates and inserts a Table to a Section.
 You can add a table at a specific index in the __Blocks__ collection of a __BlockContainer__ using the __Insert()__ method. __Example 2__ shows how to add a table at the beginning of a section.
         
 
-#### __[C#] Example 2: Insert a table at a specific index__
+#### __Example 2: Insert a table at a specific index__
 
 
 
@@ -50,7 +50,7 @@ You can add a table at a specific index in the __Blocks__ collection of a __Bloc
 You can also use the __AddTable()__ method of the __Blocks__ collection of a __BlockContainer__. The method creates a new __Table__ instance, adds it to the container and returns it.
         
 
-#### __[C#] Example 3: Insert a new table to a container__
+#### __Example 3: Insert a new table to a container__
 
 
 
@@ -59,7 +59,7 @@ You can also use the __AddTable()__ method of the __Blocks__ collection of a __B
 Inserting a new __Table__ in the document can also be achieved with the [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}) class.
         
 
-#### __[C#] Example 4: Insert a table using RadFlowDocumentEditor__
+#### __Example 4: Insert a table using RadFlowDocumentEditor__
 
 
 
@@ -130,7 +130,7 @@ __Properties__ exposes several properties that allow you to customize the layout
 __Example 5__ demonstrates how to add a __Table__ with 5 rows and 10 columns to a __RadFlowDocument__.
             
 
-#### __[C#] Example 5: Create a table with content and add it to a RadFlowDocument__
+#### __Example 5: Create a table with content and add it to a RadFlowDocument__
 
 
 
diff --git a/libraries/radwordsprocessing/model/tablecell.md b/libraries/radwordsprocessing/model/tablecell.md
index 536f3c88..8cd7d08f 100644
--- a/libraries/radwordsprocessing/model/tablecell.md
+++ b/libraries/radwordsprocessing/model/tablecell.md
@@ -18,28 +18,28 @@ __TableCell__ element is a __BlockContainer__ element and defines a cell of cont
 You can use the code snippet from __Example 1__ to create a __TableCell__ and add it in a [TableRow]({%slug radwordsprocessing-model-tablerow%}).
         
 
-#### __[C#] Example 1: Create a TableCell object and add it to a TableRow__
+#### __Example 1: Create a TableCell object and add it to a TableRow__
 
-````
+```csharp
 RadFlowDocument radFlowDocument = new RadFlowDocument();
 Table table = radFlowDocument.Sections.AddSection().Blocks.AddTable();
 TableRow row = table.Rows.AddTableRow();
 
 TableCell cell = new TableCell(radFlowDocument);
 row.Cells.Add(cell);
-````
+```
 
 
 
 To create a __TableCell__ and add it in the document tree in the same time, you can use the __AddTableCell()__ method.
         
 
-#### __[C#] Example 2: Create a TableCell and add it to a TableRow in the same time__
+#### __Example 2: Create a TableCell and add it to a TableRow in the same time__
 
-````
+```csharp
 TableRow row = table.Rows.AddTableRow();
 TableCell cell = row.Cells.AddTableCell();
-````
+```
 
 
 ## Modifying a TableCell
@@ -100,14 +100,14 @@ The __TableCell__ element exposes several properties that allow you to customize
 * __GridRowIndex__: Represents the row index of the cell in the table grid.
          
 		    
-````
+```csharp
 Border border = new Border(1, BorderStyle.Single, new ThemableColor(Colors.Blue));
 cell.Borders = new Telerik.Windows.Documents.Flow.Model.Styles.TableCellBorders(border, border, border, border);
 cell.Shading.BackgroundColor = new ThemableColor(Colors.Red);
 cell.Padding = new Telerik.Windows.Documents.Primitives.Padding(20,20,20,20);
 cell.VerticalAlignment = VerticalAlignment.Bottom;
 cell.TextDirection = TextDirection.LeftToRightTopToBottom;
-````			
+```			
 
 ## Operating with a TableCell
 
@@ -116,12 +116,12 @@ cell.TextDirection = TextDirection.LeftToRightTopToBottom;
 __Example 3__ demonstrates how to add a __Paragraph__ to a __TableCell__.
             
 
-#### __[C#] Example 3: Add a paragraph to a TableCell__
+#### __Example 3: Add a paragraph to a TableCell__
 
 
-````
+```csharp
 Paragraph paragraph = cell.Blocks.AddParagraph();
-````
+```
 
 Through the __BlockCollection__ property of the __TableCell__ element you can add a __Table__ or any other [BlockBase](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Flow.Model.BlockBase.html) element.
             
diff --git a/libraries/radwordsprocessing/model/tablerow.md b/libraries/radwordsprocessing/model/tablerow.md
index b8c593c6..ca309612 100644
--- a/libraries/radwordsprocessing/model/tablerow.md
+++ b/libraries/radwordsprocessing/model/tablerow.md
@@ -26,14 +26,14 @@ __TableRow__ is a flow document element that defines a row within a [Table]({%sl
 You can use the code snippet from __Example 1__ to create a __TableRow__ and add it in a __Table__.
         
 
-#### __[C#] Example 1: Create a TableRow and add it to a table__
+#### __Example 1: Create a TableRow and add it to a table__
 
  
 
 In order to create a __TableRow__ and add it in the document tree in the same time, you can use the __AddTableRow()__ method of the [Rows](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Flow.Model.Table.html#collapsible-Telerik_Windows_Documents_Flow_Model_Table_Rows) collection property of the table.
         
 
-#### __[C#] Example 2: Create a TableRow and add it to a table in the same time__
+#### __Example 2: Create a TableRow and add it to a table in the same time__
 
 
 
@@ -79,7 +79,7 @@ The __TableRow__ element exposes several properties that allow you to customize
 __Example 3__ shows how to add a number of __TableCell__ elements in a TableRow.
             
 
-#### __[C#] Example 3: Add TableCell objects to a TableRow__
+#### __Example 3: Add TableCell objects to a TableRow__
 
 
 
diff --git a/libraries/radziplibrary/features/compress-stream.md b/libraries/radziplibrary/features/compress-stream.md
index a2c34757..7e8b7ed0 100644
--- a/libraries/radziplibrary/features/compress-stream.md
+++ b/libraries/radziplibrary/features/compress-stream.md
@@ -57,52 +57,52 @@ The parameters accepted by the constructors serve the following functions:
 You can create a compressed stream by initializing a new instance of the __CompressedStream__ class and passing as a parameter the stream in which the compressed data will be written. You need to specify the operation mode to __Wrtie__ and the compression settings that should be used.
         
 
-#### __[C#] Example 1: Write to compressed stream__
+#### __Example 1: Write to compressed stream__
 
-{{region cs-radziplibrary-compress-stream_0}}
+```csharp
 	            
 	using (CompressedStream compressedStream = new CompressedStream(outputStream, StreamOperationMode.Write, new DeflateSettings()))
 	{
 	    // write to compressed stream
 	}
-{{endregion}}
+```
 
 
 
-#### __[VB.NET] Example 1: Write to compressed stream__
+#### __Example 1: Write to compressed stream__
 
-{{region vb-radziplibrary-compress-stream_0}}
+```csharp
 	Using compressedStream As New CompressedStream(outputStream, StreamOperationMode.Write, New DeflateSettings())
 	    ' write to compressed stream
 	End Using
-{{endregion}}
+```
 
 
 
 If you want to compress a specific stream (*inputStream*), you need to copy it to the compressed stream that you've created.
         
 
-#### __[C#] Example 2: Write stream to compressed stream__
+#### __Example 2: Write stream to compressed stream__
 
-{{region cs-radziplibrary-compress-stream_1}}
+```csharp
 	    
 	using (CompressedStream compressedStream = new CompressedStream(outputStream, StreamOperationMode.Write, new DeflateSettings()))
 	{
 	    inputStream.CopyTo(compressedStream);
 	    compressedStream.Flush();
 	}
-{{endregion}}
+```
 
 
 
-#### __[VB.NET] Example 2: Write stream to compressed stream__
+#### __Example 2: Write stream to compressed stream__
 
-{{region vb-radziplibrary-compress-stream_1}}
+```csharp
 	Using compressedStream As New CompressedStream(outputStream, StreamOperationMode.Write, New DeflateSettings())
 	    inputStream.CopyTo(compressedStream)
 	    compressedStream.Flush()
 	End Using
-{{endregion}}
+```
 
 
 
@@ -111,25 +111,25 @@ If you want to compress a specific stream (*inputStream*), you need to copy it t
 Decompressing a stream is just as simple as compressing it. All you need to do is create new instance of the __CompressedStream__ class and pass it the stream from which the compressed data will be extracted, operation mode __Read__, and the compression settings that need to be used.
         
 
-#### __[C#] Example 3: Decompressed stream__
+#### __Example 3: Decompressed stream__
 
-{{region cs-radziplibrary-compress-stream_2}}
+```csharp
 	            
 	using (CompressedStream compressedStream = new CompressedStream(inputStream, StreamOperationMode.Read, new DeflateSettings()))
 	{
 	    compressedStream.CopyTo(outputStream);
 	}
-{{endregion}}
+```
 
 
 
-#### __[VB.NET] Example 3: Decompressed stream__
+#### __Example 3: Decompressed stream__
 
-{{region vb-radziplibrary-compress-stream_2}}
+```csharp
 	Using compressedStream As New CompressedStream(inputStream, StreamOperationMode.Read, New DeflateSettings())
 	    compressedStream.CopyTo(outputStream)
 	End Using
-{{endregion}}
+```
 
 
 
diff --git a/libraries/radziplibrary/features/compression-settings.md b/libraries/radziplibrary/features/compression-settings.md
index e96ab3ca..d0555fdb 100644
--- a/libraries/radziplibrary/features/compression-settings.md
+++ b/libraries/radziplibrary/features/compression-settings.md
@@ -25,22 +25,22 @@ The __DeflateSettings__ class exposes some configurable parameters:
             
 __Example 1__ demonstrates how to create DeflateSettings.       
 
-#### __[C#] Example 1: Create DeflateSettings__
+#### __Example 1: Create DeflateSettings__
 
-{{region cs-radziplibrary-compression-settings_0}}
+```csharp
 	            
 	DeflateSettings compressionSettings = new DeflateSettings();
 	compressionSettings.CompressionLevel = CompressionLevel.Best;
 	compressionSettings.HeaderType = CompressedStreamHeader.ZLib;
-{{endregion}}
+```
 
-#### __[VB.NET] Example 1: Create DeflateSettings__
+#### __Example 1: Create DeflateSettings__
 
-{{region vb-radziplibrary-compression-settings_0}}
+```csharp
 	Dim compressionSettings As New DeflateSettings()
 	compressionSettings.CompressionLevel = CompressionLevel.Best
 	compressionSettings.HeaderType = CompressedStreamHeader.ZLib
-{{endregion}}
+```
 
 ## LZMA Settings
 
@@ -62,9 +62,9 @@ The configurable parameters of the __LzmaSettings__ class are as follows:
             
 * __MatchFinderType__: The type of the match finder. Allowed values are BT2(match finder that uses two bytes for the hash) and BT4(uses four bytes for the hash).
             
-#### __[C#] Example 2: Create LzmaSettings__
+#### __Example 2: Create LzmaSettings__
 
-{{region cs-radziplibrary-compression-settings_1}}
+```csharp
 	            
 	LzmaSettings compressionSettings = new LzmaSettings();
 	compressionSettings.DictionarySize = 23;
@@ -73,13 +73,13 @@ The configurable parameters of the __LzmaSettings__ class are as follows:
 	compressionSettings.LiteralPositionBits = 3;
 	compressionSettings.MatchFinderType = LzmaMatchFinderType.BT4;
 	compressionSettings.PositionStateBits = 2;
-{{endregion}}
+```
 
 
 
-#### __[VB.NET] Example 2: Create LzmaSettings__
+#### __Example 2: Create LzmaSettings__
 
-{{region vb-radziplibrary-compression-settings_1}}
+```csharp
 	Dim compressionSettings As New LzmaSettings()
 	compressionSettings.DictionarySize = 23
 	compressionSettings.FastBytes = 32
@@ -87,7 +87,7 @@ The configurable parameters of the __LzmaSettings__ class are as follows:
 	compressionSettings.LiteralPositionBits = 3
 	compressionSettings.MatchFinderType = LzmaMatchFinderType.BT4
 	compressionSettings.PositionStateBits = 2
-{{endregion}}
+```
 
 
 
@@ -96,19 +96,19 @@ The configurable parameters of the __LzmaSettings__ class are as follows:
 Store settings are used to just store the data using no compression.
         
 
-#### __[C#] Example 3: Create StoreSettings__
+#### __Example 3: Create StoreSettings__
 
-{{region cs-radziplibrary-compression-settings_2}}
+```csharp
 	StoreSettings compressionSettings = new StoreSettings();
-{{endregion}}
+```
 
 
 
-#### __[VB.NET] Example 3: Create StoreSettings__
+#### __Example 3: Create StoreSettings__
 
-{{region vb-radziplibrary-compression-settings_2}}
+```csharp
 	Dim compressionSettings As New StoreSettings()
-{{endregion}}
+```
 
 
 ## See Also
diff --git a/libraries/radziplibrary/features/protect-ziparchive.md b/libraries/radziplibrary/features/protect-ziparchive.md
index 4a6b78f0..7e8387e6 100644
--- a/libraries/radziplibrary/features/protect-ziparchive.md
+++ b/libraries/radziplibrary/features/protect-ziparchive.md
@@ -29,9 +29,9 @@ In order to create a password-protected ZIP archive, you need to pass a **Passwo
         
 **PasswordEncryptionSettings** has a __Password__ property of type string, which represents the used password.
  
-#### __[C#] Example 1: Create a password-protected ZIP archive__
+#### __Example 1: Create a password-protected ZIP archive__
 
-{{region cs-radziplibrary-protect-ziparchive_0}}
+```csharp
 
 	using (Stream stream = File.Open("test.zip", FileMode.Create))
 	{
@@ -56,11 +56,11 @@ In order to create a password-protected ZIP archive, you need to pass a **Passwo
     	}
 	}
 
-{{endregion}}
+```
 
-#### __[VB.NET] Example 1: Create a password-protected ZIP archive__
+#### __Example 1: Create a password-protected ZIP archive__
 
-{{region vb-radziplibrary-protect-ziparchive_0}}
+```csharp
 
 	Using stream As Stream = File.Open("test.zip", FileMode.Create)
 			'By default the EncryptionStrenght is 256 bits but it can be explicitly specified (EncryptionStrength.Aes128, EncryptionStrength.Aes192, and EncryptionStrength.Aes256) by passing it to the constructor
@@ -83,7 +83,7 @@ In order to create a password-protected ZIP archive, you need to pass a **Passwo
     		End Using
 	End Using
 
-{{endregion}}
+```
 
 
 >tip You must always dispose of the ZIP archive object when all operations that use it are completed. Telerik Support recommends that you declare and instantiate the ZIP archive object in a using statement. If it is not possible for some reason, then do not forget to call the __Dispose()__ method when you complete all operations.
@@ -93,9 +93,9 @@ In order to create a password-protected ZIP archive, you need to pass a **Passwo
 In order to open a password-protected __ZipArchive__, you need to pass a __DefaultEncryptionSettings__ object with the password that was used to create the archive in the first place.
                 
 
-#### __[C#] Example 2: Open and read a password-protected ZIP archive__
+#### __Example 2: Open and read a password-protected ZIP archive__
 
-{{region cs-radziplibrary-protect-ziparchive_1}}
+```csharp
 	    
 	using (FileStream stream = File.Open("test.zip", FileMode.Open))
 	{ 
@@ -109,11 +109,11 @@ In order to open a password-protected __ZipArchive__, you need to pass a __Defau
     		}
 	}
 
-{{endregion}}
+```
 
-#### __[VB.NET] Example 2: Open and read a password-protected ZIP archive__
+#### __Example 2: Open and read a password-protected ZIP archive__
 
-{{region vb-radziplibrary-protect-ziparchive_1}}
+```csharp
 
 	Sub Main()	
 		Using stream As FileStream = File.Open("test.zip", FileMode.Open)
@@ -132,7 +132,7 @@ In order to open a password-protected __ZipArchive__, you need to pass a __Defau
         	e.Password = "passw0rd"
 	End Sub
      
-{{endregion}}
+```
 
 >tip You must always dispose of the ZIP archive object when all operations that use it are completed. We recommend that you declare and instantiate the ZIP archive object in a **using** statement. If it is not possible for some reason, then do not forget to call the __Dispose()__ method when you complete all operations.
           
diff --git a/libraries/radziplibrary/features/update-ziparchive.md b/libraries/radziplibrary/features/update-ziparchive.md
index 5494787b..a1e309a9 100644
--- a/libraries/radziplibrary/features/update-ziparchive.md
+++ b/libraries/radziplibrary/features/update-ziparchive.md
@@ -15,9 +15,9 @@ The __ZipArchive__ class provides three modes: *Read*, *Create* and *Update*. Mo
 
 The code snippet from __Example 1__ opens a ZIP archive in update mode using __ZipArchive__ class.    
 
-#### __[C#] Example 1: Open for update__
+#### __Example 1: Open for update__
 
-{{region cs-radziplibrary-update-ziparchive_0}}
+```csharp
 	            
 	using (Stream stream = File.Open("test.zip", FileMode.Open))
 	{
@@ -26,17 +26,17 @@ The code snippet from __Example 1__ opens a ZIP archive in update mode using __Z
 	        // Display the list of the files in the selected zip file using the ZipArchive.Entries property.
 	    }
 	}
-{{endregion}}
+```
 
-#### __[VB.NET] Example 1: Open for update__
+#### __Example 1: Open for update__
 
-{{region vb-radziplibrary-update-ziparchive_0}}
+```csharp
 	Using stream As Stream = File.Open("test.zip", FileMode.Open)
 	    Using archive As ZipArchive = ZipArchive.Update(stream, Nothing)
 	        ' Display the list of the files in the selected zip file using the ZipArchive.Entries property.
 	    End Using
 	End Using
-{{endregion}}
+```
 
 
 
@@ -58,9 +58,9 @@ In order to add a new entry into the ZIP archive, you should perform the followi
 >note More information about ZipArchiveEntry you can find in [ZipArchiveEntry]({%slug radziplibrary-ziparchive-entry%}) help article. 
             
 
-#### __[C#] Example 2: Add entry__
+#### __Example 2: Add entry__
 
-{{region cs-radziplibrary-update-ziparchive_1}}
+```csharp
 	    
 	using (ZipArchiveEntry entry = archive.CreateEntry("text.txt"))
 	{
@@ -68,19 +68,19 @@ In order to add a new entry into the ZIP archive, you should perform the followi
 	    writer.WriteLine("Hello world!");
 	    writer.Flush();
 	}
-{{endregion}}
+```
 
 
 
-#### __[VB.NET] Example 2: Add entry__
+#### __Example 2: Add entry__
 
-{{region vb-radziplibrary-update-ziparchive_1}}
+```csharp
 	Using entry As ZipArchiveEntry = archive.CreateEntry("text.txt")
 	    Dim writer As New StreamWriter(entry.Open())
 	    writer.WriteLine("Hello world!")
 	    writer.Flush()
 	End Using
-{{endregion}}
+```
 
 
 
@@ -92,27 +92,27 @@ The __ZipArchive__ class provides a __GetEntry()__ method, which allows you acce
 __Example 3__ shows how you could obtain an entry and delete it from the ZIP archive using the __Delete()__ method.
         
 
-#### __[C#] Example 3: Delete entry__
+#### __Example 3: Delete entry__
 
-{{region cs-radziplibrary-update-ziparchive_2}}
+```csharp
 	            
 	ZipArchiveEntry entry = archive.GetEntry("text.txt");
 	if (entry != null)
 	{
 	    entry.Delete();
 	}
-{{endregion}}
+```
 
 
 
-#### __[VB.NET] Example 3: Delete entry__
+#### __Example 3: Delete entry__
 
-{{region vb-radziplibrary-update-ziparchive_2}}
+```csharp
 	Dim entry As ZipArchiveEntry = archive.GetEntry("text.txt")
 	If entry IsNot Nothing Then
 	    entry.Delete()
 	End If
-{{endregion}}
+```
 
 
 ## Update Entry
@@ -132,9 +132,9 @@ In order to update an existing entry in the ZIP archive, you should perform the
 1. Dispose entry when all necessary information is written. In the __Update__ mode this step is optional. You can omit it if you are going to add/delete/update other entries in the archive.
             
 
-#### __[C#] Example 4: Update entry__
+#### __Example 4: Update entry__
 	
-{{region cs-radziplibrary-update-ziparchive_3}}
+```csharp
 	ZipArchiveEntry entry = archive.GetEntry("text.txt");
 	if (entry != null)
 	{
@@ -147,13 +147,13 @@ In order to update an existing entry in the ZIP archive, you should perform the
 	    writer.WriteLine("Updated line.");
 	    writer.Flush();
 	}
-{{endregion}}
+```
 
 
 
-#### __[VB.NET] Example 4: Update entry__
+#### __Example 4: Update entry__
 
-{{region vb-radziplibrary-update-ziparchive_3}}
+```csharp
 	Dim entry As ZipArchiveEntry = archive.GetEntry("text.txt")
 	If entry IsNot Nothing Then
 	    Dim entryStream As Stream = entry.Open()
@@ -165,7 +165,7 @@ In order to update an existing entry in the ZIP archive, you should perform the
 	    writer.WriteLine("Updated line.")
 	    writer.Flush()
 	End If
-{{endregion}}
+```
 
 ## Copy Entry
 
@@ -173,7 +173,7 @@ Starting with the **Q2 2025** release, the __RadZipLibrary__ introduces a new ex
 
 The following example demonstrates how to use the `CopyTo` method to copy the contents of a large file from a ZIP archive to a memory stream with a specified timeout.
 
-#### __[C#] Example 5: Copy entry with timeout__
+#### __Example 5: Copy entry with timeout__
 
 
 
diff --git a/libraries/radziplibrary/features/ziparchive-entry.md b/libraries/radziplibrary/features/ziparchive-entry.md
index 36488971..d036b84c 100644
--- a/libraries/radziplibrary/features/ziparchive-entry.md
+++ b/libraries/radziplibrary/features/ziparchive-entry.md
@@ -22,8 +22,8 @@ The root element of the [RadZipLibrary]({%slug radziplibrary-overview%}) is the
 
     > The archive compressed length can be obtained only after the **ZipArchiveEntry** is disposed of, so in the following example, we are ensuring the correct disposing of the object by [using statement](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-statement).
 
-    #### **[C#] Example 1: Get entry's compressed length**
-    {{region cs-radziplibrary-ziparchive-entry_0}}
+    #### **Example 1: Get entry's compressed length**
+    ```csharp
                     
         ZipArchiveEntry entry;
         using (entry = archive.CreateEntry("file.txt"))
@@ -34,42 +34,42 @@ The root element of the [RadZipLibrary]({%slug radziplibrary-overview%}) is the
         }
 
         long compressedLength = entry.CompressedLength;
-    {{endregion}}
+    ```
 
 * **ExternalAttributes**: Gets or sets external [file attributes](https://docs.microsoft.com/en-us/dotnet/api/system.io.fileattributes?view).
     
-    #### **[C#] Example 2: Set entry's external attributes**
+    #### **Example 2: Set entry's external attributes**
 
-    {{region cs-radziplibrary-ziparchive-entry_1}}
+    ```csharp
                     
         entry.ExternalAttributes = (int)File.GetAttributes(sourceFileName);
-    {{endregion}}
+    ```
 
 * **FullName**: Gets the relative path of the entry in the zip archive.
   
-    #### **[C#] Example 3: Get entry's relative path**
+    #### **Example 3: Get entry's relative path**
     
-    {{region cs-radziplibrary-ziparchive-entry_2}}
+    ```csharp
                     
         string fullName = entry.FullName;
-    {{endregion}}
+    ```
 
 * **LastWriteTime**: Gets or sets the last time the entry in the zip archive was changed.
     
-    #### **[C#] Example 4: Set last entry's write time**
+    #### **Example 4: Set last entry's write time**
 
-    {{region cs-radziplibrary-ziparchive-entry_3}}
+    ```csharp
 
         DateTime lastWriteTime = File.GetLastWriteTime(sourceFileName);
         entry.LastWriteTime = lastWriteTime;
-    {{endregion}}
+    ```
 
 * **Length**: Gets the uncompressed size of the entry in the zip archive.
     > The archive length can be obtained only after the **ZipArchiveEntry** is disposed of, so in the following example, we are ensuring the correct disposing of the object by [using statement](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-statement).
 
-    #### **[C#] Example 5: Get entry's length**
+    #### **Example 5: Get entry's length**
 
-    {{region cs-radziplibrary-ziparchive-entry_4}}
+    ```csharp
                     
         ZipArchiveEntry entry;
         using (entry = archive.CreateEntry("file.txt"))
@@ -80,16 +80,16 @@ The root element of the [RadZipLibrary]({%slug radziplibrary-overview%}) is the
         }
 
         long length = entry.CompressedLength;
-    {{endregion}}
+    ```
 
 * **Name**: Gets the file name of the entry in the zip archive.
 
-    #### **[C#] Example 6: Get entry's name**
+    #### **Example 6: Get entry's name**
 
-    {{region cs-radziplibrary-ziparchive-entry_5}}
+    ```csharp
                     
         string name = entry.Name;
-    {{endregion}}
+    ```
 
 
 ### Methods
@@ -107,35 +107,35 @@ There are several operations, which you can execute over a **ZipArchive** instan
 ### Get ZipArchiveEntry
 Retrieves a wrapper for the specified entry in the zip archive.
 
-#### **[C#] Example 7: Get ZipArchiveEntry**
+#### **Example 7: Get ZipArchiveEntry**
 
-{{region cs-radziplibrary-ziparchive-entry_6}}
+```csharp
                 
     ZipArchiveEntry entry = archive.GetEntry("file.txt");
-{{endregion}}
+```
 
 
 ### Create ZipArchiveEntry
 Creates an empty entry that has the specified path and entry name in the zip archive.
 
-#### **[C#] Example 8: Create ZipArchiveEntry**
+#### **Example 8: Create ZipArchiveEntry**
 
-{{region cs-radziplibrary-ziparchive-entry_7}}
+```csharp
                     
     ZipArchiveEntry entry = archive.CreateEntry("file.txt");
 
     // OR
 
     ZipArchiveEntry entry = archive.CreateEntry("file.txt", compressionSettings);
-{{endregion}}
+```
 
 
 ### Extract ZipArchiveEntry
 Extract an entry to a specific folder/directory.
 
-#### **[C#] Example 9: Extracting a ZipArchiveEntry to folder/directory**
+#### **Example 9: Extracting a ZipArchiveEntry to folder/directory**
 
-{{region cs-radziplibrary-ziparchive-entry_8}}
+```csharp
                 
     ZipArchiveEntry entry = archive.GetEntry("file.txt");
     string path = Path.Combine(RootDirectory, entry.FullName);
@@ -147,7 +147,7 @@ Extract an entry to a specific folder/directory.
             entryStream.CopyTo(fileStream);
         }
     }   
-{{endregion}}
+```
 
 >tipThis functionality could be achieved by using the [Zip Extensions']({%slug radziplibrary-zipextensions%}) _ExtractToFile_ method as well.
 
@@ -157,9 +157,9 @@ Specific examples of using the ZipArchiveEntry.
 ### Using ZipArchiveEntry Properties
 A complete example including all the properties discussed above.
 
-#### **[C#] Example 10: Complete example**
+#### **Example 10: Complete example**
 
-{{region cs-radziplibrary-ziparchive-entry_9}}
+```csharp
                 
     string[] files = Directory.GetFiles("SampleFiles");
     string zipFileName = "ZipArchive.zip";
@@ -206,23 +206,23 @@ A complete example including all the properties discussed above.
             }
         }
     }
-{{endregion}}
+```
 
 ### Working with Folders/Directories
 
-#### **[C#] Example 11: Creating folders/directories**
+#### **Example 11: Creating folders/directories**
 
-{{region cs-radziplibrary-ziparchive-entry_10}}
+```csharp
                 
     ZipArchiveEntry entry = archive.CreateEntry("Documents/Sample/");
-{{endregion}}
+```
 
-#### **[C#] Example 12: Opening Files in folders/directories**
+#### **Example 12: Opening Files in folders/directories**
 
-{{region cs-radziplibrary-ziparchive-entry_11}}
+```csharp
                 
     ZipArchiveEntry entry = archive.GetEntry("Documents/Sample/file.txt");
-{{endregion}}
+```
 
 ## See Also
 
diff --git a/libraries/radziplibrary/gettingstarted.md b/libraries/radziplibrary/gettingstarted.md
index 23729a24..d39826de 100644
--- a/libraries/radziplibrary/gettingstarted.md
+++ b/libraries/radziplibrary/gettingstarted.md
@@ -48,9 +48,9 @@ The ZIP archive is represented by __ZipArchive__ class. It can be used in 3 mode
 The code snippet from __Example 1__ demonstrates how to open existing Zip archive using the __ZipArchive__ class.
         
 
-#### __[C#] Example 1: Open archive__
+#### __Example 1: Open archive__
 
-{{region cs-radziplibrary-gettingstarted_0}}
+```csharp
 	            
 	using (Stream stream = File.Open("test.zip", FileMode.Open))
 	{
@@ -59,19 +59,19 @@ The code snippet from __Example 1__ demonstrates how to open existing Zip archiv
 	        // Display the list of the files in the selected zip file using the ZipArchive.Entries property.
 	    }
 	}
-{{endregion}}
+```
 
 
 
-#### __[VB.NET] Example 1: Open archive__
+#### __Example 1: Open archive__
 
-{{region vb-radziplibrary-gettingstarted_0}}
+```csharp
 	Using stream As Stream = File.Open("test.zip", FileMode.Open)
 	    Using archive As ZipArchive = ZipArchive.Create(stream)
 	        ' Display the list of the files in the selected zip file using the ZipArchive.Entries property.
 	    End Using
 	End Using
-{{endregion}}
+```
 
 
 The *archive* variable holds the files that are compressed in the selected zip. You can access the list of these files through the __ZipArchive.Entries__ property. It holds a collection of [ZipArchiveEntry]({%slug radziplibrary-update-ziparchive%}) elements - the elements that describe the files archived in the zip file. You can use these elements to get the name of the compressed file, its uncompressed and compressed size and other file attributes.
@@ -82,9 +82,9 @@ The *archive* variable holds the files that are compressed in the selected zip.
 __Example 2__ shows how to create a new Zip archive using the __ZipArchive__ class and place a text file in it.
         
 
-#### __[C#] Example 2: Create archive__
+#### __Example 2: Create archive__
 
-{{region cs-radziplibrary-gettingstarted_1}}
+```csharp
 	    
 	using (Stream stream = File.Open("test.zip", FileMode.Create))
 	{
@@ -98,13 +98,13 @@ __Example 2__ shows how to create a new Zip archive using the __ZipArchive__ cla
 	        }
 	    }
 	}
-{{endregion}}
+```
 
 
 
-#### __[VB.NET] Example 2: Create archive__
+#### __Example 2: Create archive__
 
-{{region vb-radziplibrary-gettingstarted_1}}
+```csharp
 	Using stream As Stream = File.Open("test.zip", FileMode.Create)
 	    Using archive As ZipArchive = ZipArchive.Create(stream, Nothing)
 	        Using entry As ZipArchiveEntry = archive.CreateEntry("text.txt")
@@ -114,7 +114,7 @@ __Example 2__ shows how to create a new Zip archive using the __ZipArchive__ cla
 	        End Using
 	    End Using
 	End Using
-{{endregion}}
+```
 
 
 
@@ -125,9 +125,9 @@ __Example 2__ shows how to create a new Zip archive using the __ZipArchive__ cla
           
 The constructor of ZipArchive lets you specify whether you would like to keep the stream associated to the instance open. If you decide to set the `leaveOpen` parameter to `false`, the underlying stream will be closed once the ZipArchive instance is disposed. In case you need to continue working with that stream (to send it as a responce, for example), you should pass `true` for the `leaveOpen` parameter.
 
-#### __[C#] Example 3: Create archive in a MemoryStream__
+#### __Example 3: Create archive in a MemoryStream__
 
-{{region cs-radziplibrary-gettingstarted_2}}
+```csharp
 
     Stream memoryStream = new MemoryStream();
 
@@ -145,7 +145,7 @@ The constructor of ZipArchive lets you specify whether you would like to keep th
     
     // Save memoryStream to a file or send it to client
 
-{{endregion}}
+```
 
 For more complete examples head to the [Developer Focused Examples]({%slug radziplibrary-sdk-examples%}) section of the library.
 
diff --git a/troubleshooting/pdfprocessing.md b/troubleshooting/pdfprocessing.md
index 2673b40a..c6884ce3 100644
--- a/troubleshooting/pdfprocessing.md
+++ b/troubleshooting/pdfprocessing.md
@@ -22,22 +22,22 @@ The **.NET Standard** version of the [RadPdfProcessing]({%slug radpdfprocessing-
 
 In order to successfully export images different than **Jpeg** and **Jpeg2000** and **ImageQuality** different than **High** you will need to reference the **Telerik.Documents.ImageUtils** NuGet package in your project. The library also exposes the **FixedExtensibilityManager** class with two specific extensibility points: [ImagePropertiesResolver]({%slug radpdfprocessing-cross-platform-images%}#imagepropertiesresolver) and [JpegImageConverter]({%slug radpdfprocessing-cross-platform-images%}#jpegimageconverter). You would have to set the [ImagePropertiesResolver]({%slug radpdfprocessing-cross-platform-images%}#imagepropertiesresolver)/[JpegImageConverter]({%slug radpdfprocessing-cross-platform-images%}#jpegimageconverter) property or create a custom one inheriting the **ImagePropertiesResolverBase**/**JpegImageConverterBase** class.
 
-#### **[C#] Example 1: Set the default implementation of the ImagePropertiesResolver class**
-    {{region cs-troubleshooting_pdfprocessing_0}}
+#### **Example 1: Set the default implementation of the ImagePropertiesResolver class**
+    ```csharp
 
         Telerik.Documents.ImageUtils.ImagePropertiesResolver defaultImagePropertiesResolver = new Telerik.Documents.ImageUtils.ImagePropertiesResolver();
         Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.ImagePropertiesResolver = defaultImagePropertiesResolver;
-    {{endregion}}
+    ```
 
-#### **[C#] Example 2: Set the default implementation of the JpegImageConverter class**
-    {{region cs-troubleshooting_pdfprocessing_1}}
+#### **Example 2: Set the default implementation of the JpegImageConverter class**
+    ```csharp
 
        Telerik.Windows.Documents.Extensibility.JpegImageConverterBase defaultJpegImageConverter = new Telerik.Documents.ImageUtils.JpegImageConverter();
        Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.JpegImageConverter = defaultJpegImageConverter;
-    {{endregion}}
+    ```
 
-#### **[C#] Example 3: Create a custom implementation inheriting the JpegImageConverterBase abstract class**
-    {{region cs-troubleshooting_pdfprocessing_2}}
+#### **Example 3: Create a custom implementation inheriting the JpegImageConverterBase abstract class**
+    ```csharp
 
         internal class CustomJpegImageConverter : Telerik.Windows.Documents.Extensibility.JpegImageConverterBase
         {
@@ -61,7 +61,7 @@ In order to successfully export images different than **Jpeg** and **Jpeg2000**
                 return false;
             }
         }
-    {{endregion}}
+    ```
 
 
 You can read more about the [requirements]({%slug radpdfprocessing-cross-platform-images%}#requirements) and implementation in the [PdfProcessing Cross-Platform Images]({%slug radpdfprocessing-cross-platform-images%}) article.