Skip to content

Commit e8b3a9b

Browse files
1010339: Core documentation revamp
1 parent a51fb7f commit e8b3a9b

25 files changed

Lines changed: 223 additions & 174 deletions

Document-Processing/PDF/PDF-Viewer/asp-net-core/annotation/free-text-annotation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Free text annotations can be added to PDF documents using the built-in annotatio
3535
- Type your text directly into the text box
3636
- Use the formatting toolbar to adjust font, size, color, and alignment
3737

38-
> **Note:** When in pan mode and free text annotation is selected, the PDF Viewer automatically switches to text select mode for smooth interaction.
38+
N> When in pan mode and free text annotation is selected, the PDF Viewer automatically switches to text select mode for smooth interaction.
3939

4040
**Example: Enable free text annotation mode**
4141

Document-Processing/PDF/PDF-Viewer/asp-net-core/annotation/shape-annotation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Shape annotations can be added to PDF documents using the built-in annotation to
4646
- Release to complete the shape placement
4747
- Use handles to resize and reposition as needed
4848

49-
> **Note:** When in pan mode and a shape annotation tool is selected, the PDF Viewer automatically switches to text select mode for smooth interaction.
49+
N> When in pan mode and a shape annotation tool is selected, the PDF Viewer automatically switches to text select mode for smooth interaction.
5050

5151
**Example: Switch to circle annotation mode**
5252

