You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/asp-net-core/annotation/shape-annotation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Shape annotations can be added to PDF documents using the built-in annotation to
46
46
- Release to complete the shape placement
47
47
- Use handles to resize and reposition as needed
48
48
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.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/Instantiate-pdfviewer-dynamically.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,15 @@ documentation: ug
9
9
10
10
# Dynamically instantiate the ASP.NET Core PDF Viewer
11
11
12
-
Create the Syncfusion<supstyle="font-size:70%">®</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<supstyle="font-size:70%">®</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.
13
13
14
-
Follow these steps to instantiate the component dynamically:
14
+
Follow these steps to instantiate the viewer component programmatically:
15
15
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:
19
21
20
22
```html
21
23
@@ -42,6 +44,6 @@ Follow these steps to instantiate the component dynamically:
42
44
43
45
```
44
46
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.
46
48
47
49
[View Sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/Common/Instantiate%20PDF%20Viewer%20dynamically).
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/export-as-image.md
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,19 +7,19 @@ control: PDF Viewer
7
7
documentation: ug
8
8
---
9
9
10
-
# Export pages as images in the ASP.NET Core PDF Viewer
10
+
# Export PDF pages as images in ASP.NET Core PDF Viewer
11
11
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<supstyle="font-size:70%">®</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.
13
13
14
14
## Steps to export pages as images
15
15
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).
17
17
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.
19
19
20
20
### Export a single page
21
21
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.
Exports the specified pages as images using the Pdfium rendering engine.
90
+
Retrieve an array of bitmaps for a specific page range.
91
91
92
92
```cs
93
93
@@ -192,8 +192,6 @@ using (var stream = new FileStream(Path.Combine(@"currentDirectory\..\..\..\..\D
192
192
193
193
```
194
194
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)
196
196
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.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/extract-text-option.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,21 +7,20 @@ control: PDF Viewer
7
7
documentation: ug
8
8
---
9
9
10
-
# Configure extractTextOption in the ASP.NET Core PDF Viewer
10
+
# Configure extractTextOption in ASP.NET Core PDF Viewer
11
11
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<supstyle="font-size:70%">®</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.
17
13
18
-
**TextOnly:** Extracts only the plain text from the document. This option excludes any layout or positional information.
14
+
## Available options
19
15
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`:
21
17
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.
23
22
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:
25
24
26
25
{% tabs %}
27
26
{% highlight cshtml tabtitle="Standalone" %}
@@ -44,16 +43,18 @@ The following example demonstrates how to configure the `extractTextOption` prop
44
43
{% endhighlight %}
45
44
{% endtabs %}
46
45
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.
49
51
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.
51
53
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.
53
55
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.
55
57
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.
57
59
58
-
Sample: How to configure extractTextOption
59
60
[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to)
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/get-page-info.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,17 @@ control: PDF Viewer
7
7
documentation: ug
8
8
---
9
9
10
-
# Get page info in the ASP.NET Core PDF Viewer
10
+
# Retrieve page information in ASP.NET Core PDF Viewer
11
11
12
-
Use the `getPageInfo()` method to retrieve information for a specified page, including height, width, and rotation.
12
+
The Syncfusion<supstyle="font-size:70%">®</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.
13
13
14
-
The following steps show how to use `getPageInfo`.
14
+
Follow these steps to integrate the page information API into your application:
15
15
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).
17
17
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:
19
21
20
22
{% tabs %}
21
23
{% highlight cshtml tabtitle="Standalone" %}
@@ -59,6 +61,6 @@ document.addEventListener('DOMContentLoaded', function () {
59
61
{% endhighlight %}
60
62
{% endtabs %}
61
63
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.
63
65
64
66
[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to)
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/identify-added-annotation-mode.md
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,17 +3,23 @@ layout: post
3
3
title: Identify annotation mode in ASP.NET Core PDF Viewer | Syncfusion
4
4
description: Learn here all about Identify added annotation mode in Syncfusion ASP.NET Core PDF Viewer control of Syncfusion Essential JS 2 and more.
5
5
platform: document-processing
6
-
control: Identify added annotation mode
6
+
control: PDF Viewer
7
7
documentation: ug
8
8
---
9
9
10
-
# Identify added annotation mode in ASP.NET Core PDF Viewer
10
+
# Identify annotation addition mode
11
11
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<supstyle="font-size:70%">®</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.
13
13
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
15
15
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:
17
23
18
24
{% tabs %}
19
25
{% highlight cshtml tabtitle="Standalone" %}
@@ -22,13 +28,13 @@ The PDF Viewer library allows you to identify whether the added annotations in P
0 commit comments