Document-Processing/PDF/PDF-Viewer/asp-net-core/event.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The following table lists all events supported by the PDF Viewer control, organi
6666
| [`validateFormFields`](#validateformfields) | Triggers when form field validation fails. |
6767
| [`zoomChange`](#zoomchange) | Triggers when the magnification value changes. |
6868

69-
Note: For annotation and signature events, see the dedicated Annotations Events topic.
69+
For annotation and signature events, see the dedicated Annotations Events topic.
7070

7171
## bookmarkClick
7272

Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/Instantiate-pdfviewer-dynamically.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ documentation: ug
99

1010
# Dynamically instantiate the ASP.NET Core PDF Viewer
1111

12-
Create the Syncfusion<sup style="font-size:70%">&reg;</sup> PDF Viewer instance at runtime when a document request succeeds, instead of rendering it during the initial page load. This approach is useful when the PDF is determined after user input or must be fetched securely from a server endpoint.
12+
The Syncfusion<sup style="font-size:70%">&reg;</sup> ASP.NET Core PDF Viewer can be instantiated at runtime rather than during the initial page load. This dynamic approach is useful when the document to be displayed depends on user interaction or must be retrieved from a secure backend service.
1313

14-
Follow these steps to instantiate the component dynamically:
14+
Follow these steps to instantiate the viewer component programmatically:
1515

16-
- Confirm that the application references the required Syncfusion EJ2 scripts and styles and that the PDF Viewer service endpoint is available in the ASP.NET Core application.
17-
- Add a container element and a button (or another trigger) to the Razor view. The trigger initiates an AJAX request that retrieves the document information.
18-
- Inside the callback, create a new viewer instance, set its [`serviceUrl`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_serviceUrl) to the controller endpoint, assign the document identifier to [`documentPath`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_documentPath), and call `appendTo` to render the control in the container.
16+
1. **Verify Prerequisites:** Ensure your application references the required Syncfusion EJ2 script and style assets. The backend PDF Viewer service must be correctly configured in your ASP.NET Core application.
17+
2. **Setup Container:** Add a target container element and a trigger (such as a button) to the Razor view.
18+
3. **Initialize Component:** To create the viewer instance, configure the [`serviceUrl`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_ServiceUrl) and [`documentPath`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_DocumentPath), and then mount it using the `appendTo` method.
19+
20+
The following example demonstrates how to load the viewer dynamically after an AJAX request:
1921

2022
```html
2123

@@ -42,6 +44,6 @@ Follow these steps to instantiate the component dynamically:
4244

4345
```
4446

45-
Ensure that the controller action returns the PDF file or document token expected by the viewer and that the response respects authentication requirements. Dispose of the dynamically created viewer when it is no longer needed to release resources.
47+
Ensure the controller action returns a valid PDF file path, stream, or base64 string supported by the viewer. For optimal performance, properly dispose of the viewer instance using the `destroy()` method when the container is removed or the document is no longer required.
4648

4749
[View Sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/Common/Instantiate%20PDF%20Viewer%20dynamically).

Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/export-as-image.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ control: PDF Viewer
77
documentation: ug
88
---
99

10-
# Export pages as images in the ASP.NET Core PDF Viewer
10+
# Export PDF pages as images in ASP.NET Core PDF Viewer
1111

12-
Export individual pages or a range of pages from a PDF document as raster images using the `ExportAsImage` APIs. These helpers convert pages to bitmaps that you can save, process, or serve for download.
12+
The Syncfusion<sup style="font-size:70%">&reg;</sup> ASP.NET Core PDF Viewer provides the `ExportAsImage` APIs to convert individual pages or a range of pages into raster images. These images can be saved to disk, processed in-memory, or served as downloads in your application.
1313

1414
## Steps to export pages as images
1515

16-
**Step 1:** Follow the steps in the [Syncfusion ASP.NET Core PDF Viewer getting started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-core/getting-started) to create a simple PDF Viewer application.
16+
**Step 1:** Create an ASP.NET Core PDF Viewer application by following the [getting started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-core/getting-started).
1717

18-
**Step 2:** Choose the appropriate `ExportAsImage` overload to export pages with the required DPI, size, or range settings. The following examples demonstrate each option.
18+
**Step 2:** Use the `PdfRenderer` class to load the document and invoke the appropriate `ExportAsImage` overload based on the requirements.
1919

2020
### Export a single page
2121

22-
Exports the specified page as image using the Pdfium rendering engine.
22+
Convert a specific page to a `Bitmap` using the default rendering settings.
2323

2424
```cs
2525

@@ -34,9 +34,9 @@ bitmapimage.Save(@"currentDirectory\..\..\..\..\Images\" + "bitmapImage" + i.ToS
3434

3535
```
3636

37-
### Export a page with custom DPI
37+
### Export with custom DPI or size
3838

39-
Exports the specified page as image with respect to the specified DPI values.
39+
To control the resolution or dimensions of the exported image, use the overloads that accept DPI values or `SizeF` objects.
4040

4141
```cs
4242

@@ -87,7 +87,7 @@ bitmapimage.Save(@"currentDirectory\..\..\..\..\Images\" + "bitmapImage" + i.ToS
8787

8888
### Export a range of pages
8989

90-
Exports the specified pages as images using the Pdfium rendering engine.
90+
Retrieve an array of bitmaps for a specific page range.
9191

9292
```cs
9393

@@ -192,8 +192,6 @@ using (var stream = new FileStream(Path.Combine(@"currentDirectory\..\..\..\..\D
192192

193193
```
194194

195-
These APIs enable exporting PDF Viewer pages as images for additional processing or download workflows.
195+
[View complete sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/Common/Export%20as%20Image%20in%20ASP.NET%20Core%206.0/ExportImageindotnet6)
196196

197-
[View Sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/Common/Export%20as%20Image%20in%20ASP.NET%20Core%206.0/ExportImageindotnet6)
198-
199-
N> Ensure the provided document path and the output image save locations are updated to match your application.
197+
N> Ensure the application has appropriate read/write permissions for the document and image directories. For cross-platform deployments, refer to the [PDFium resolution guide](./resolve-pdfium-issue) to configure native dependencies.

Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/extract-text-option.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@ control: PDF Viewer
77
documentation: ug
88
---
99

10-
# Configure extractTextOption in the ASP.NET Core PDF Viewer
10+
# Configure extractTextOption in ASP.NET Core PDF Viewer
1111

12-
The `extractTextOption` property controls how text is extracted and optimizes memory usage. It also affects the data returned in the `extractTextCompleted` event. Choose one of the following options to determine the text and layout data to retrieve.
13-
14-
### Available Options:
15-
16-
**None:** No text information is extracted or returned. This is useful when you want to optimize memory usage and don't need any text data.
12+
The Syncfusion<sup style="font-size:70%">&reg;</sup> ASP.NET Core PDF Viewer provides the [`extractTextOption`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_ExtractTextOption) property to control how the component extracts text data. Adjusting this property allows you to optimize memory consumption and determine the specific metadata returned in the `extractTextCompleted` event.
1713

18-
**TextOnly:** Extracts only the plain text from the document. This option excludes any layout or positional information.
14+
## Available options
1915

20-
**BoundsOnly:** Extracts layout information, such as bounds or coordinates, without including the plain text data.
16+
The following values can be assigned to `extractTextOption`:
2117

22-
**TextAndBounds:** Extracts both the plain text and the layout (bounds) information, which is the default behavior.
18+
* **None:** Disables text extraction entirely. Use this to minimize memory footprint when text interactions or extraction are not required.
19+
* **TextOnly:** Extracts plain text strings only. This option excludes all layout, positional, and coordinate metadata.
20+
* **BoundsOnly:** Extracts positional information (bounds) for text elements without retrieving the actual text content.
21+
* **TextAndBounds (default):** Extracts both string content and corresponding layout metadata.
2322

24-
The following example demonstrates how to configure the `extractTextOption` property to control the level of text extraction:
23+
The following example demonstrates how to set `extractTextOption` to `None` in a standalone viewer configuration:
2524

2625
{% tabs %}
2726
{% highlight cshtml tabtitle="Standalone" %}
@@ -44,16 +43,18 @@ The following example demonstrates how to configure the `extractTextOption` prop
4443
{% endhighlight %}
4544
{% endtabs %}
4645

47-
### Description of each option
48-
**extractTextOption.TextAndBounds (default):** Returns both plain text and positional data (bounds). Use this option when you need both the content of the PDF and its layout for further processing.
46+
The `extractTextOption` property controls how text is extracted and optimizes memory usage. It also affects the data returned in the `extractTextCompleted` event. Choose one of the following options to determine the text and layout data to retrieve.
47+
48+
### Available Options:
49+
50+
**None:** No text information is extracted or returned. This is useful when you want to optimize memory usage and don't need any text data.
4951

50-
**extractTextOption.TextOnly:** Returns only the plain text from the PDF. No positional data is included. Text search functionality is disabled when using this option; use `findTextAsync` for searching.
52+
**TextOnly:** Extracts only the plain text from the document. This option excludes any layout or positional information.
5153

52-
**extractTextOption.BoundsOnly:** Returns only layout information (bounds) of the text, excluding the actual content. Useful when focusing on text positions rather than the text itself.
54+
**BoundsOnly:** Extracts layout information, such as bounds or coordinates, without including the plain text data.
5355

54-
**extractTextOption.None:** Does not extract or return any text or layout information. Use this setting to optimize memory usage when text extraction is unnecessary. This setting applies to the `extractTextCompleted` event and cannot be used with the `ExtractText` method.
56+
**TextAndBounds:** Extracts both the plain text and the layout (bounds) information, which is the default behavior.
5557

56-
N> Text search: When using the `extractTextOption.TextOnly` or `extractTextOption.None` options, the `findText` method is unavailable. Use the `findTextAsync` method to perform text searches asynchronously.
58+
N> **Text Search Compatibility:** When `extractTextOption` is set to `TextOnly` or `None`, the standard `findText` method is unavailable. Use the `findTextAsync` method to perform asynchronous text searches in these modes.
5759

58-
Sample: How to configure extractTextOption
5960
[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to)

Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/get-page-info.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ control: PDF Viewer
77
documentation: ug
88
---
99

10-
# Get page info in the ASP.NET Core PDF Viewer
10+
# Retrieve page information in ASP.NET Core PDF Viewer
1111

12-
Use the `getPageInfo()` method to retrieve information for a specified page, including height, width, and rotation.
12+
The Syncfusion<sup style="font-size:70%">&reg;</sup> ASP.NET Core PDF Viewer provides the `getPageInfo()` method to programmatically retrieve metadata for a specific page. This metadata includes the page height, width, and current rotation angle.
1313

14-
The following steps show how to use `getPageInfo`.
14+
Follow these steps to integrate the page information API into your application:
1515

16-
**Step 1:** Follow the steps in the [Syncfusion ASP.NET Core PDF Viewer getting started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-core/getting-started) to create a sample.
16+
**Step 1:** Initialize your PDF Viewer project by following the [ASP.NET Core getting started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-core/getting-started).
1717

18-
**Step 2:** Use the following code to get the height, width, and rotation for a specified page.
18+
**Step 2:** Invoke the `getPageInfo()` method using the page index (zero-based) to retrieve the required metadata.
19+
20+
The following example demonstrates how to retrieve and log page details when a button is clicked:
1921

2022
{% tabs %}
2123
{% highlight cshtml tabtitle="Standalone" %}
@@ -59,6 +61,6 @@ document.addEventListener('DOMContentLoaded', function () {
5961
{% endhighlight %}
6062
{% endtabs %}
6163

62-
By following these steps, the page info API can be integrated and used in the ASP.NET Core PDF Viewer.
64+
The `getPageInfo()` method returns an object containing the spatial dimensions and orientation of the specified page, which is essential for custom layout calculations or rendering overlays.
6365

6466
[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to)

Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/identify-added-annotation-mode.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@ layout: post
33
title: Identify annotation mode in ASP.NET Core PDF Viewer | Syncfusion
44
description: Learn here all about Identify added annotation mode in Syncfusion ASP.NET Core PDF Viewer control of Syncfusion Essential JS 2 and more.
55
platform: document-processing
6-
control: Identify added annotation mode
6+
control: PDF Viewer
77
documentation: ug
88
---
99

10-
# Identify added annotation mode in ASP.NET Core PDF Viewer
10+
# Identify annotation addition mode
1111

12-
The PDF Viewer library allows you to identify whether the added annotations in PDF document is UI drawn, imported or existing annotation. Annotation mode can be identified using the [**annotationAddMode**](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_AnnotationAdd) property of [**annotationSelect**](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_AnnotationSelect) event.
12+
The Syncfusion<sup style="font-size:70%">&reg;</sup> ASP.NET Core PDF Viewer allows you to verify how an annotation was added to the document. By inspecting the [`annotationAddMode`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_AnnotationAdd) property within the [`annotationSelect`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_AnnotationSelect) event, you can distinguish between annotations that were manually drawn by the user, imported from a data source, or pre-existing in the PDF file.
1313

14-
**Step 1:** Follow the steps provided in the [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-core/getting-started) to create simple PDF Viewer sample.
14+
## Implementation guide
1515

16-
**Step 2:** The following code snippet explains how to identify added annotation mode.
16+
Follow these steps to identify the addition mode of an annotation:
17+
18+
**Step 1:** Initialize a PDF Viewer project by following the [ASP.NET Core getting started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-core/getting-started).
19+
20+
**Step 2:** Subscribe to the `annotationSelect` event and log the `annotationAddMode` property from the event arguments.
21+
22+
The following example demonstrates this implementation across standalone and server-backed configurations:
1723

1824
{% tabs %}
1925
{% highlight cshtml tabtitle="Standalone" %}
@@ -22,13 +28,13 @@ The PDF Viewer library allows you to identify whether the added annotations in P
2228
<ejs-pdfviewer id="pdfviewer"
2329
style="height:600px"
2430
documentPath="https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf"
25-
resourceUrl="https://cdn.syncfusion.com/ej2/31.1.17/dist/ej2-pdfviewer-lib"
26-
annotationSelect=annotationSelected>
31+
resourceUrl="https://cdn.syncfusion.com/ej2/31.1.17/dist/ej2-pdfviewer-lib">
2732
</ejs-pdfviewer>
2833
</div>
2934

3035
<script>
31-
function annotationSelected(args) {
36+
const viewer = document.getElementById("pdfviewer").ej2_instances[0];
37+
viewer.annotationSelect = function annotationSelected(args) {
3238
console.log(args.annotationAddMode);
3339
}
3440
</script>
@@ -40,13 +46,13 @@ The PDF Viewer library allows you to identify whether the added annotations in P
4046
<ejs-pdfviewer id="pdfviewer"
4147
style="height:600px"
4248
documentPath="https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf"
43-
serviceUrl="/api/PdfViewer"
44-
annotationSelect=annotationSelected>
49+
serviceUrl="/api/PdfViewer">
4550
</ejs-pdfviewer>
4651
</div>
4752

4853
<script>
49-
function annotationSelected(args) {
54+
const viewer = document.getElementById("pdfviewer").ej2_instances[0];
55+
viewer.annotationSelect = function annotationSelected(args) {
5056
console.log(args.annotationAddMode);
5157
}
5258
</script>

0 commit comments

Comments
 (0)