diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/create-aspnet-mvc-project.png b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/create-aspnet-mvc-project.png deleted file mode 100644 index 5bf460041a..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/create-aspnet-mvc-project.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/pdfviewer-control.png b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/pdfviewer-control.png deleted file mode 100644 index 46fb505fbe..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/pdfviewer-control.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/select-web-application-project.png b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/select-web-application-project.png deleted file mode 100644 index 3071b64442..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/select-web-application-project.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/set-project-name.png b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/set-project-name.png deleted file mode 100644 index 5638cbc2fb..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/AspNetMVC_Images/set-project-name.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/accessibility.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/accessibility.md deleted file mode 100644 index a7f64bb46e..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/accessibility.md +++ /dev/null @@ -1,215 +0,0 @@ ---- -layout: post -title: Accessibility with EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about accessibility in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Accessibility in Syncfusion® PDF Viewer components - -The PDF Viewer component followed the accessibility guidelines and standards, including [ADA](https://www.ada.gov/), [Section 508](https://www.section508.gov/), [WCAG 2.2](https://www.w3.org/TR/WCAG22/) standards, and [WCAG roles](https://www.w3.org/TR/wai-aria/#roles) that are commonly used to evaluate accessibility. - -The accessibility compliance for the PDF Viewer component is outlined below. - -| Accessibility Criteria | Compatibility | -| -- | -- | -| [WCAG 2.2 Support]| Yes | -| [Section 508 Support] | Yes | -| [Screen Reader Support]| Yes | -| [Right-To-Left Support]| Yes | -| [Color Contrast] | Yes | -| [Mobile Device Support]| Intermediate | -| [Keyboard Navigation Support]| Yes | -| [Accessibility Checker Validation] | Yes | -| [Axe-core Accessibility Validation]| Yes | - - -
Yes - All features of the component meet the requirement.
- -
Intermediate - Some features of the component do not meet the requirement.
- -
No - The component does not meet the requirement.
- -## WAI-ARIA attributes - -[WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/alert/) (Accessibility Initiative – Accessible Rich Internet Applications) defines a way to increase the accessibility of web pages, dynamic content, and user interface components developed with Ajax, HTML, JavaScript,and related technologies. ARIA provides additional semantics to describe the role, state, and functionality of web components. The following ARIA attributes are used in the PDF Viewer component: - -| Attributes | Purpose | -| --- | --- | -| `aria-disabled`| Indicates whether the PDF Viewer component is in a disabled state or not.| -| `aria-expanded`| Indicates whether the suggestion list has expanded or not. | -| `aria-readonly` | Indicates the readonly state of the PDF Viewer element. | -| `aria-haspopup` | Indicates whether the PDF Viewer input element has a suggestion list or not. | -| `aria-label` | Indicates the breadcrumb item text. | -| `aria-labelledby` | Provides a label for the PDF Viewer. Typically, the "aria-labelledby" attribute will contain the id of the element used as the PDF Viewer's title. | -| `aria-describedby` | This attribute points to the PDF Viewer element describing the one it's set on. | -| `aria-orientation` | Indicates whether the PDF Viewer element is oriented horizontally or vertically. | -| `aria-valuetext` | Returns the current text of the PDF Viewer. | -| `aria-valuemax` | Indicates the Maximum value of the PDF Viewer. | -| `aria-valuemin` | Indicates the Minimum value of the PDF Viewer. | -| `aria-valuenow` | Indicates the current value of the PDF Viewer. | -| `aria-controls` | Attribute is set to the button and it points to the corresponding content. | - -## Keyboard interaction - -The PDF Viewer component followed the [keyboard interaction](https://www.w3.org/WAI/ARIA/apg/patterns/alert/#keyboardinteraction) guideline, making it easy for people who use assistive technologies (AT) and those who completely rely on keyboard navigation. The following keyboard shortcuts are supported by the Message component. - -| **Press (Windows)** |**Press (Macintosh)** | **To do this** | -| --- | --- | --- | -|||**Shortcuts for page navigation**| -| CONTROL + Left Arrow (or) CONTROL + Up Arrow | COMMAND + Left Arrow (or) COMMAND + Up Arrow |Navigate to the first page | -| CONTROL + Right Arrow (or) CONTROL + Down Arrow |COMMAND + Right Arrow (or) COMMAND + Down Arrow |Navigate to the last page | -|Left Arrow | Left Arrow (or) Shift + Space |Navigate to the previous page| -| Right Arrow | Right Arrow (or) Space | Navigate to the next page | -| CONTROL + G | COMMAND + G | Go To The Page| -|Up Arrow |Up Arrow |Scroll up| -| Down Arrow | Down Arrow | Scroll down| -|||**Shortcuts for Zooming**| -|CONTROL + = |COMMAND + = | Perform zoom-in operation | -| CONTROL + - | COMMAND + - | Perform zoom-out operation | -|CONTROL + 0 |COMMAND + 0 | Retain the zoom level to 1 | -|||**Shortcut for Text Search**| -| CONTROL + F | COMMAND + F |Open the search toolbar| -|||**Shortcut for Text Selection**| -|CONTROL + C |CONTROL + C | Copy the selected text or annotation or form field | -| CONTROL + X | CONTROL + X |Cut the selected text or annotation of the form field| -|CONTROL + Y |CONTROL + Y |Paste the selected text or annotation or form field| -|||**Shortcuts for the general operation**| -| CONTROL + Z | CONTROL + Z |Undo the action| -|CONTROL + Y |CONTROL + Y |Redo the action| -| CONTROL + P | COMMAND + P |Print the document| -|Delete |Delete |Delete the annotations and form fields| -|CONTROL + Shift + A |COMMAND + Shift + A |Toggle Annotation Toolbar| -|CONTROL + Alt + 0 |COMMAND + Option + 0 |Show Command panel| -|CONTROL + Alt + 2 |COMMAND + Option + 2 |Show Bookmarks| -|CONTROL + Alt + 1 |COMMAND + Option + 1 |Show Thumbnails| -|CONTROL + S |COMMAND + S |Download| -|Shift + H |Shift + H |Enable pan mode| -|Shift + V |Shift + V |Enable text selection mode| - -The current implementation of our PDF Viewer includes keyboard shortcuts for various functions like scrolling, zooming, text search, printing, and annotation deletion. - -To enhance user experience, we're adding additional keyboard shortcuts for actions such as navigating between pages, accessing specific pages, toggling annotation tools, and displaying PDF elements like outlines, annotations, bookmarks, and thumbnails. - -To support this, we're introducing a new class called **commandManager**, which handles custom commands triggered by specific key gestures. These custom commands will be defined by users and executed accordingly. - -The **commandManager** will have a parameter called Commands, which will hold the collection of custom keyboard commands specified by users. Each custom command will be represented by a KeyboardCommand class, containing the `command name` and associated `keyboard combination`. - -Additionally, we're introducing the **keyboardCustomCommands** parameter for the CommandManager, which will utilize the EventCallback to handle keyboard events and trigger appropriate methods when specific key combinations are pressed. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").EnablePrint(true).DocumentLoad("print").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").CommandManager("commandManager").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnablePrint(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").CommandManager("commandManager").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -Each `keyboardCommand` object consists of a name property, specifying the `name` of the `custom command`, and a `gesture property`, defining the key gesture associated with the command. - -For example, the first command named `customCopy` is associated with the **G** key and requires both the **Shift** and **Alt** modifier keys to be pressed simultaneously. - -Additionally, there's an explanation of the key modifiers used in the gestures: - -* Ctrl corresponds to the Control key, represented by the value `1`. -* Alt corresponds to the Alt key, represented by the value `2`. -* Shift corresponds to the Shift key, represented by the value `4`. -* Meta corresponds to the Command key on macOS or the Windows key on Windows, represented by the value `8`. - -This setup allows users to perform custom actions within the PDF viewer by pressing specific key combinations, enhancing the user experience and providing more efficient navigation and interaction options. - -## Ensuring accessibility - -The PDF Viewer component's accessibility levels are ensured through an [accessibility-checker](https://www.npmjs.com/package/accessibility-checker) and [axe-core](https://www.npmjs.com/package/axe-core) software tools during automated testing. - -The accessibility compliance of the PDF Viewer component is shown in the following sample. Open the [sample](https://ej2.syncfusion.com/accessibility/pdfviewer.html) in a new window to evaluate the accessibility of the PDF Viewer component with accessibility tools. - -{% previewsample "https://ej2.syncfusion.com/accessibility/pdfviewer.html" %} - - -N> Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/comments.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/comments.md deleted file mode 100644 index 4545497e05..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/comments.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -layout: post -title: Comments in ##Platform_Name## PDF Viewer Component | Syncfusion -description: Learn here all about Comments in Syncfusion ##Platform_Name## PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Comments -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Comments in the ASP.NET MVC PDF Viewer component - -The PDF Viewer control provides options to add, edit, and delete the comments to the following annotation in the PDF documents: - -* Shape annotation -* Stamp annotation -* Sticky note annotation -* Measurement annotation -* Text markup annotation -* Free text annotation -* Ink annotation - -![Comments](../images/commentannot.png) - -## Adding a comment to the annotation - -Annotation comment, comment replies, and status can be added to the PDF document using the comment panel. - -### Comment panel - -Annotation comments can be added to the PDF using the comment panel. The comment panel can be opened in the following ways: - -1. Using the annotation menu - - * Click the Edit Annotation button in the PDF Viewer toolbar. A toolbar appears below it. - * Click the Comment Panel button. A comment panel will appear. - -2. Using Context menu - - * Select annotation in the PDF document and right-click it. - * Select the comment option in the context menu that appears. - -3. Using the Mouse click - - * Select annotation in the PDF document and double click it, a comment panel will appear. - -If the comment panel is already in the open state, you can select the annotations and add annotation comments using the comment panel. - -### Adding comments - -* Select annotation in the PDF document and click it. -* The selected annotation comment container is highlighted in the comment panel. -* Now, you can add comment and comment replies using the comment panel. - -![AddingComments](../images/stickycomment.png) - -### Adding Comment Replies - -* The PDF Viewer control provides an option to add multiple replies to the comment. -* After adding the annotation comment, you can add a reply to the comment. - -### Adding Comment or Reply Status - -* Select the Annotation Comments in the comment panel. -* Click the more options button showing in the Comments or reply container. -* Select the Set Status option in the context menu that appears. -* Select the status of the annotation comment in the context menu that appears. - -![CommentStatus](../images/commentstatus.png) - -### Editing the comments and comments replies of the annotations - -The comment, comment replies, and status of the annotation can be edited using the comment panel. - -### Editing the Comment or Comment Replies - -The annotation comment and comment replies can be edited in the following ways: - -1. Using the Context menu - - * Select the Annotation Comments in the comment panel. - * Click the More options button showing in the Comments or reply container. - * Select the Edit option in the context menu that appears. - * Now, an editable text box appears. You can change the content of the annotation comment or comment reply. - -2. Using the Mouse Click - - * Select the annotation comments in the comment panel. - * Double click the comment or comment reply content. - * Now, an editable text box appears. You can change the content of the annotation comment or comment reply. - -### Editing Comment or Reply Status - -* Select the Annotation Comments in the comment panel. -* Click the more options button showing in the Comments or reply container. -* Select the Set Status option in the context menu that appears. -* Select the status of the annotation comment in the context menu that appears. -* Status ‘None’ is the default state. If the status is set to ‘None,’ the comments or reply does not appear. - -![CommentEdit](../images/commentsedit.png) - -### Delete Comment or Comment Replies - -* Select the Annotation Comments in the comment panel. -* Click the more options button shown in the Comments or reply container. -* Select the Delete option in the context menu that appears. - -![CommentEdit](../images/commentsdelete.png) - -N>The annotation will be deleted on deleting the comment using comment panel. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/free-text-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/free-text-annotation.md deleted file mode 100644 index c964765c22..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/free-text-annotation.md +++ /dev/null @@ -1,291 +0,0 @@ ---- -layout: post -title: Free Text Annotation in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Free Text Annotation in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Free Text Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Free Text Annotation in the ASP.NET MVC PDF Viewer component - -The PDF Viewer control provides the options to add, edit, and delete the free text annotations. - -## Adding a free text annotation to the PDF document - -The Free text annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Select the **Free Text Annotation** button in the annotation toolbar. It enables the Free Text annotation mode. -* You can add the text over the pages of the PDF document. - -In the pan mode, if the free text annotation mode is entered, the PDF Viewer control will switch to text select mode. - -![FreeTextAnnotation in ASP.NET MVC PDF Viewer](../images/freetext_tool.png) - -Refer to the following code sample to switch to the Free Text annotation mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} - -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Adding a free text annotation programmatically to the PDF document - -The PDF Viewer library allows you to add the free text annotation in the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here is an example of how you can use the **addAnnotation()** method to move the free text annotation programmatically: - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -## Change the content of an existing Free text annotation programmatically - -To change the content of an existing free text annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method to change the content of a free text annotation: - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -## Editing the properties of free text annotation - -The font family, font size, font styles, font color, text alignment, fill color, the border stroke color, border thickness, and opacity of the free text annotation can be edited using the Font Family tool, Font Size tool, Font Color tool, Text Align tool, Font Style tool Edit Color tool, Edit Stroke Color tool, Edit Thickness tool, and Edit Opacity tool in the annotation toolbar. - -### Editing font family - -The font family of the annotation can be edited by selecting the desired font in the Font Family tool. - -![FontFamily](../images/fontfamily.png) - -### Editing font size - -The font size of the annotation can be edited by selecting the desired size in the Font Size tool. - -![FontSize](../images/fontsize.png) - -### Editing font color - -The font color of the annotation can be edited using the color palette provided in the Font Color tool. - -![FontColor](../images/fontcolor.png) - -### Editing the text alignment - -The text in the annotation can be aligned by selecting the desired styles in the drop-down pop-up in the Text Align tool. - -![FreeTextAnnotation](../images/textalign.png) - -### Editing text styles - -The style of the text in the annotation can be edited by selecting the desired styles in the drop-down pop-up in the Font Style tool. - -![FontStyle](../images/fontstyle.png) - -### Editing fill color - -The fill color of the annotation can be edited using the color palette provided in the Edit Color tool. - -![FillColor](../images/fillcolor.png) - -### Editing stroke color - -The stroke color of the annotation can be edited using the color palette provided in the Edit Stroke Color tool. - -![StrokeColor](../images/fontstroke.png) - -### Editing thickness - -The border thickness of the annotation can be edited using the range slider provided in the Edit Thickness tool. - -![FontThickness](../images/fontthickness.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![FontOpacity](../images/fontopacity.png) - -## Setting default properties during control initialization - -The properties of the free text annotation can be set before creating the control using the FreeTextSettings. - -After editing the default values, they will be changed to the selected values. -Refer to the following code sample to set the default free text annotation settings. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").FreeTextSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerFreeTextSettings { FillColor = "green", BorderColor = "blue", FontColor = "yellow" }).Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").FreeTextSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerFreeTextSettings { FillColor = "green", BorderColor = "blue", FontColor = "yellow" }).Render() -
- -{% endhighlight %} -{% endtabs %} - -You can also enable the autofit support for free text annotation by using the EnableAutoFit boolean property in FreeTextSettings as below. The width of the free text rectangle box will be increased based on the text added to it. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").FreeTextSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerFreeTextSettings { EnableAutoFit = true }).Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").FreeTextSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerFreeTextSettings { EnableAutoFit = true }).Render() -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/ink-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/ink-annotation.md deleted file mode 100644 index 2dc4e041b3..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/ink-annotation.md +++ /dev/null @@ -1,197 +0,0 @@ ---- -layout: post -title: Ink Annotation in ##Platform_Name## PDF Viewer Component | Syncfusion -description: Learn here all about Ink Annotation in Syncfusion ##Platform_Name## PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Ink Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Ink Annotation in the ASP.NET MVC PDF Viewer component - -The PDF Viewer control provides the options to add, edit, and delete the ink annotations. - -![InkAnnotation](../images/ink_annotation.png) - -## Adding an ink annotation to the PDF document - -The ink annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Select the **Draw Ink** button in the annotation toolbar. It enables the ink annotation mode. -* You can draw anything over the pages of the PDF document. - -![InkTool](../images/ink_tool.png) - -Refer to the following code sample to switch to the ink annotation mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Adding a Ink annotation to the PDF document Programmatically - -With the PDF Viewer library, you can add a Ink annotation to the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here's a example of how you can utilize the **addAnnotation()** method to include a Ink annotation programmatically - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -## Edit the existing Ink annotation programmatically - -To modify existing Ink annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Editing the properties of the ink annotation - -The stroke color, thickness, and opacity of the ink annotation can be edited using the Edit stroke color tool, Edit thickness tool, and Edit opacity tool in the annotation toolbar. - -### Editing stroke color - -The stroke color of the annotation can be edited using the color palette provided in the Edit Stroke Color tool. - -![InkStrokeColor](../images/ink_strokecolor.png) - -### Editing thickness - -The thickness of the border of the annotation can be edited using the range slider provided in the Edit Thickness tool. - -![InkThickness](../images/ink_thickness.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![InkOpacity](../images/ink_opacity.png) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/measurement-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/measurement-annotation.md deleted file mode 100644 index 0ec1b837ca..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/measurement-annotation.md +++ /dev/null @@ -1,447 +0,0 @@ ---- -layout: post -title: Measurement Annotation in ##Platform_Name## PDF Viewer Component | Syncfusion -description: Learn here all about Measurement Annotation in Syncfusion ##Platform_Name## PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Measurement Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Measurement Annotation in the ASP.NET MVC PDF Viewer component - -The PDF Viewer provides the options to add measurement annotations. You can measure the page annotations with the help of measurement annotation. The supported measurement annotations in the PDF Viewer control are: - -* Distance -* Perimeter -* Area -* Radius -* Volume - -![CalibrateAnnotation](../images/calibrate_annotation.png) - -## Adding a measurement annotation to the PDF document - -The measurement annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Measurement Annotation** dropdown button. A dropdown pop-up will appear and shows the measurement annotations to be added. -* Select the measurement type to be added to the page in the dropdown pop-up. It enables the selected measurement annotation mode. -* You can measure and add the annotation over the pages of the PDF document. - -In the pan mode, if the measurement annotation mode is entered, the PDF Viewer control will switch to text select mode. - -![CalibrateTool](../images/calibrate_tool.png) - -Refer to the following code sample to switch to the distance annotation mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Adding a measurement annotation to the PDF document Programmatically - -With the PDF Viewer library, you can add a measurement annotation to the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here's a example of how you can utilize the **addAnnotation()** method to include a measurement annotation programmatically: - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -## Edit the existing measurement annotation programmatically - -To modify existing measurement annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -## Editing the properties of measurement annotation - -The fill color, stroke color, thickness, and opacity of the measurement annotation can be edited using the Edit Color tool, Edit Stroke Color tool, Edit Thickness tool, and Edit Opacity tool in the annotation toolbar. - -### Editing fill color - -The fill color of the annotation can be edited using the color palette provided in the Edit Color tool. - -![CalibrateFillColor](../images/calibrate_fillcolor.png) - -### Editing stroke color - -The stroke color of the annotation can be edited using the color palette provided in the Edit Stroke Color tool. - -![CalibrateStrokeColor](../images/calibrate_stroke.png) - -### Editing thickness - -The thickness of the border of the annotation can be edited using the range slider provided in the Edit thickness tool. - -![CalibrateThickness](../images/calibrate_thickness.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![CalibrateOpacity](../images/calibrate_opacity.png) - -### Editing the line properties - -The properties of the line shapes such as distance and perimeter annotations can be edited using the Line properties window. It can be opened by selecting the Properties option in the context menu that appears on right-clicking the distance and perimeter annotations. - -![CalibrateProperty](../images/calibrate_lineprop.png) - -## Setting default properties during control initialization - -The properties of the shape annotations can be set before creating the control using DistanceSettings, PerimeterSettings, AreaSettings, RadiusSettings, and VolumeSettings. -Refer to the following code sample to set the default annotation settings. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").DistanceSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerDistanceSettings { FillColor = "blue", Opacity = 0.6, StrokeColor = "green" }).PerimeterSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerPerimeterSettings { FillColor = "green", Opacity = 0.6, StrokeColor = "blue" }).AreaSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerAreaSettings { FillColor = "yellow", Opacity = 0.6, StrokeColor = "orange" }).RadiusSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerRadiusSettings { FillColor = "orange", Opacity = 0.6, StrokeColor = "pink" }).VolumeSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerVolumeSettings { FillColor = "pink", Opacity = 0.6, StrokeColor = "yellow" }).Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").DistanceSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerDistanceSettings { FillColor = "blue", Opacity = 0.6, StrokeColor = "green" }).PerimeterSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerPerimeterSettings { FillColor = "green", Opacity = 0.6, StrokeColor = "blue" }).AreaSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerAreaSettings { FillColor = "yellow", Opacity = 0.6, StrokeColor = "orange" }).RadiusSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerRadiusSettings { FillColor = "orange", Opacity = 0.6, StrokeColor = "pink" }).VolumeSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerVolumeSettings { FillColor = "pink", Opacity = 0.6, StrokeColor = "yellow" }).Render() -
- -{% endhighlight %} -{% endtabs %} - -## Editing scale ratio and unit of the measurement annotation - -The scale ratio and unit of measurement can be modified using the scale ratio option provided in the context menu of the PDF Viewer control. - -![CalibrateScaleRatio](../images/calibrate_scaleratio.png) - -The Units of measurements supported for the measurement annotations in the PDF Viewer are: - -* Inch -* Millimeter -* Centimeter -* Point -* Pica -* Feet - -![CalibrateScaleDialog](../images/calibrate_scaledialog.png) - -## Setting default scale ratio settings during the control initialization - -The properties of scale ratio for measurement annotation can be set before creating the control using the ScaleRatioSettings as shown in the following code sample. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").MeasurementSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerMeasurementSettings { ScaleRatio = 2, ConversionUnit = Syncfusion.EJ2.PdfViewer.CalibrationUnit.Cm }).Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").MeasurementSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerMeasurementSettings { ScaleRatio = 2, ConversionUnit = Syncfusion.EJ2.PdfViewer.CalibrationUnit.Cm }).Render() -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/shape-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/shape-annotation.md deleted file mode 100644 index 2488349d2b..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/shape-annotation.md +++ /dev/null @@ -1,408 +0,0 @@ ---- -layout: post -title: Shape Annotation in ##Platform_Name## PDF Viewer Component | Syncfusion -description: Learn here all about Shape Annotation in Syncfusion ##Platform_Name## PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Shape Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Shape Annotation in the ASP.NET MVC PDF Viewer component - -The PDF Viewer control provides the options to add, edit, and delete the shape annotations. The shape annotation types supported in the PDF Viewer control are: - -* Line -* Arrow -* Rectangle -* Circle -* Polygon - -![ShapeAnnotation](../images/shape_annot.png) - -## Adding a shape annotation to the PDF document - -Shape annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Shape Annotation** drop-down button. A drop-down pop-up will appear and shows the shape annotations to be added. -* Select the shape types to be added to the page in the drop-down pop-up. It enables the selected shape annotation mode. -* You can add the shapes over the pages of the PDF document. - -In the pan mode, if the shape annotation mode is entered, the PDF Viewer control will switch to text select mode. - -![ShapeTool](../images/shape_toolbar.png) - -Refer to the following code sample to switch to the circle annotation mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Adding a shape annotation to the PDF document Programmatically - -With the PDF Viewer library, you can add a shape annotation to the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here's a example of how you can utilize the **addAnnotation()** method to include a shape annotation programmatically: - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -## Edit the existing shape annotation programmatically - -To modify existing shape annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -## Editing the properties of the shape annotation - -The fill color, stroke color, thickness, and opacity of the shape annotation can be edited using the Edit color tool, Edit stroke color tool, Edit thickness tool, and Edit opacity tool in the annotation toolbar. - -### Editing fill color - -The fill color of the annotation can be edited using the color palette provided in the Edit Color tool. - -![ShapeFillColor](../images/shape_fillcolor.png) - -### Editing stroke color - -The stroke color of the annotation can be edited using the color palette provided in the Edit Stroke Color tool. - -![ShapeStrokeColor](../images/shape_strokecolor.png) - -### Editing thickness - -The thickness of the border of the annotation can be edited using the range slider provided in the Edit Thickness tool. - -![ShapeThickness](../images/shape_thickness.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![ShapeOpacity](../images/shape_opacity.png) - -### Editing the line properties - -The properties of the line shapes such as line and arrow annotations can be edited using the Line Properties window. It can be opened by selecting the Properties option in the context menu that appears on right-clicking the line and arrow annotations. - -Refer to the following code sample to set the default annotation settings. - -![ShapeProperty](../images/shape_lineproperty.png) - -## Setting default properties during the control initialization - -The properties of the shape annotations can be set before creating the control using LineSettings, ArrowSettings, RectangleSettings, CircleSettings, and PolygonSettings. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").LineSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerLineSettings { FillColor = "blue", Opacity = 0.6, StrokeColor = "green" }).ArrowSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerArrowSettings { FillColor = "green", Opacity = 0.6, StrokeColor = "blue" }).RectangleSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerRectangleSettings { FillColor = "yellow", Opacity = 0.6, StrokeColor = "orange" }).CircleSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerCircleSettings { FillColor = "orange", Opacity = 0.6, StrokeColor = "pink" }).PolygonSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerPolygonSettings { FillColor = "pink", Opacity = 0.6, StrokeColor = "yellow" }).Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").LineSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerLineSettings { FillColor = "blue", Opacity = 0.6, StrokeColor = "green" }).ArrowSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerArrowSettings { FillColor = "green", Opacity = 0.6, StrokeColor = "blue" }).RectangleSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerRectangleSettings { FillColor = "yellow", Opacity = 0.6, StrokeColor = "orange" }).CircleSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerCircleSettings { FillColor = "orange", Opacity = 0.6, StrokeColor = "pink" }).PolygonSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerPolygonSettings { FillColor = "pink", Opacity = 0.6, StrokeColor = "yellow" }).Render() -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/stamp-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/stamp-annotation.md deleted file mode 100644 index 2bc1a96ac6..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/stamp-annotation.md +++ /dev/null @@ -1,297 +0,0 @@ ---- -layout: post -title: Stamp Annotation in ##Platform_Name## PDF Viewer Component | Syncfusion -description: Learn here all about Stamp Annotation in Syncfusion ##Platform_Name## PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Stamp Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Stamp Annotation in the ASP.NET MVC PDF Viewer component - -The PDF Viewer control provides options to add, edit, delete, and rotate the following stamp annotation in the PDF documents: - -* Dynamic -* Sign Here -* Standard Business -* Custom Stamp - -![StampAnnotation](../images/stamp_annot.png) - -## Adding stamp annotations to the PDF document - -The stamp annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Stamp Annotation** drop-down button. A drop-down pop-up will appear and shows the stamp annotations to be added. - -![StampTool](../images/stamp_tool.png) - -* Select the annotation type to be added to the page in the pop-up. - -![StampPopup](../images/selectstamp_annot.png) - -* You can add the annotation over the pages of the PDF document. - -In the pan mode, if the stamp annotation mode is entered, the PDF Viewer control will switch to text select mode. - -Refer to the following code sample to switch to the stamp annotation mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Adding custom stamp to the PDF document - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Stamp Annotation** drop-down button. A drop-down pop-up will appear and shows the stamp annotations to be added. -* Click the Custom Stamp button. - -![CustomStamp](../images/customstamp.png) - -* The file explorer dialog will appear, choose the image and then add the image to the PDF page. - -N>The JPG and JPEG image format is only supported in the custom stamp annotations. - -## Adding a Stamp annotation to the PDF document Programmatically - -With the PDF Viewer library, you can add a Stamp annotation to the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here's a example of how you can utilize the **addAnnotation()** method to include a Stamp annotation programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Edit the existing sticky note annotation programmatically - -To modify existing sticky note annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% endtabs %} - - -## Setting default properties during control initialization - -The properties of the stamp annotation can be set before creating the control using the StampSettings. - -After editing the default opacity using the Edit Opacity tool, they will be changed to the selected values. -Refer to the following code sample to set the default sticky note annotation settings. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").StampSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerStampSettings { Opacity = 0.3, Author = "Guest User" }).Render() - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").StampSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerStampSettings { Opacity = 0.3, Author = "Guest User" }).Render() -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/sticky-notes-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/sticky-notes-annotation.md deleted file mode 100644 index 72c2af52fe..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/sticky-notes-annotation.md +++ /dev/null @@ -1,196 +0,0 @@ ---- -layout: post -title: Sticky Notes Annotation in ##Platform_Name## PDF Viewer Component | Syncfusion -description: Learn here all about Sticky Notes Annotation in Syncfusion ##Platform_Name## PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Sticky Notes Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Sticky Notes Annotation in the ASP.NET MVC PDF Viewer component - -The PDF Viewer control provides the options to add, edit, and delete the sticky note annotations in the PDF document. - -![StickyNotesAnnotation](../images/stickynotes_annotation.png) - -## Adding a sticky note annotation to the PDF document - -Sticky note annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Comments** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the position where you want to add sticky note annotation in the PDF document. -* Sticky note annotation will be added in the clicked positions. - -![StickyNotesTool](../images/stickynotes_tool.png) - -Annotation comments can be added to the PDF document using the comment panel. - -* Select a Sticky note annotation in the PDF document and right-click it. -* Select the Comment option in the context menu that appears. -* Now, you can add Comments, Reply, and Status using the Comment Panel. -* Now, you can add Comments, Reply, and Status using the Comment Panel. - -![StickyNotesComment](../images/stickynotes_comment.png) - -## Adding a sticky note annotation to the PDF document Programmatically - -With the PDF Viewer library, you can add a sticky note annotation to the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here's a example of how you can utilize the **addAnnotation()** method to include a sticky note annotation programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Edit the existing sticky note annotation programmatically - -To modify existing sticky note annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Editing the properties of the sticky note annotation - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![StickyNotesOpacity](../images/sticky_opacity.png) - -### Editing comments - -The comment, comment reply, and comment status of the annotation can be edited using the Comment Panel. - -* Open the comment panel using the Comment Panel button showing in the annotation toolbar. - -![StickyNotesComment](../images/commentPanel.png) - -You can modify or delete the comments or comments replay and it’s status using the menu option provided in the comment panel. - -![StickyNotesEdit](../images/sticky_editbtn.png) - -## Setting default properties during the control initialization - -The properties of the sticky note annotation can be set before creating the control using the StickyNotesSettings. - -After editing the default opacity using the Edit Opacity tool, they will be changed to the selected values. Refer to the following code sample to set the default sticky note annotation settings. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").StickyNotesSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerStickyNotesSettings { Author = "Syncfusion" }).Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").StickyNotesSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerStickyNotesSettings { Author = "Syncfusion" }).Render() -
-``` -{% endhighlight %} -{% endtabs %} - -## Disabling sticky note annotations - -The PDF Viewer control provides an option to disable the sticky note annotations feature. The code sample for disabling the feature is as follows. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnableStickyNotesAnnotation(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).EnableStickyNotesAnnotation(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/text-markup-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/text-markup-annotation.md deleted file mode 100644 index 2e82adee5b..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/annotation/text-markup-annotation.md +++ /dev/null @@ -1,761 +0,0 @@ ---- -layout: post -title: Text Markup Annotations in ##Platform_Name## PDF Viewer | Syncfusion -description: Learn here all about Text Markup Annotation in Syncfusion ##Platform_Name## PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Text Markup Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Text Markup Annotation in the ASP.NET MVC PDF Viewer component - -The PDF Viewer control provides the options to add, edit, and delete text markup annotations such as highlight, underline, strikethrough and squiggly annotations in the PDF document. - -![Alt text](../images/text_markup_annotation.png) - -## Highlight a text - -There are two ways to highlight a text in the PDF document: - -1. Using the context menu - * Select a text in the PDF document and right-click it. - * Select **Highlight** option in the context menu that appears. - -![Alt text](../images/highlight_context.png) - - -2. Using the annotation toolbar - * Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. - * Select the **Highlight** button in the annotation toolbar. It enables the highlight mode. - * Select the text and the highlight annotation will be added. - * You can also select the text and apply the highlight annotation using the **Highlight** button. - -![Alt text](../images/highlight_button.PNG) - -In the pan mode, if the highlight mode is entered, the PDF Viewer control will switch to text select mode to enable the text selection for highlighting the text. - -Refer to the following code sample to switch to the highlight mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -Refer to the following code sample to switch back to normal mode from the highlight mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Highlight a text programmatically - -The PDF Viewer library enables you to programmatically highlight text within the PDF Viewer control using the **addAnnotation()** method. - -Here's an example of how you can use the **addAnnotation()** method to apply highlighting programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - - -## Underline a text - -There are two ways to underline a text in the PDF document: - -1. Using the context menu - * Select a text in the PDF document and right-click it. - * Select the **Underline** option in the context menu that appears. - -![Alt text](../images/underline_context.png) - - -2. Using the annotation toolbar - * Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. - * Select the **Underline** button in the annotation toolbar. It enables the underline mode. - * Select the text and the underline annotation will be added. - * You can also select the text and apply the underline annotation using the **Underline** button. - -![Alt text](../images/underline_button.png) - -In the pan mode, if the underline mode is entered, the PDF Viewer control will switch to text select mode to enable the text selection for underlining the text. - -Refer to the following code sample to switch to the underline mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -Refer to the following code sample to switch back to normal mode from the underline mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Underline a text programmatically - -The PDF Viewer library enables you to programmatically Underline text within the PDF Viewer control using the **addAnnotation()** method. - -Here's an example of how you can use the **addAnnotation()** method to apply Underline programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Strikethrough a text - -There are two ways to strikethrough a text in the PDF document: - -1. Using the context menu - * Select a text in the PDF document and right-click it. - * Select the **Strikethrough** option in the context menu that appears. - -![Alt text](../images/strikethrough_context.png) - - -2. Using the annotation toolbar - * Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. - * Select the **Strikethrough** button in the annotation toolbar. It enables the strikethrough mode. - * Select the text and the strikethrough annotation will be added. - * You can also select the text and apply the strikethrough annotation using the **Strikethrough** button. - -![Alt text](../images/strikethrough_button.png) - -In the pan mode, if the strikethrough mode is entered, the PDF Viewer control will switch to text select mode to enable the text selection for striking through the text. - -Refer to the following code sample to switch to the strikethrough mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -Refer to the following code sample to switch back to normal mode from the strikethrough mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Strikethrough a text programmatically - -The PDF Viewer library enables you to programmatically Strikethrough text within the PDF Viewer control using the **addAnnotation()** method. - -Here's an example of how you can use the **addAnnotation()** method to apply Strikethrough programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Squiggly a text - -There are two ways to add a squiggly annotation to text in the PDF document: - -1. Using the context menu - * Select a text in the PDF document and right-click it. - * Select the **Squiggly** option in the context menu that appears. - -![Alt text](../images/squiggly_context.png) - - -2. Using the annotation toolbar - * Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. - * Select the **Squiggly** button in the annotation toolbar. It enables the squiggly mode. - * Select the text and the squiggly annotation will be added. - * You can also select the text and apply the squiggly annotation using the **Squiggly** button. - -![Alt text](../images/squiggly_button.png) - -In the pan mode, if the squiggly mode is entered, the PDF Viewer control will switch to text select mode to enable the text selection for adding squiggly to the text. - -Refer to the following code sample to switch to the squiggly mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -Refer to the following code sample to switch back to normal mode from the squiggly mode. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Squiggly a text programmatically - -The PDF Viewer library enables you to programmatically Squiggly text within the PDF Viewer control using the **addAnnotation()** method. - -Here's an example of how you can use the **addAnnotation()** method to apply Squiggly programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - - -## Deleting a text markup annotation - -The selected annotation can be deleted in the following ways: - -1. Using the Delete key - * Select the annotation to be deleted. - * Click the Delete key in the keyboard. The selected annotation will be deleted. - -2. Using the annotation toolbar - * Select the annotation to be deleted. - * Click the **Delete Annotation** button in the annotation toolbar. The selected annotation will be deleted. - -![Alt text](../images/delete_button.png) - -## Editing the properties of the text markup annotation - -The color and the opacity of the text markup annotation can be edited using the Edit Color tool and the Edit Opacity tool in the annotation toolbar. - -### Editing color - -The color of the annotation can be edited using the color palette provided in the Edit Color tool. - -![Alt text](../images/edit_color.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![Alt text](../images/edit_opacity.png) - -## Setting default properties during the control initialization - -The properties of the text markup annotation can be set before creating the control using the highlightSettings, underlineSettings, strikethroughSettings and squigglySettings. - -N>After editing the default color and opacity using the Edit Color tool and Edit Opacity tool, they will be changed to the selected values. - -Refer to the following code sample to set the default annotation settings. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").HighlightSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerHighlightSettings{Author = "Guest User", Color = "#ffff00", Opacity = 0.9 }).UnderlineSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerUnderlineSettings{ Author = "Guest User", Color = "#00ffff", Opacity = 0.9 }).StrikethroughSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerStrikethroughSettings{ Author = "Guest User", Color = "#ff00ff", Opacity = 0.9, }).SquigglySettings(new Syncfusion.EJ2.PdfViewer.PdfViewerSquigglySettings{ Author = "Guest User", Color = "#0000ff", Opacity = 0.9 }).Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").HighlightSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerHighlightSettings{Author = "Guest User", Color = "#ffff00", Opacity = 0.9 }).UnderlineSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerUnderlineSettings{ Author = "Guest User", Color = "#00ffff", Opacity = 0.9 }).StrikethroughSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerStrikethroughSettings{ Author = "Guest User", Color = "#ff00ff", Opacity = 0.9, }).SquigglySettings(new Syncfusion.EJ2.PdfViewer.PdfViewerSquigglySettings{ Author = "Guest User", Color = "#0000ff", Opacity = 0.9 })Render() -
- -{% endhighlight %} -{% endtabs %} - -## Performing undo and redo - -The PDF Viewer performs undo and redo for the changes made in the PDF document. In the text markup annotation, undo and redo actions are provided for: - -* Inclusion of the text markup annotations. -* Deletion of the text markup annotations. -* Change of either color or opacity of the text markup annotations. - -The undo and redo actions can be done by the following ways: - -1. Using the keyboard shortcuts: - After performing a text markup annotation action, you can undo it by using the Ctrl + Z shortcut and redo by using the Ctrl + Y shortcut. -2. Using toolbar: - The undo and redo can be done using the **Undo** tool and **Redo** tool provided in the toolbar. - -Refer to the following code sample for calling undo and redo actions from the client-side. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -## Saving the text markup annotation - -When you click the download tool in the toolbar, the text markup annotations will be saved in the PDF document. This action will not affect the original document. - -## Printing the text markup annotation - -When the print tool is selected in the toolbar, the PDF document will be printed along with the text markup annotations added to the pages. This action will not affect the original document. - -## Disabling text markup annotation - -The PDF Viewer control provides an option to disable the text markup annotation feature. The code sample for disabling the feature is as follows. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").EnableTextMarkupAnnotation(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).EnableTextMarkupAnnotation(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/download.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/download.md deleted file mode 100644 index 269a9ba6c0..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/download.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -layout: post -title: Download in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Download in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Download -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - -# Download a PDF document in PDF Viewer component - -The PDF Viewer supports downloading the loaded PDF file. You can enable/disable the download using the following code snippet. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentLoad("download").EnableDownload(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentLoad("download")..ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableDownload(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/download.png) - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/feature-module.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/feature-module.md deleted file mode 100644 index fba601c5b4..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/feature-module.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -layout: post -title: Feature Module in ##Platform_Name## Pdfviewer Component -description: Learn here all about Feature Module in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Feature Module -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Feature modules - -The PDF Viewer features are segregated into individual feature-wise modules to enable selectively referencing in the application. The required modules should be injected to extend its functionality. The following are the selective modules of PDF Viewer that can be included as required: - -The available PdfViewer modules are: - -* **Toolbar**:- Built in toolbar for better user interaction. -* **Magnification**:- Perform zooming operation for better viewing experience. -* **Navigation**:- Easy navigation across the PDF pages. -* **LinkAnnotation**:- Easy navigation within and outside of the PDF document. -* **ThumbnailView**:- Easy navigation with in the PDF document. -* **BookmarkView**:- Easy navigation based on the bookmark content of the PDF document. -* **TextSelection**:- Select and copy text from a PDF file. -* **TextSearch**:- Search a text easily across the PDF document. -* **Print**:- Print the entire document or a specific page directly from the browser. -* **Annotation**:- Annotations can be added or edited in the PDF document. - -N>In addition to injecting the required modules in your application, enable corresponding properties to extend the functionality for a PDF Viewer instance. -Refer to the following table. - -| Module | Property to enable the functionality for a PDF Viewer instance | -|---|---| -|Toolbar|`@Html.EJS().PdfViewer("container").EnableToolbar(true).Render()`| -|Magnification|`@Html.EJS().PdfViewer("container").EnableMagnification(true).Render()`| -|Navigation|`@Html.EJS().PdfViewer("container").EnableNavigation(true).Render()`| -|LinkAnnotation|`@Html.EJS().PdfViewer("container").EnableHyperlink(true).Render()`| -|ThumbnailView|`@Html.EJS().PdfViewer("container").EnableThumbnail(true).Render()`| -|BookmarkView|`@Html.EJS().PdfViewer("container").EnableBookmark(true).Render()`| -|TextSelection|`@Html.EJS().PdfViewer("container").EnableTextSelection(true).Render()`| -|TextSearch|`@Html.EJS().PdfViewer("container").EnableTextSearch(true).Render()`| -|Print|`@Html.EJS().PdfViewer("container").EnablePrint(true).Render()`| -|Annotation|`@Html.EJS().PdfViewer("container").EnableAnnotation(true).Render()`| - -## See also - -* [Toolbar items](./toolbar) -* [Toolbar customization](./how-to/toolbar_customization) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-designer/create-programmatically.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-designer/create-programmatically.md deleted file mode 100644 index 8f312a8d38..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-designer/create-programmatically.md +++ /dev/null @@ -1,1483 +0,0 @@ ---- -layout: post -title: Create Programmatically in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Create Programmatically in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Create Programmatically -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Create form fields programmatically - -The PDF Viewer control provides the option to add, edit and delete the Form Fields. The Form Fields type supported by the PDF Viewer Control are: - -* Textbox -* Password -* CheckBox -* RadioButton -* ListBox -* DropDown -* SignatureField -* InitialField - -## Add a form field to PDF document programmatically - -Using addFormField method, the form fields can be added to the PDF document programmatically. We need to pass two parameters in this method. They are Form Field Type and Properties of Form Field Type. To add form field programmatically, Use the following code. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## Edit/Update form field programmatically - -Using updateFormField method, Form Field can be updated programmatically. We should get the Form Field object/Id from FormFieldCollections property that you would like to edit and pass it as a parameter to updateFormField method. The second parameter should be the properties that you would like to update for Form Field programmatically. We have updated the value and background Color properties of Textbox Form Field. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## Delete form field programmatically - -Using deleteFormField method, the form field can be deleted programmatically. We should retrieve the Form Field object/Id from FormFieldCollections property that you would like to delete and pass it as a parameter to deleteFormField method. To delete a Form Field programmatically, use the following code. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## Saving the form fields - -When the download icon is selected on the toolbar, the Form Fields will be saved in the PDF document and this action will not affect the original document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/saveformfield.gif) - -You can invoke download action using following code snippet. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentLoad("download").EnableDownload(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentLoad("download").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableDownload(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% endtabs %} - -## Printing the form fields - -When the print icon is selected on the toolbar, the PDF document will be printed along with the Form Fields added to the pages and this action will not affect the original document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/printformfield.gif) - -You can invoke print action using the following code snippet., - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnablePrint(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnablePrint(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -``` -{% endhighlight %} -{% endtabs %} - -## Open the existing PDF document - -We can open the already saved PDF document contains Form Fields in it by clicking the open icon in the toolbar. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/openexistingpdf.gif) - -## Validate form fields - -The form fields in the PDF Document will be validated when the `enableFormFieldsValidation` is set to true and hook the validateFormFields. The validateFormFields will be triggered when the PDF document is downloaded or printed with the non-filled form fields. The non-filled fields will be obtained in the `nonFillableFields` property of the event arguments of validateFormFields. - -Add the following code snippet to validate the form fields, - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ValidateFormFields("validateFormFields").EnableFormFieldsValidation(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf").Render() -
- - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).ValidateFormFields("validateFormFields").EnableFormFieldsValidation(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf").Render() -
- - -``` -{% endhighlight %} -{% endtabs %} - -## Export and import form fields - -The PDF Viewer control provides the support to export and import the form field data in the following formats using the `importFormFields`, `exportFormFields`, and `exportFormFieldsAsObject` methods. - -* FDF -* XFDF -* JSON - -### Export and import as FDF - -Using the `exportFormFields` method, the form field data can be exported in the specified data format. This method accepts two parameters: - -* The first one must be the destination path for the exported data. If the path is not specified, it will ask for the location while exporting. -* The second parameter should be the format type of the form data. - -The following code explains how to export the form field data as FDF. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -``` -{% endhighlight %} -{% endtabs %} - -### Export and import as XFDF - -The following code explains how to export the form field data as XFDF. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% endtabs %} - -### Export and import as JSON - -The following code explains how to export the form field data as JSON. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html - - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% endtabs %} - -### Export and import as Object - -The PDF Viewer control supports exporting the form field data as an object, and the exported data will be imported into the current PDF document from the object. - -The following code shows how to export the form field data as an object and import the form field data from that object into the current PDF document via a button click. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% endtabs %} - -## Form Field Properties - -Form field properties in Syncfusion® PDF Viewer allow you to customize and interact with form fields embedded within PDF documents. This documentation provides an overview of the form field properties supported by the Syncfusion® PDF Viewer and explains how to use them effectively. - - * Textbox - * Password - * CheckBox - * RadioButton - * ListBox - * DropDown - * SignatureField - * InitialField - -### Signature and initial fields settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the signature field properties on a button click. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -The following code example explains how to update the properties of the signature field added to the document from the form designer toolbar. - - - -![Signature Field Settings](../../pdfviewer/images/signature_field.png) - -The following code example explains how to update the properties of the initial field added to the document from the form designer toolbar. - - - -![Initial Field Settings](../../pdfviewer/images/InitialField.png) - -### Textbox field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the Textbox field properties on a button click. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - - -The following code example explains how to update the properties of the textbox field added to the document from the form designer toolbar. - - - -![Textbox Field Settings](../../pdfviewer/images/Textbox.png) - -### Password field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the Password field properties on a button click. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("PDF_Succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("PDF_Succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - - -The following code example explains how to update the properties of the password field added to the document from the form designer toolbar. - - - -![Password Field Settings](../../pdfviewer/images/Password.png) - -### CheckBox field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the CheckBox field properties on a button click. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - - -The following code example explains how to update the properties of the checkbox field added to the document from the form designer toolbar. - - - -![CheckBox Field Settings](../../pdfviewer/images/Checkbox.png) - -### RadioButton field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the RadioButton field properties on a button click. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - - -The following code example explains how to update the properties of the radiobutton field added to the document from the form designer toolbar. - - - -![RadioButton Field Settings](../../pdfviewer/images/Radiobutton.png) - -### ListBox field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the ListBox field properties on a button click. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - - -The following code example explains how to update the properties of the listbox field added to the document from the form designer toolbar. - - - -![ListBox Field Settings](../../pdfviewer/images/Listbox.png) - -### DropDown field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the DropDown field properties on a button click. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - - -The following code example explains how to update the properties of the dropdown field added to the document from the form designer toolbar. - - - -![DropDownBox Field Settings](../../pdfviewer/images/Dropdown.png) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-designer/create-with-user-interface-interaction.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-designer/create-with-user-interface-interaction.md deleted file mode 100644 index 4e37116814..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-designer/create-with-user-interface-interaction.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -layout: post -title: User Interface Interaction in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn how User Interface Interaction in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Create With User Interface Interaction -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Create form fields with UI interaction - -The PDF viewer control provides the option for interaction with Form Fields such as Drag and resize. you can draw a Form Field dynamically by clicking the Form Field icon on the toolbar and draw it in the PDF document. The Form Fields type supported by the PDF Viewer Control are: - -* Textbox -* Password -* CheckBox -* RadioButton -* ListBox -* DropDown -* SignatureField -* InitialField - -## Enable or Disable form designer toolbar - -We should inject FormDesigner module and set enableFormDesignerToolbar as true to enable the Form designer icon on the toolbar. By default, enableFormDesignerToolbar is set as true. Use the following code to inject FormDesigner module and to enable the enableFormDesignerToolbar property. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnableFormDesignerToolbar(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableFormDesignerToolbar(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## Add the form field dynamically - -Click the Form Field icon on the toolbar and then click on to the PDF document to draw a Form Field. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/addformfield.gif) - -## Drag the form field - -We provide options to drag the Form Field which is currently selected in the PDF document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/dragformfield.gif) - -## Resize the form field - -We provide options to resize the Form Field which is currently selected in the PDF document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/resizeformfield.gif) - -## Edit or Update the form field dynamically - -The properties of the Form Fields can be edited using the Form Field Properties window. It can be opened by selecting the Properties option in the context menu that appears on the right by clicking the Form Field object. Refer the below image for the properties available to customize the appearance of the Form Field. - -![Alt text](../../pdfviewer/images/generalproperties.png) - -![Alt text](../../pdfviewer/images/appearanceproperties.png) - -![Alt text](../../pdfviewer/images/dropdownproperties.png) - -## Clipboard operation with form field - -The PDF Viewer control supports the clipboard operations such as cut, copy and paste for Form Fields. You can right click on the Form Field object to view the context menu and select to the clipboard options that you would like to perform. Refer the below image for the options in the context menu. - -![Alt text](../../pdfviewer/images/clipboardformfield.png) - -## Undo and Redo - -We provided support to undo/redo the Form Field actions that are performed at runtime. Use the following code example to perform undo/redo actions. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- -``` -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-designer/form-field-events.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-designer/form-field-events.md deleted file mode 100644 index 1016a474de..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-designer/form-field-events.md +++ /dev/null @@ -1,544 +0,0 @@ ---- -layout: post -title: Form Field Events in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about different form field event in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Form Field Events -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# PDF Viewer Form Field events - -The PDF Viewer control provides the support to different Form Field events. The Form Field events supported by the PDF Viewer Control are: - -| Form Field events | Description | -|---|---| -| formFieldAdd | Event trigger when a form field is added.| -| formFieldClick | Events trigger when the form field is selected.| -| formFieldDoubleClick | Events trigger when the form field is double-clicked.| -| formFieldFocusOut | Events trigger when focus out from the form fields.| -| formFieldMouseLeave | Events trigger when the mouse cursor leaves the form field.| -| formFieldMouseOver | Events trigger when the mouse cursor is over a form field.| -| formFieldMove | Events trigger when a form field is moved.| -| formFieldPropertiesChange | Events trigger when a property of form field is changed.| -| formFieldRemove | Events trigger when a form field is removed.| -| formFieldResize | Events trigger when a form field is resized.| -| formFieldSelect | Events trigger when a form field is selected.| -| formFieldUnselect | Events trigger when a form field is unselected.| -| validateFormFields | Events trigger when validation is failed.| - -## formFieldAdd event - -The [formFieldAdd](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldAdd) event is triggered when a new form field is added, either programmatically or through user interaction. The event arguments provide the necessary information about the form field addition. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldAdd("formFieldAdded").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldAdd("formFieldAdded").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldClick("formFieldClicked").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldDoubleClick("formFieldDoubleClicked").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldFocusOut("FormFieldFocusOuted").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldMouseLeave("FormFieldMouseLeaved").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldMouseover("FormFieldMouseovered").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## formFieldMove event - -The [formFieldMove](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldMove/) event is triggered when the mouse moves inside a form field. The event arguments provide the necessary information about the form field mouse move event. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldMove("FormFieldMoved").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldMove("FormFieldMoved").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## formFieldPropertiesChange event - -The [formFieldPropertiesChange](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldPropertiesChange/) event is triggered when the properties of a form field are changed. The event arguments provide the necessary information about which property of the form field has been changed. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldPropertiesChange("FormFieldPropertiesChanged").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldPropertiesChange("FormFieldPropertiesChanged").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## formFieldRemove event - -The [formFieldRemove](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldRemove) event is triggered when a form field is removed from the PDF. The event arguments provide the necessary information about which form field has been removed. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldRemove("FormFieldRemoved").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldRemove("FormFieldRemoved").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## formFieldResize event - -The [formFieldResize](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldResize) events are triggered when a form field in a PDF is resized. These events provide the relevant details about the specific form field that has been resized. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldResize("FormFieldResized").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldResize("FormFieldResized").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## formFieldSelect event - -The [formFieldSelect](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldSelect/) events are triggered when a form field in a PDF is selected. These events provide the necessary details about the specific form field that has been selected. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldSelect("FormFieldSelected").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldSelect("FormFieldSelected").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## formFieldUnselect event - -The [formFieldUnselect](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldUnselect/) events are triggered when a form field in a PDF is unselected. These events provide the necessary details about the specific form field that has been unselected. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldUnselect("FormFieldUnselected").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").FormFieldUnselect("FormFieldUnselected").Render() -
- -``` -{% endhighlight %} -{% endtabs %} - -## validateFormFields event - -The [ValidateFormFields](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_ValidateFormFields/) events are triggered when a required form field is left unfilled before downloading the PDF. These events provide the necessary information for validating which form fields are incomplete. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").ValidateFormFields("ValidateFormField").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").ValidateFormFields("ValidateFormField").Render() -
- -``` -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-filling.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-filling.md deleted file mode 100644 index f16b133c30..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/form-filling.md +++ /dev/null @@ -1,128 +0,0 @@ ---- -layout: post -title: Form Filling in ##Platform_Name## Pdfviewer Component | Syncfusion -description: Learn here all about Form Filling in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Form Filling in the ASP.NET MVC PDF Viewer component - -PDF Viewer component allows you to display the form fields available in the PDF document. By using this, you can edit and download the form fields. - -The form fields displayed in the PDF Viewer are: - -* Text box -* Password box -* Combo box -* Check box -* Radio Button -* Signature Field -* List box - -![FormFilling](./images/formfilling.png) - -## Disabling form fields - -The PDF Viewer control provides an option to disable the form fields feature. The code sample for disabling the form fields is as follows. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnableFormFields(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).EnableFormFields(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -## How to draw handwritten signature in the signature field - -Signature can be added to the Signature field by using the following steps: - -* Click the Signature Field in the PDF document. The signature panel will appear. - -![SignatureField](./images/signaturefield.png) - -* Draw the signature in the signature panel. - -![SignaturePanel](./images/signature.png) - -* Click the **CREATE** button, the drawn signature will be added in the signature field. - -![Signature](./images/sign.png) - -## Delete the signature inside the signature field - -You can also delete the signature in the signature field by using Delete Option in the annotation toolbar. - -![DeleteSign](./images/deletesign.png) - -## Import and export form fields - -The PDF Viewer control provides the support to import and export form fields using a JSON object in the PDF document. - -## Importing form fields using PDF Viewer API - -You can import the form fields using JSON file or JSON object in code behind like the below code sample. - -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf").Render() -
- -``` - -N>The JSON file for importing the form fields should be placed in the desired location and the path should be provided correctly. - -## Exporting form fields from the PDF document using PDF Viewer API - -You can export the form fields as JSON file in code behind as the following code sample. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf").Render() -
- -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf").Render() -
- -``` -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/formdesigner/programmatically-work-with-form-field.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/formdesigner/programmatically-work-with-form-field.md deleted file mode 100644 index c41168e863..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/formdesigner/programmatically-work-with-form-field.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -layout: post -title: Programmatically Work With Form Field in ##Platform_Name## Pdfviewer Component -description: Learn here all about Programmatically Work With Form Field in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Programmatically Work With Form Field -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Programmatically work with form field - -The PDF Viewer control provides the option to add, edit and delete the Form Fields. The Form Fields type supported by the PDF Viewer Control are: - - * Textbox - * Password - * CheckBox - * RadioButton - * ListBox - * DropDown - * SignatureField - * InitialField - -## Add a form field to PDF document programmatically - -Using addFormField method, the form fields can be added to the PDF document programmatically. We need to pass two parameters in this method. They are Form Field Type and Properties of Form Field Type. To add form field programmatically, Use the following code. - -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("FormDesigner.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() -
- -``` - -## Edit/Update form field programmatically - -Using updateFormField method, Form Field can be updated programmatically. We should get the Form Field object/Id from FormFieldCollections property that you would like to edit and pass it as a parameter to updateFormField method. The second parameter should be the properties that you would like to update for Form Field programmatically. We have updated the value and background Color properties of Textbox Form Field. - -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("FormDesigner.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() -
- -``` - -## Delete form field programmatically - -Using deleteFormField method, the form field can be deleted programmatically. We should retrieve the Form Field object/Id from FormFieldCollections property that you would like to delete and pass it as a parameter to deleteFormField method. To delete a Form Field programmatically, use the following code. - -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("FormDesigner.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() -
- -``` - -## Saving the form fields - -When the download icon is selected on the toolbar, the Form Fields will be saved in the PDF document and this action will not affect the original document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/saveformfield.gif) - -You can invoke download action using following code snippet. - -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableDownload(true).DocumentPath("Hive_Succinctly.pdf").Render() -
- - -``` - -## Printing the form fields - -When the print icon is selected on the toolbar, the PDF document will be printed along with the Form Fields added to the pages and this action will not affect the original document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/printformfield.gif) - -You can invoke print action using the following code snippet., - -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnablePrint(true).DocumentPath("Hive_Succinctly.pdf").Render() -
- - -``` - -## Open the existing PDF document - -We can open the already saved PDF document contains Form Fields in it by clicking the open icon in the toolbar. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/openexistingpdf.gif) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/formdesigner/user-interaction-with-form-fields.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/formdesigner/user-interaction-with-form-fields.md deleted file mode 100644 index b4323b6ee1..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/formdesigner/user-interaction-with-form-fields.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -layout: post -title: User Interaction With Form Fields in ##Platform_Name## Pdfviewer Component -description: Learn here all about User Interaction With Form Fields in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: User Interaction With Form Fields -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# User interaction with form fields - -The PDF viewer control provides the option for interaction with Form Fields such as Drag and resize. you can draw a Form Field dynamically by clicking the Form Field icon on the toolbar and draw it in the PDF document. The Form Fields type supported by the PDF Viewer Control are: - - * Textbox - * Password - * CheckBox - * RadioButton - * ListBox - * DropDown - * SignatureField - * InitialField - -## Enable or Disable form designer toolbar - -We should inject FormDesigner module and set enableFormDesignerToolbar as true to enable the Form designer icon on the toolbar. By default, enableFormDesignerToolbar is set as true. Use the following code to inject FormDesigner module and to enable the enableFormDesignerToolbar property. - -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableFormDesignerToolbar(true).DocumentPath("Hive_Succinctly.pdf").Render() -
- -``` - -## Add the form field dynamically - -Click the Form Field icon on the toolbar and then click on to the PDF document to draw a Form Field. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/addformfield.gif) - -## Drag the form field - -We provide options to drag the Form Field which is currently selected in the PDF document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/dragformfield.gif) - -## Resize the form field - -We provide options to resize the Form Field which is currently selected in the PDF document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/resizeformfield.gif) - -## Edit or Update the form field dynamically - -The properties of the Form Fields can be edited using the Form Field Properties window. It can be opened by selecting the Properties option in the context menu that appears on the right by clicking the Form Field object. Refer the below image for the properties available to customize the appearance of the Form Field. - -![Alt text](../../pdfviewer/images/generalproperties.png) - -![Alt text](../../pdfviewer/images/appearanceproperties.png) - -![Alt text](../../pdfviewer/images/dropdownproperties.png) - -## Clipboard operation with form field - -The PDF Viewer control supports the clipboard operations such as cut, copy and paste for Form Fields. You can right click on the Form Field object to view the context menu and select to the clipboard options that you would like to perform. Refer the below image for the options in the context menu. - -![Alt text](../../pdfviewer/images/clipboardformfield.png) - -## Undo and Redo - -We provided support to undo/redo the Form Field actions that are performed at runtime. Use the following code example to perform undo/redo actions. - -```html - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("Hive_Succinctly.pdf").Render() -
- -``` \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/getting-started-with-server-backed.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/getting-started-with-server-backed.md deleted file mode 100644 index 963a8791d3..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/getting-started-with-server-backed.md +++ /dev/null @@ -1,438 +0,0 @@ ---- -layout: post -title: Getting Started with EJ2 ASP.NET MVC PDF Viewer Control | Syncfusion -description: Learn how to getting started with PDF Viewer control in ASP.NET MVC application. You can view and comment on PDFs in ease and also can fill form fields. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Getting Started with ASP.NET MVC PDF Viewer Control - -The [ASP.NET MVC PDF Viewer](https://www.syncfusion.com/aspnet-mvc-ui-controls/pdf-viewer) control is used to viewing and printing PDF files in any web application. It provides the best viewing experience available with core interactions such as zooming, scrolling, text searching, text selection, and text copying. Thumbnail, bookmark, hyperlink and table of contents support provides easy navigation within and outside the PDF files. - -This section briefly explains about how to integrate ASP.NET MVC PDF Viewer control in your ASP.NET MVC application using Visual Studio. - -## Prerequisites - -[System requirements for ASP.NET MVC controls](https://ej2.syncfusion.com/aspnetmvc/documentation/system-requirements) - -## Integrate PDF Viewer into an ASP.NET MVC application - -1. Start Visual Studio and select **Create a new project**. -2. Create a new ASP.NET MVC Web Application project. -![Generate-ASP.NET-MVC-project-using-VS2022](AspNetMVC_Images/create-aspnet-mvc-project.png) -3. Choose the target framework. -![Set-the-project-Name](AspNetMVC_Images/set-project-name.png) -4. Select Web Application pattern (MVC) for the project and then select **Create** button. -![Select-web-application-pattern](AspNetMVC_Images/select-web-application-project.png) - -## ASP.NET MVC PDF Viewer NuGet packages installation - -To add .NET PDF Viewer control, the following NuGet packages need to be installed in your ASP.NET MVC application. - -* [Syncfusion.EJ2.PdfViewer.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Mvc5/) -* [Syncfusion.EJ2.MVC5](https://www.nuget.org/packages/Syncfusion.EJ2.MVC5) - -## Add namespace - -Add **Syncfusion.EJ2** namespace reference in `Web.config` under `Views` folder. - -``` - - - -``` - -## Add style sheet - -The theme is referred using CDN inside the `` of `~/Views/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - - -{% endhighlight %} -{% endtabs %} - -N> Checkout the [Themes topic](https://ej2.syncfusion.com/aspnetmvc/documentation/appearance/theme) to learn different ways (CDN, NPM package, and [CRG](https://ej2.syncfusion.com/aspnetmvc/documentation/common/custom-resource-generator)) to refer styles in ASP.NET MVC application, and to have the expected appearance for Syncfusion® ASP.NET MVC controls. - -## Add script reference - -Add the required scripts using CDN inside the `` of `~/Views/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - - -{% endhighlight %} -{% endtabs %} - -## Register Syncfusion® Script Manager - -Open `~/Views/Shared/_Layout.cshtml` page and register the script manager in the ASP.NET MVC application as follows. - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - -... - - @Html.EJS().ScriptManager() - - -{% endhighlight %} -{% endtabs %} - -N> Add the script manager `EJS().ScriptManager()` at the **end of ``**. - -## Add ASP.NET MVC PDF Viewer control - -Add the Syncfusion® ASP.NET MVC PDF Viewer control in `~/Views/Home/Index.cshtml` page. You can load a PDF file in the PDF Viewer by specifying the document name in the DocumentPath property as below. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml" %} - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
-
- -{% endhighlight %} -{% endtabs %} - -Add the below code in the `HomeController.cs` file which is placed inside `Controllers` folder. - -{% tabs %} -{% highlight c# tabtitle="~/HomeController.cs" %} - -using Newtonsoft.Json; -using Syncfusion.EJ2.PdfViewer; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Reflection; -using System.Web; -using System.Web.Mvc; - -namespace GettingStartedMVC.Controllers -{ - public class HomeController : Controller - { - [System.Web.Mvc.HttpPost] - public ActionResult Load(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - MemoryStream stream = new MemoryStream(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = new object(); - if (jsonObject != null && jsonData.ContainsKey("document")) - { - if (bool.Parse(jsonData["isFileName"])) - { - string documentPath = GetDocumentPath(jsonData["document"]); - - if (!string.IsNullOrEmpty(documentPath)) - { - byte[] bytes = System.IO.File.ReadAllBytes(documentPath); - stream = new MemoryStream(bytes); - } - else - { - string fileName = jsonData["document"].Split(new string[] { "://" }, StringSplitOptions.None)[0]; - if (fileName == "http" || fileName == "https") - { - var WebClient = new WebClient(); - byte[] pdfDoc = WebClient.DownloadData(jsonData["document"]); - stream = new MemoryStream(pdfDoc); - } - else - { - return this.Content(jsonData["document"] + " is not found"); - } - } - } - else - { - byte[] bytes = Convert.FromBase64String(jsonData["document"]); - stream = new MemoryStream(bytes); - - } - } - jsonResult = pdfviewer.Load(stream, jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - public Dictionary JsonConverter(jsonObjects results) - { - Dictionary resultObjects = new Dictionary(); - resultObjects = results.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public) - .ToDictionary(prop => prop.Name, prop => prop.GetValue(results, null)); - var emptyObjects = (from kv in resultObjects - where kv.Value != null - select kv).ToDictionary(kv => kv.Key, kv => kv.Value); - Dictionary jsonResult = emptyObjects.ToDictionary(k => k.Key, k => k.Value.ToString()); - return jsonResult; - } - - [System.Web.Mvc.HttpPost] - public ActionResult ExportAnnotations(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string jsonResult = pdfviewer.ExportAnnotation(jsonData); - return Content((jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult ImportAnnotations(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - string jsonResult = string.Empty; - var jsonData = JsonConverter(jsonObject); - if (jsonObject != null && jsonData.ContainsKey("fileName")) - { - string documentPath = GetDocumentPath(jsonData["fileName"]); - if (!string.IsNullOrEmpty(documentPath)) - { - jsonResult = System.IO.File.ReadAllText(documentPath); - } - else - { - return this.Content(jsonData["document"] + " is not found"); - } - } - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult ImportFormFields(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.ImportFormFields(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult ExportFormFields(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string jsonResult = pdfviewer.ExportFormFields(jsonData); - return Content(jsonResult); - } - - [System.Web.Mvc.HttpPost] - public ActionResult RenderPdfPages(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.GetPage(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult Unload(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - pdfviewer.ClearCache(jsonData); - return this.Content("Document cache is cleared"); - } - - [System.Web.Mvc.HttpPost] - public ActionResult RenderThumbnailImages(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object result = pdfviewer.GetThumbnailImages(jsonData); - return Content(JsonConvert.SerializeObject(result)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult Bookmarks(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.GetBookmarks(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult RenderAnnotationComments(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.GetAnnotationComments(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult Download(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonData); - return Content(documentBase); - } - - [System.Web.Mvc.HttpPost] - public ActionResult PrintImages(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object pageImage = pdfviewer.GetPrintImage(jsonData); - return Content(JsonConvert.SerializeObject(pageImage)); - } - - private HttpResponseMessage GetPlainText(string pageImage) - { - var responseText = new HttpResponseMessage(HttpStatusCode.OK); - responseText.Content = new StringContent(pageImage, System.Text.Encoding.UTF8, "text/plain"); - return responseText; - } - - private string GetDocumentPath(string document) - { - string documentPath = string.Empty; - if (!System.IO.File.Exists(document)) - { - var path = HttpContext.Request.PhysicalApplicationPath; - if (System.IO.File.Exists(path + "App_Data\\" + document)) - documentPath = path + "App_Data\\" + document; - } - else - { - documentPath = document; - } - return documentPath; - } - - public ActionResult Index() - { - return View(); - } - - public ActionResult About() - { - ViewBag.Message = "Your application description page."; - return View(); - } - - public ActionResult Contact() - { - ViewBag.Message = "Your contact page."; - return View(); - } - } - - public class jsonObjects - { - public string document { get; set; } - public string password { get; set; } - public bool isClientsideLoading { get; set; } - public string organizePages { get; set; } - public string zoomFactor { get; set; } - public string isFileName { get; set; } - public string xCoordinate { get; set; } - public string yCoordinate { get; set; } - public string pageNumber { get; set; } - public string documentId { get; set; } - public string hashId { get; set; } - public string sizeX { get; set; } - public string sizeY { get; set; } - public string startPage { get; set; } - public string endPage { get; set; } - public string stampAnnotations { get; set; } - public string textMarkupAnnotations { get; set; } - public string stickyNotesAnnotation { get; set; } - public string shapeAnnotations { get; set; } - public string measureShapeAnnotations { get; set; } - public string action { get; set; } - public string pageStartIndex { get; set; } - public string pageEndIndex { get; set; } - public string fileName { get; set; } - public string elementId { get; set; } - public string pdfAnnotation { get; set; } - public string importPageList { get; set; } - public string uniqueId { get; set; } - public string data { get; set; } - public string viewPortWidth { get; set; } - public string viewportHeight { get; set; } - public string tilecount { get; set; } - public bool isCompletePageSizeNotReceived { get; set; } - public string freeTextAnnotation { get; set; } - public string signatureData { get; set; } - public string fieldsData { get; set; } - public string formDesigner { get; set; } - public bool isSignatureEdited { get; set; } - public string inkSignatureData { get; set; } - public bool hideEmptyDigitalSignatureFields { get; set; } - public bool showDigitalSignatureAppearance { get; set; } - public bool digitalSignaturePresent { get; set; } - public string tileXCount { get; set; } - public string tileYCount { get; set; } - public string digitalSignaturePageList { get; set; } - public string annotationCollection { get; set; } - public string annotationsPageList { get; set; } - public string formFieldsPageList { get; set; } - public bool isAnnotationsExist { get; set; } - public bool isFormFieldAnnotationsExist { get; set; } - public string documentLiveCount { get; set; } - public string annotationDataFormat { get; set; } - } -} - -{% endhighlight %} -{% endtabs %} - -[ServiceUrl](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_ServiceUrl) is necessary to communicate with the server which also specifies the path of the controller. Here, PdfViewer is the name of the controller. - -[DocumentPath](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_DocumentPath) is the property needed to load a PDF file in the PDF Viewer. - -Press Ctrl+F5 (Windows) or +F5 (macOS) to run the app. Then, the Syncfusion® ASP.NET MVC PDF Viewer control will be rendered in the default web browser. - -![ASP.NET MVC PDF Viewer Control](AspNetMVC_Images/pdfviewer-control.png) - -N> We have provided the support to dynamically change the `serviceURL`. So, after changing the `serviceURL` dynamically, you need invoke the `pdfViewer.dataBind()` method to update the `serviceURL` quickly. This will effectively change the `serviceURL` dynamically. Ensure that this step is performed after version 23.1.36. - string serviceUrl = VirtualPathUtility.ToAbsolute("~/Home/"); - function load() { - var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0]; - pdfViewer.serviceUrl = '@serviceUrl' - pdfViewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; - pdfViewer.dataBind(); - pdfViewer.load(pdfViewer.documentPath, null); - } - -N> [View Sample in GitHub](https://github.com/SyncfusionExamples/ASP-NET-MVC-Getting-Started-Examples/tree/main/PDFViewer/ASP.NET%20MVC%20Razor%20Examples). - -N> You can refer to our [ASP.NET MVC PDF Viewer](https://www.syncfusion.com/aspnet-mvc-ui-controls/pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [ASP.NET MVC PDF Viewer example](https://ej2.syncfusion.com/aspnetmvc/PdfViewer/Default#/material) to understand the core features of PDF Viewer. - -N> When configuring the server-backed PDF viewer, it's essential to understand that there is no need to include the pdfium.js and pdfium.wasm files. Unlike the standalone PDF viewer, which relies on these files for local rendering, the server-backed PDF viewer fetches and renders PDFs directly from the server. Consequently, you can exclude the copy command for deployment process, as they are not required to load and display PDFs in this context. - -N> For hosting the web service on the Linux platform, ensure to include the [SkiaSharp.NativeAssets.Linux](https://nuget.org/packages/SkiaSharp.NativeAssets.Linux/3.116.1). Additionally, for AWS environments, utilize the following packages: - -| **Amazon Web Services (AWS)** |**NuGet package name** | -| --- | --- | -| AWS Lambda|[SkiaSharp.NativeAssets.Linux](https://nuget.org/packages/SkiaSharp.NativeAssets.Linux/3.116.1)| -| AWS Elastic Beanstalk |[SkiaSharp.NativeAssets.Linux.NoDependencies v3.116.1](https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux.NoDependencies/3.116.1)| \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/getting-started.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/getting-started.md deleted file mode 100644 index 312f497206..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/getting-started.md +++ /dev/null @@ -1,181 +0,0 @@ ---- -layout: post -title: Getting Started with EJ2 ASP.NET MVC PDF Viewer Control | Syncfusion -description: Learn how to getting started with PDF Viewer control in ASP.NET MVC application. You can view and comment on PDFs in ease and also can fill form fields. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Getting Started with ASP.NET MVC Standalone PDF Viewer Control - -The [ASP.NET MVC PDF Viewer](https://www.syncfusion.com/aspnet-mvc-ui-controls/pdf-viewer) control is used to viewing and printing PDF files in any web application. It provides the best viewing experience available with core interactions such as zooming, scrolling, text searching, text selection, and text copying. Thumbnail, bookmark, hyperlink and table of contents support provides easy navigation within and outside the PDF files. - -This section briefly explains about how to integrate ASP.NET MVC PDF Viewer control in your ASP.NET MVC application using Visual Studio. - -## Prerequisites - -[System requirements for ASP.NET MVC controls](https://ej2.syncfusion.com/aspnetmvc/documentation/system-requirements) - -## Integrate PDF Viewer into an ASP.NET MVC application - -1. Start Visual Studio and select **Create a new project**. -2. Create a new ASP.NET MVC Web Application project. -![Generate-ASP.NET-MVC-project-using-VS2022](AspNetMVC_Images/create-aspnet-mvc-project.png) -3. Choose the target framework. -![Set-the-project-Name](AspNetMVC_Images/set-project-name.png) -4. Select Web Application pattern (MVC) for the project and then select **Create** button. -![Select-web-application-pattern](AspNetMVC_Images/select-web-application-project.png) - -## ASP.NET MVC PDF Viewer NuGet packages installation - -To add .NET PDF Viewer control, the following NuGet packages need to be installed in your ASP.NET MVC application. - -* [Syncfusion.EJ2.MVC5](https://www.nuget.org/packages/Syncfusion.EJ2.MVC5) - -## Add namespace - -Add **Syncfusion.EJ2** namespace reference in `Web.config` under `Views` folder. - -``` - - - -``` - -## Add style sheet - -The theme is referred using CDN inside the `` of `~/Views/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - - -{% endhighlight %} -{% endtabs %} - -N> Checkout the [Themes topic](https://ej2.syncfusion.com/aspnetmvc/documentation/appearance/theme) to learn different ways (CDN, NPM package, and [CRG](https://ej2.syncfusion.com/aspnetmvc/documentation/common/custom-resource-generator)) to refer styles in ASP.NET MVC application, and to have the expected appearance for Syncfusion® ASP.NET MVC controls. - -## Add script reference - -Add the required scripts using CDN inside the `` of `~/Views/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - - -{% endhighlight %} -{% endtabs %} - -### Steps to Load PDF Viewer with Local script and style - -To use local resources with your PDF Viewer, follow these steps: - -**Step 1:** Place the `ej2.min.js` script and its related styles in `ej2` directory within the `Content` folder of your ASP.NET MVC application. - -**Step 2:** Insert the necessary script and style references within the `` section of your _Layout.cshtml file. Make sure these point to your local copies of the files instead of CDN links. - -By following these steps, you will configure your PDF Viewer to load the required script and style locally. See the code snippet below for reference. - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - ... - - - - -{% endhighlight %} -{% endtabs %} - -## Register Syncfusion® Script Manager - -Open `~/Views/Shared/_Layout.cshtml` page and register the script manager in the ASP.NET MVC application as follows. - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - -... - - @Html.EJS().ScriptManager() - - -{% endhighlight %} -{% endtabs %} - -N> Add the script manager `EJS().ScriptManager()` at the **end of ``**. - -## Add ASP.NET MVC PDF Viewer control - -Add the Syncfusion® ASP.NET MVC PDF Viewer control in `~/Views/Home/Index.cshtml` page. You can load a PDF file in the PDF Viewer by specifying the document name in the DocumentPath property as below. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml" %} - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
-
- -{% endhighlight %} -{% endtabs %} - -[DocumentPath](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_DocumentPath) is the property needed to load a PDF file in the PDF Viewer. - -### How to Configure PDF Viewer to Use Local Resources - -To utilize the `resourceUrl` and `documentPath` locally with your PDF Viewer, follow these instructions: - -**Step 1:** Ensure that your application includes the `ej2-pdfviewer-lib` folder. This folder must contain the `pdfium.js`, `pdfium.wasm` files, and the PDF file that you intend to display. These should be located in the `Content` folder within your project. - -**Step 2:** Assign local file paths to the `documentPath` and `resourceUrl` properties within the PDF Viewer setup. The `documentPath` should refer to your PDF file, while the `resourceUrl` should point to the directory containing the supporting resources. - -By following these steps, you will configure your PDF Viewer to load the required resources locally. See the code snippet below for reference. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml" %} - -@{ - ViewBag.Title = "Home Page"; - var originUrl = $"{Request.Url.Scheme}://{Request.Url.Authority}"; - var document = originUrl + "/Content/pdfsuccinctly.pdf"; - var resourceUrl = originUrl + "/Content/ej2-pdfviewer-lib"; -} - -
- @Html.EJS().PdfViewer("pdfviewer").ResourceUrl(@resourceUrl).DocumentPath(@document).Render() -
- -{% endhighlight %} -{% endtabs %} - -View the sample in GitHub to [load PDF Viewer with local resources](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to/Refer%20resource%20url%20locally/PdfViewer_MVC) - -Press Ctrl+F5 (Windows) or +F5 (macOS) to run the app. Then, the Syncfusion® ASP.NET MVC PDF Viewer control will be rendered in the default web browser. - -![ASP.NET MVC PDF Viewer Control](AspNetMVC_Images/pdfviewer-control.png) - -N> [View Sample in GitHub](https://github.com/SyncfusionExamples/ASP-NET-MVC-Getting-Started-Examples/tree/main/PDFViewer/ASP.NET%20MVC%20Razor%20Examples). - -N> You can refer to our [ASP.NET MVC PDF Viewer](https://www.syncfusion.com/aspnet-mvc-ui-controls/pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [ASP.NET MVC PDF Viewer example](https://ej2.syncfusion.com/aspnetmvc/PdfViewer/Default#/material) to understand the core features of PDF Viewer. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/globalization.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/globalization.md deleted file mode 100644 index db1dafa5fe..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/globalization.md +++ /dev/null @@ -1,552 +0,0 @@ ---- -layout: post -title: Globalization in ##Platform_Name## Pdfviewer Component | Syncfusion -description: Learn here all about Globalization in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Globalization -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Localization in the ASP.NET MVC PDF Viewer component - -The text contents provided in the PDF Viewer can be localized using the collection of localized strings for different cultures. By default, the PDF Viewer is localized in “__en-US__”. - -The following table shows the default text values used in Syncfusion® PDF Viewer in 'en-US' culture: - -|Keywords|Values| -|---|---| -|PdfViewer|PDF Viewer| -|Cancel|Cancel| -|Download file|Download file| -|Download|Download| -|Enter Password|This document is password protected. Please enter a password.| -|File Corrupted|File corrupted| -|File Corrupted Content|The file is corrupted and cannot be opened.| -|Fit Page|Fit page| -|Fit Width|Fit width| -|Automatic|Automatic| -|Go To First Page|Show first page| -|Invalid Password|Incorrect password. Please try again.| -|Next Page|Show next page| -|OK|OK| -|Open|Open file| -|Page Number|Current page number| -|Previous Page|Show previous page| -|Go To Last Page|Show last page| -|Zoom|Zoom| -|Zoom In|Zoom in| -|Zoom Out|Zoom out| -|Page Thumbnails|Page thumbnails| -|Bookmarks|Bookmarks| -|Print|Print file| -|Password Protected|Password required| -|Copy|Copy| -|Text Selection|Text selection tool| -|Panning|Pan mode| -|Text Search|Find text| -|Find in document|Find in document| -|Match case|Match case| -|Apply|Apply| -|GoToPage|Go to page| -|No Matches|Viewer has finished searching the document. No more matches were found| -|No Text Found|No Text Found| -|Undo|Undo| -|Redo|Redo| -|Annotation|Add or Edit annotations| -|Highlight|Highlight Text| -|Underline|Underline Text| -|Strikethrough|Strikethrough Text| -|Delete|Delete annotation| -|Opacity|Opacity| -|Color edit|Change Color| -|Opacity edit|Change Opacity| -|Highlight context|Highlight| -|Underline context|Underline| -|Strikethrough context|Strike through| -|Server error|Web-service is not listening. PDF Viewer depends on web-service for all it's features. Please start the web service to continue.| -|Open text|Open| -|First text|First Page| -|Previous text|Previous Page| -|Next text|Next Page| -|Last text|Last Page| -|Zoom in text|Zoom In| -|Zoom out text|Zoom Out| -|Selection text|Selection| -|Pan text|Pan| -|Print text|Print| -|Search text|Search| -|Annotation Edit text|Edit Annotation| -|Line Thickness|Line Thickness| -|Line Properties|Line Properties| -|Start Arrow|Start Arrow | -|End Arrow|End Arrow| -|Line Style|Line Style| -|Fill Color|Fill Color| -|Line Color|Line Color| -|None|None| -|Open Arrow|Open Arrow| -|Closed Arrow|Closed Arrow| -|Round Arrow|Round Arrow| -|Square Arrow|Square Arrow| -|Diamond Arrow|Diamond Arrow| -|Cut|Cut| -|Paste|Paste| -|Delete Context|Delete Context| -|Properties|Properties| -|Add Stamp|Add Stamp| -|Add Shapes|Add Shapes| -|Stroke edit|Stroke Edit| -|Change thickness|Change Thickness| -|Add line|Add Line| -|Add arrow|Add Arrow| -|Add rectangle|Add Rectangle| -|Add circle|Add Circle| -|Add polygon|Add Polygon| -|Add Comments|Add Comments| -|Comments| Comments| -|No Comments Yet|No Comments Yet| -|Accepted| Accepted| -|Completed| Completed| -|Cancelled| Cancelled| -|Rejected| Rejected| -|Leader Length|Leader Length| -|Scale Ratio|Scale Ratio| -|Calibrate| Calibrate| -|Calibrate Distance|Calibrate Distance| -|Calibrate Perimeter|Calibrate Perimeter| -|Calibrate Area|Calibrate Area| -|Calibrate Radius|Calibrate Radius| -|Calibrate Volume|Calibrate Volume| -|Depth|Depth| -|Closed|Closed| -|Round|Round| -|Square|Square| -|Diamond|Diamond| -|Edit|Edit| -|Comment|Comment| -|Comment Panel|Comment Panel| -|Set Status|Set Status| -|Post|Post| -|Page|Page| -|Add a comment|Add a comment| -|Add a reply|Add a reply| -|Import Annotations|Import Annotations| -|Export Annotations|Export Annotations| -|Add|Add| -|Clear|Clear| -|Bold|Bold| -|Italic|Italic| -|Strikethroughs|Strikethroughs| -|Underlines|Underlines| -|Superscript|Superscript| -|Subscript|Subscript| -|Align left|Align Left| -|Align right|Align Right| -|Center|Center| -|Justify|Justify| -|Font color|Font Color| -|Text Align|Text Align| -|Text Properties|Text Properties| -|Draw Signature|Draw Signature| -|Create| Create| -|Font family|Font Family| -|Font size|Font Size| -|Free Text|Free Text| -|Import Failed|Import Failed| -|File not found|File Not Found| -|Export Failed|Export Failed| -|Dynamic|Dynamic| -|Standard Business|Standard Business| -|Sign Here|Sign Here| -|Custom Stamp|Custom Stamp| -|InitialFieldDialogHeaderText|Initial Field Dialog Header Text| -|HandwrittenInitialDialogHeaderText|Handwritten Initial Dialog Header Text| -|SignatureFieldDialogHeaderText|Signature Field Dialog Header Text| -|HandwrittenSignatureDialogHeaderText|Handwritten Signature Dialog Header Text| -|Draw-hand Signature|Draw-hand Signature| -|Type Signature|Type Signature| -|Upload Signature|Upload Signature| -|Browse Signature Image|Browse Signature Image| -|Save Signature|Save Signature| -|Save Initial|Save Initial| -|highlight|highlight| -|underline|underline| -|strikethrough|strikethrough| -|FormDesigner|Form Designer| -|SubmitForm|Submit Form| -|Search text|Search Text| -|Draw Ink|Draw Ink| -|Revised|Revised| -|Reviewed|Reviewed| -|Received|Received| -|Confidential|Confidential| -|Approved|Approved| -|Not Approved|Not Approved| -|Witness|Witness| -|Initial Here|Initial Here| -|Draft|Draft| -|Final|Final| -|For Public Release|For Public Release| -|Not For Public Release|Not For Public Release| -|For Comment|For Comment| -|Void|Void| -|Preliminary Results|Preliminary Results| -|Information Only|Information Only| -|Enter Signature as Name|Enter Signature as Name| -|Textbox|Textbox| -|Password|Password| -|Check Box|Check Box| -|Radio Button|Radio Button| -|Dropdown|Dropdown| -|List Box|List Box| -|Signature|Signature| -|Delete FormField|Delete FormField| -|FormDesigner Edit text|Form Designer Edit Text| -|in|in| -|m|m| -|ft_in|ft_in| -|ft|ft| -|p|p| -|cm|cm| -|mm|mm| -|pt|pt| -|cu|cu| -|sq|sq| -|General|General| -|Appearance|Appearance| -|Options|Options| -|Textbox Properties|Textbox Properties| -|Name|Name| -|Tooltip|Tooltip| -|Value|Value| -|Form Field Visibility|Form Field Visibility| -|Read Only|Read Only| -|Required|Required| -|Checked|Checked| -|Show Printing|Show Printing| -|Formatting|Formatting| -|Fill|Fill| -|Border|Border| -|Border Color|Border Color| -|Thickness|Thickness| -|Max Length|Max Length| -|List Item|List Item| -|Export Value|Export Value| -|Dropdown Item List|Dropdown Item List| -|List Box Item List|List Box Item List| -|Delete Item|Delete Item| -|Up|Up| -|Down|Down| -|Multiline|Multiline| -|Initial|Initial| -|Export XFDF|Export XFDF| -|Import XFDF|Import XFDF| -|Organize Pages|Organize Pages| -|Insert Right|Insert Right| -|Insert Left|Insert Left| -|Total|Total| -|Pages|Pages| -|Rotate Right|Rotate Right| -|Rotate Left|Rotate Left| -|Delete Page|Delete Page| -|Delete Pages|Delete Pages| -|Copy Page|Copy Page| -|Copy Pages|Copy Pages| -|Save|Save| -|Save As|Save As| -|Select All|Select All| -|Import Document|Import Document| -|Match any word|Match any word| -|Client error|Client-side error is found. Please check the custom headers provided in the AjaxRequestSettings property and web action methods in the ServerActionSettings property| -|Cors policy error|Unable to retrieve the document due to an invalid URL or access restrictions. Please check the document URL and try again| -|No More Matches|Viewer has finished searching the document. No more matches were found| -|No Search Matches|No matches found| -|No More Search Matches|No more matches found| -|Exact Matches|EXACT MATCHES| -|Total Matches|TOTAL MATCHES| - -The different locale value for the PDF Viewer can be specified using the locale property. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -```html -
- @Html.EJS().PdfViewer("pdfviewer").Locale("ar-AE").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).Locale("ar-AE").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -You have to map the text content based on locale like the following script in sample level., - -```html - -``` diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/hand-written-signature.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/hand-written-signature.md deleted file mode 100644 index 0b43a118cc..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/hand-written-signature.md +++ /dev/null @@ -1,179 +0,0 @@ ---- -layout: post -title: Hand Written Signature in ##Platform_Name## Pdfviewer Component -description: Learn here all about Hand Written Signature in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Hand Written Signature -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Handwritten Signature - -The PDF Viewer control supports adding handwritten signatures to a PDF document. The handwritten signature reduces the paper work of reviewing the content and verifies it digitally. - -The following code snippet describes how to disable the handwritten signature in PDF Viewer. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -@Html.EJS().PdfViewer("pdfviewer").EnableHandwrittenSignature(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).EnableHandwrittenSignature(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() - -``` -{% endhighlight %} -{% endtabs %} - -## Adding a handwritten signature to the PDF document - -The handwritten signature can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Select the **HandWritten Signature** button in the annotation toolbar. The signature panel will appear. - -![HandWrittenSignature](./images/handwritten_sign.png) - -* Draw the signature in the signature panel. - -![SignaturePanel](./images/signature_panel.png) - -* Then click **Create** button and move the signature using the mouse and place them in the desired location. - -![SignatureAdded](./images/signature_added.png) - -## Adding a Handwritten signature to the PDF document Programmatically - -With the PDF Viewer library, you can programmatically add a handwritten signature to the PDF Viewer control using the **addAnnotation()** method. - -Here is an example of how you can use the **addAnnotation()** method to add the Handwritten signature programmatically - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -## Editing the properties of handwritten signature - -The stroke color, border thickness, and opacity of the handwritten signature can be edited using the edit stroke color tool, edit thickness tool, and edit opacity tool in the annotation toolbar. - -![SignatureProperties](./images/signature_properties.png) - -Refer to the following code snippet to set the default handwritten signature settings. - -```html -@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).HandWrittenSignatureSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerHandWrittenSignatureSettings { Opacity = 1, Thickness = 2 }).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() - -``` - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/access-file-name.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/access-file-name.md deleted file mode 100644 index 5fd53c258c..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/access-file-name.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -layout: post -title: Access File Name in ##Platform_Name## Pdfviewer Component -description: Learn here all about Access File Name in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Access File Name -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Access file name - -The PDF Viewer server library allows you to can access the filename of the loaded PDF document using the **documentLoad** and **downloadEnd** event. Using these events, we can access the filename while loading and downloading the PDF document. - -The following steps are used to access the file name of loaded PDF document in PDF viewer control, - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample. - -**Step 2:** Access file name using below code snippet, - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -```html -@Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() - - - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -```html -@Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() - - -``` -{% endhighlight %} -{% endtabs %} - -Download the sample [how to access file name](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVC_SAMPLE-609765609) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/add-annotation-in-text-search.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/add-annotation-in-text-search.md deleted file mode 100644 index b7b410cb7f..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/add-annotation-in-text-search.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -layout: post -title: Add Annotation in Text Search in ##Platform_Name## | Syncfusion -description: Learn how to add rectangle annotations using search text bounds in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Add Rectangle Annotations Using Search Text Bounds in PDF Viewer - -## Overview - -This guide demonstrates how to add rectangle annotations based on the bounds of highlighted search text in the PDF Viewer. This technique is useful for emphasizing search results with visual markers in annotation-supported applications. - -## Steps to Add Rectangle Annotations on Search Result Highlight - -**Step 1:** Set Up the PDF Viewer in Your ASP.NET MVC Project - -Follow the steps provided in the [Syncfusion PDF Viewer Getting Started Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a basic PDF Viewer sample. - -**Step 2:** Set Up the PdfViewer Component to add rectangle annotations based on the bounds of highlighted search text in the PDF Viewer. - -```cs -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
- - - -
-
- - @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").TextSearchHighlight("handleTextSearchHighlight").Render() -
- - - -``` - -By following this guide, you will enable the PDF Viewer to add rectangle annotations at search result locations, thus increasing the visibility of search results in your application. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/add-save-button.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/add-save-button.md deleted file mode 100644 index 9cefca39a4..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/add-save-button.md +++ /dev/null @@ -1,132 +0,0 @@ ---- -layout: post -title: Add Save Button in Built-In Toolbar | Syncfusion -description: Learn here all about adding save button in built-in Toolbar in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Add Save Button -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Add Save Button in Built-In Toolbar - -PDF Viewer allows you to customize(add, show, hide, enable, and disable) existing items in a toolbar. - -* Save button - New `save` button-item can be defined by **CustomToolbarItemModel** and with existing items in [**ToolbarSettings**](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html) property. `Save' button-item click action can be defined in `toolbarclick`. - -* Show, Hide - `Save` button-item can be shown or hidden using the [`ToolbarSettings`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html) property. Pre-defined toolbar items are available with [`ToolbarItem`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html#Syncfusion_EJ2_PdfViewer_PdfViewerToolbarSettings_ToolbarItems) . - -* Enable, Disable - `save` button-item can be enabled or disable using `enabletoolbaritem`. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
-
-

- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").ResourceUrl("https://cdn.syncfusion.com/ej2/24.1.41/dist/ej2-pdfviewer-lib").ToolbarClick("toolbarClick").Render() -
-
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
-
-

- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).ToolbarClick("toolbarClick").Render() -
-
- - -{% endhighlight %} -{% endtabs %} - -N> Default value of toolbar items is ['OpenOption', 'PageNavigationTool','MagnificationTool', 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'DownloadOption','UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', 'CommentTool', 'SubmitForm'] - -### Align Property - -The align property is used to specify the alignment of a toolbar item within the toolbar. - -`Left`: Aligns the item to the left side of the toolbar. -`Right`: Aligns the item to the right side of the toolbar. - -### Tooltip Property - -The tooltip property is used to set the tooltip text for a `save` button-item. Tooltip provides additional information when a user hovers over the item. - -### CssClass Property - -The cssClass property is used to apply custom CSS classes to a `save` button-item. It allows custom styling of the `save` button-item. - -### Prefix Property - -The prefix property is used to set the CSS class or icon that should be added as a prefix to the existing content of the `save`button-item. - -### ID Property - -The id property within a CustomToolbarItemModel is a compulsory attribute that plays a vital role in toolbar customization. It serves as a unique identifier for each toolbar item, facilitating distinct references and interactions. - -When defining or customizing toolbar items, it is mandatory to assign a specific and descriptive id to each item. -These properties are commonly used when defining custom toolbar items with the `CustomToolbarItemModel`` in the context of Syncfusion® PDF Viewer. When configuring the toolbar using the `ToolbarSettings`` property, you can include these properties to customize the appearance and behavior of each toolbar item. - -N> When customizing toolbar items, you have the flexibility to include either icons or text based on your design preference. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/close-comment-panel.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/close-comment-panel.md deleted file mode 100644 index 4a36a71101..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/close-comment-panel.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -layout: post -title: Close Comment Panel in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Close Comment Panel in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Close Comment Panel -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Close the comment panel - -The PDF Viewer server library allows you to close the comment panel programmatically using the external button event. - -The following steps are used to close the comment panel programmatically in PDF Viewer, - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample. - -**Step 2:** Add the following code snippet to close the comment panel using button click event - -```html - - - - - -``` - -Download the sample [how to close comment panel](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVC_SAMPLE1299715828) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/configure-annotation-selector-setting.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/configure-annotation-selector-setting.md deleted file mode 100644 index afec2d3cf5..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/configure-annotation-selector-setting.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -layout: post -title: Annotation Selector Setting in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Configuring AnnotationSelector setting in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# How to Configure Annotation Selector Settings - -### Annotation Selector Settings - -The [**annotationSelectorSettings**](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerAnnotationSelectorSettings.html) property allows you to customize the appearance and behavior of the annotation selector in the UI. The AnnotationSelectorSettings defines the settings for the annotation selector, including border colors, sizes, and shapes. It provides fine-grained control over how annotations are displayed and interacted with. - -### How to Configure Annotation Selector Settings - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Set Up PDF Viewer in Your View: Add the following code snippet to your view (e.g., Index.cshtml) - -``` -@{ - ViewData["Title"] = "PDF Viewer"; -} -
-
-

- @Html.EJS().PdfViewer("pdfviewer") - .DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf") - .ResourceUrl("https://cdn.syncfusion.com/ej2/24.1.41/dist/ej2-pdfviewer-lib") - .Render() -
-
-``` - -**Step 3:** Add JavaScript for Annotation Selector Settings: Below the PDF Viewer in your view, include the following script to configure the annotationSelectorSettings - -``` - -``` -#### Key properties include: - -* **selectionBorderColor**: Sets the color for the border around selected annotations. - -* **resizerBorderColor**: Sets the color for the border of the resizer handles. - -* **resizerFillColor**: Defines the fill color for the resizer handles. - -* **resizerSize**: Determines the size of the resizer handles. - -* **selectionBorderThickness**: Specifies how thick the selection border should be. - -* **resizerShape**: Allows you to choose the shape of the resizer handles (e.g., Circle or Square). - -* **selectorLineDashArray**: Specifies the dash pattern for the selector line to enhance visual cues. - -* **resizerLocation**: Determines where the resizer appear in relation to the annotation (e.g., Corners or Edges). - -* **resizerCursorType**: Sets the cursor style when hovering over the resizer, improving user interaction. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/control-annotation-visibility.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/control-annotation-visibility.md deleted file mode 100644 index 6b3dae90ac..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/control-annotation-visibility.md +++ /dev/null @@ -1,98 +0,0 @@ ---- -layout: post -title: Annotations Visibility in EJ2 ASP.NET MVC PdfViewer | Syncfusion -description: Learn how to Control PDF Annotations Visibility in the Syncfusion ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Control PDF Annotations Visibility -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Control PDF Annotations Visibility in PDF Viewer - -### Overview - -This guide demonstrates how to control the visibility of PDF annotations in documents loaded and saved using the Syncfusion PDF Viewer. This process allows the annotations to be visible only in the Syncfusion PDF Viewer. - -### How to Control Annotation Visibility - -**Step 1:** Set Up the PdfViewer in Your ASP.NET MVC Project - - Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Set Up Your ASP.NET MVC Component - -Create an ASP.NET MVC component and update the template to include a button that triggers the download operation. Additionally, create a function to save the document with the PDF annotation flag set to `noView`. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} -
-
- - - @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/annotations-v1.pdf").DocumentLoad("documentLoad").DownloadEnd("documentLoad").Render() -
-
- - - -{% endhighlight %} -{% endtabs %} - -By following these steps, the annotations in a PDF document can be set to be visible in the Syncfusion PDF Viewer, providing control over annotation visibility based on different platforms. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md deleted file mode 100644 index 30de6b7d0a..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md +++ /dev/null @@ -1,117 +0,0 @@ ---- -layout: post -title: Converting Library Bounds in EJ2 ASP.NET MVC PdfViewer | Syncfusion -description: Learn how to convert Library bounds into Viewer bounds in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Converting PDF Library Bounds to PDF Viewer Bounds - -### Overview - -When exporting annotations from the PDF Library, you may need to convert the bounds values into the PDF Viewer format. This guide will help you achieve that using the Syncfusion PDF Viewer component. - -### How to Convert Bounds Values - -**Step 1:** Initialize the PdfViewer Instance - -Create an instance of the PdfViewer and configure it with the required services. - -**Step 2:** Handle Export Success - -Convert the exported blob URL to an object and then extract and convert the annotation bounds. - -**Step 3:** Create a Function to Convert Blob URL to Object - -This function fetches the blob data and converts it into a JSON object. - -{% tabs %} -{% highlight html tabtitle="Server-Backed" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
-
- - - -{% endhighlight %} -{% endtabs %} - -### Conclusion - -By following these steps, you can successfully convert PDF Library bounds values into PDF Viewer bounds values when exporting annotations as JSON. This will help maintain accuracy in the annotation placement and ensure a seamless user experience. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/custom-context-menu.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/custom-context-menu.md deleted file mode 100644 index 0815d6f098..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/custom-context-menu.md +++ /dev/null @@ -1,390 +0,0 @@ ---- -layout: post -title: Customize context menu with EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Customize context menu in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Customize context menu - -PDF Viewer allows you to add custom option in context menu. It can be achieved by using the `addCustomMenu()` method and custom action is defined using the `customContextMenuSelect()`method. - -### Add Custom Option - -The following code shows how to add custom option in context menu. - -``` - -``` - -### Customize custom option in context menu - -The PDF Viewer feature enables customization of custom options and the ability to toggle the display of the default context menu. When the addCustomMenu parameter is set to `true`, the default menu is hidden; conversely, when it is set to `false`, the default menu items are displayed. - -``` - -``` - -#### Customize added context menu items - -The following code shows how to hide/show added custom option in context menu using the `customContextMenuBeforeOpen()` method. - -``` - -``` - -The following is the output of custom context menu with customization. - -``` - -@using Syncfusion.EJ2 - -
-
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").ResourceUrl("https://cdn.syncfusion.com/ej2/23.2.6/dist/ej2-pdfviewer-lib").CustomContextMenuSelect("customContextMenuSelect").CustomContextMenuBeforeOpen("customContextMenuBeforeOpen").DocumentLoad("documentLoaded").Render() -
-
- - -``` - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to/Custom%20Context%20Menu/PDFViewerSample) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/custom-font-signature-field.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/custom-font-signature-field.md deleted file mode 100644 index 04b8b8af9d..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/custom-font-signature-field.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -layout: post -title: How to change the font family in Syncfusion ASP .MVC. -description: Learn how to change the font family in Form Field's Type Signature in Syncfusion ASP .MVC Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# To Change the Font Family -Change the Font Family in Type Signature of the Syncfusion® PDF Viewer by adding a custom css stylesheet to the document , and then apply the desired font family to the type signature element. Include the Google font link in the HTML head section to apply the Google Font. - -### Signature Field property -The Syncfusion® PDF Viewer provides the ability to change the font family for Signature and Initial Field using `typeSignatureFonts` and `typeInitialFonts` property. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Insert the following code snippet to implement the functionality for using custom fonts in Signature field. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html - - - - -``` - -
- @Html.EJS().PdfViewer("pdfviewer").ChangeFontFamily("changeFontFamily").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -### Initial Field property -Insert the following code snippet to implement the functionality for using custom fonts in Initial field. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html - - - - -``` - -
- @Html.EJS().PdfViewer("pdfviewer").ChangeFontFamily("changeFontFamily").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -By implementing this , you can use custom fonts in form field's signature in both `signature` and `initial` field \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/custom-fonts.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/custom-fonts.md deleted file mode 100644 index 119d1ce93f..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/custom-fonts.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: post -title: Add custom fonts to the PDF Viewer using the PDF document | Syncfusion -description: Learn here all about how to add custom fonts using the PDF document in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# How to add custom fonts to the PDF viewer used in the PDF document - -To use custom fonts in the Syncfusion® PDF Viewer within your PDF document, you need to add the custom TTF font files to the resource URL directory and configure the viewer to load these fonts. You can specify the custom font names using the -**customFonts** property, which accepts an array of font names. - -The following steps are used to customize the selection border. - -**Step 1:** Add the custom TTF font files to the resource URL path referenced in your application. For example, place the custom TTF files in the ej2-pdfviewer-lib folder, which will serve as the resource URL path. - -**Step 2:** The following code snippet are how you can add custom fonts to the PDF viewer. - -```html - -
- -
-
- - - -``` - -By following these steps, you can successfully integrate and use custom fonts in your PDF documents displayed in the EJ2 PDF Viewer. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/default-width-height.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/default-width-height.md deleted file mode 100644 index dde296521c..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/default-width-height.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -layout: post -title: How to change default size in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn how to change the default width and height in the ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: How to change the default width and height -publishingplatform: ej2-asp-core-mvc -documentation: UG ---- - -# How to change the default width and height - -To change the default width and height of the Syncfusion® PDF Viewer, modify the `Width` and `Height` properties of the PDFViewer control. - -```html -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Height("1000px").Width("80%").Render() -
-
-``` -In this example, the Width property is set to `80%`, and the Height property is set to `1000px`. Change these values to any desired size in pixels or percentages. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/EJ2-69063-defaultWidthHeight/How%20to/Change%20Default%20Height%20and%20Width) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/delete-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/delete-annotation.md deleted file mode 100644 index bb731c42e7..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/delete-annotation.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -layout: post -title: Delete Annotation in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Delete Annotation in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Delete Annotation -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - -# Delete a specific annotation using deleteAnnotationById - -The PDF Viewer server library allows you to delete a specific annotation from a PDF document. Deleting a specific annotation can be done using the **deleteAnnotationById()** method. This method is used to delete a specific annotation using its id. - -The following steps are used to delete a specific annotation from PDF Document. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to delete a specific annotation using `deleteAnnotationById()` method. - -```html - - - - -``` - -Download the sample [how to delete a specific annotation using deleteAnnotationById](https://www.syncfusion.com/downloads/support/directtrac/general/ze/EJ2MvcSample357842164.zip) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/download-start-event.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/download-start-event.md deleted file mode 100644 index 3151301941..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/download-start-event.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -layout: post -title: Controlling File Downloads in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here how to Controlling File Downloads in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Controlling File Downloads in Syncfusion® PDF Viewer - -In the Syncfusion® PDF Viewer, we've introduced a new feature that enables you to manage file downloads more effectively. This feature allows you to intercept and potentially skip the download process of a PDF document, providing enhanced control over user interactions within your application. - -### Using the downloadStart Event - -The key to this functionality lies in the downloadStart event, which offers a mechanism to intercept the initiation of the download process. Within the event handler, you can set the cancel argument to true to programmatically prevent the download action from proceeding. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@{ - ViewBag.Title = "Home Page"; -} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").DownloadStart("downloadStart").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -@{ - ViewBag.Title = "Home Page"; -} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").DownloadStart("downloadStart").Render() -
- - - -{% endhighlight %} -{% endtabs %} - - -By default, the cancel argument is set to `false`, indicating that the download action will proceed unless explicitly canceled by your custom logic. - -### Enhanced Flexibility - -By leveraging the `downloadStart` event and its cancel argument, you gain the ability to implement custom logic to control and potentially prevent download actions based on your application's specific requirements. This enhancement provides greater flexibility in managing user interactions with PDF documents, empowering you to tailor the experience according to your needs. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/enable-local-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/enable-local-storage.md deleted file mode 100644 index 6e3be776c7..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/enable-local-storage.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -layout: post -title: Managing Local Storage in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn how to manage local storage in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Managing Local Storage in Syncfusion PDF Viewer - -The Syncfusion PDF Viewer provides the `enableLocalStorage` property, which allows you to control how session-specific data is stored. You can choose to store this data in an internal collection or rely on the default session storage. - -### Using the enableLocalStorage Property - -Set the `enableLocalStorage` property to manage whether the PDF Viewer uses session storage (default) or an internal collection. When set to `true`, session-specific data is kept in memory. Otherwise, session storage is used. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
- - @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - - - -{% endhighlight %} -{% endtabs %} - -### Impact and Considerations - -- **Increased Memory Usage**: Setting `enableLocalStorage` to `true` can increase memory usage, particularly with larger documents or those containing many interactive elements, such as form fields and annotations. -- **Avoiding Memory Leaks**: It is crucial to properly dispose of the PDF Viewer instance when it's no longer needed to prevent memory leaks, especially when using in-memory storage. -- **Default Behavior**: By default, this property is set to `false`, meaning the session storage mechanism is utilized unless explicitly changed. - -### Enhanced Control - -Leveraging the `enableLocalStorage` property provides greater flexibility in managing how data is stored during a session, allowing you to optimize performance and storage based on your application’s specific requirements. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/enable-text-selection.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/enable-text-selection.md deleted file mode 100644 index f5943caf71..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/enable-text-selection.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -layout: post -title: Enable or Disable Text Selection in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about enabling text selection in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Enable or Disable Text Selection in Syncfusion PDF Viewer - -The Syncfusion PDF Viewer provides the `EnableTextSelection` property, which allows you to control whether users can select text within the displayed PDF document. This feature can be toggled programmatically during runtime. - -## Configure Text Selection on Initialization - -You can set the initial text selection behavior when initializing the PDF Viewer control by configuring the `EnableTextSelection` property. By default, text selection is enabled, but you can disable it as shown in the following example: - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer") - .DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf") - .ResourceUrl("https://cdn.syncfusion.com/ej2/30.1.37/dist/ej2-pdfviewer-lib") - .EnableTextSelection(false) - .Render() -
-
- -{% endhighlight %} -{% endtabs %} - -## Toggle Text Selection Dynamically - -You can change the text selection behavior at runtime using buttons, menu options, or other UI elements. The following example demonstrates how to toggle text selection with button clicks: - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
-
- - - @Html.EJS().PdfViewer("pdfviewer") - .DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf") - .ResourceUrl("https://cdn.syncfusion.com/ej2/30.1.37/dist/ej2-pdfviewer-lib") - .EnableTextSelection(false) - .Render() -
-
- - - -{% endhighlight %} -{% endtabs %} - -## Use Cases and Considerations - -- **Document Protection**: Disabling text selection helps prevent unauthorized copying of sensitive content. -- **Read-only Documents**: In scenarios where documents are meant for viewing only, disabling text selection can provide a cleaner user experience. -- **Interactive Applications**: Toggle text selection based on user roles or document states in complex applications. -- **Controlled Access**: Implement conditional text selection depending on user permissions or document sections. - -## Default Behavior - -By default, text selection is enabled in the PDF Viewer. Set the `EnableTextSelection` property to `false` explicitly if you want to disable this functionality. - -N> When text selection is disabled, users will not be able to select or copy text from the document, which can be useful for protecting document content in certain scenarios. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/export-as-image-standalone.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/export-as-image-standalone.md deleted file mode 100644 index e2e527add0..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/export-as-image-standalone.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -layout: post -title: Export As Image in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Export As Image in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Export As Image from PDF document - -The PDF Viewer library allows you to export specified pages as a Base64-encoded image string using the **exportAsImage()** method and exporting a range of pages as Base64-encoded image strings using the **exportAsImages()** method. - -The following steps are used to exportAsImage. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** The following code snippet to implement the functionality for exporting a specified page as a Base64-encoded image string or exporting a range of pages as Base64-encoded image strings. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -Similarly, to code snippet for exports the specified page as a Base64-encoded image string, allowing for custom image size: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -Similarly, to code snippet for exports the range of pages as Base64-encoded image strings: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -Similarly, to code snippet for exports the range of pages as Base64-encoded image strings, allowing for custom image size: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -By following these steps, you can successfully integrate and use the export as image API in the EJ2 PDF Viewer. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/export-as-image.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/export-as-image.md deleted file mode 100644 index f04c5617a7..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/export-as-image.md +++ /dev/null @@ -1,164 +0,0 @@ ---- -layout: post -title: Export As Image in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn how to export as image in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Export As Image -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - -# Exporting PDFs as raster images - -The PDF Viewer server library allows the PDF document pages to be exported as raster images. Exporting can be done using the ExportAsImage() method. This option helps to convert a PDF into an image. The APIs available to export the PDF document pages as images are listed as follows: - -## ExportAsImage(int pageindex) - -Exports the specified page as image using the Pdfium rendering engine. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory/../../../../Data/HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap bitmapimage = pdfExportImage.ExportAsImage(0); -//Save the exported image in disk -bitmapimage.Save(@"currentDirectory/../../../../Images/" + "bitmapImage.png"); - -``` - -## ExportAsImage(int pageIndex, float dpiX, float dpiY) - -Exports the specified page as image with respect to the specified DPI values. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory/../../../../Data/HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap bitmapimage = pdfExportImage.ExportAsImage(0, 200, 200); -//Save the exported image in disk -bitmapimage.Save(@"currentDirectory/../../../../Images/" + "bitmapImage.png"); - -``` - -## ExportAsImage(int pageIndex, SizeF customSize, bool keepAspectRatio) - -Exports the specified page as image with respect to the specified custom size. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory/../../../../Data/HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap bitmapimage = pdfExportImage.ExportAsImage(0, new SizeF(200, 300), true); -//Save the exported image in disk -bitmapimage.Save(@"currentDirectory/../../../../Images/" + "bitmapImage.png"); - -``` - -## ExportAsImage(int pageIndex, SizeF customSize, float dpiX, float dpiY, bool keepAspectRatio) - -Exports the specified page as image with respect to the custom size and the specified DPI values. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory/../../../../Data/HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap bitmapimage = pdfExportImage.ExportAsImage(0, new SizeF(200, 300),200,200, true); -//Save the exported image in disk -bitmapimage.Save(@"currentDirectory/../../../../Images/" + "bitmapImage.png"); - - -``` - -## ExportAsImage(int startIndex, int endIndex) - -Exports the specified pages as images using the Pdfium rendering engine. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory/../../../../Data/HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap[] bitmapimage = pdfExportImage.ExportAsImage(0, pdfExportImage.PageCount-1); -for (int i =0; i < pdfExportImage.PageCount; i++) -{ - // Save the exported image in disk - bitmapimage[i].Save(@"currentDirectory/../../../../Images/" + "bitmapImage.png"); -} - -``` - -## ExportAsImage(int startIndex, int endIndex, float dpiX, float dpiY) - -Exports the specified pages as images with respect to the specified DPI values. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory/../../../../Data/HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap[] bitmapimage = pdfExportImage.ExportAsImage(0, pdfExportImage.PageCount-1, 200, 200); -for (int i =0; i < pdfExportImage.PageCount; i++) -{ - //Save the exported image in disk - bitmapimage[i].Save(@"currentDirectory/../../../../Images/" + "bitmapImage.png"); -} - -``` - -## ExportAsImage(int startIndex, int endIndex, SizeF customSize, bool keepAspectRatio) - -Exports the specified pages as images with respect to the specified custom size. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory/../../../../Data/HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap[] bitmapimage = pdfExportImage.ExportAsImage(0, pdfExportImage.PageCount-1, new SizeF(200, 300), false); -for (int i =0; i < pdfExportImage.PageCount; i++) -{ - //Save the exported image in disk - bitmapimage[i].Save(@"currentDirectory/../../../../Images/" + "bitmapImage.png"); -} - -``` - -## ExportAsImage(int startIndex, int endIndex, SizeF customSize, float dpiX, float dpiY, bool keepAspectRatio) - -Exports the specified pages as images with respect to the custom size and the specified DPI values. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory/../../../../Data/HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap[] bitmapimage = pdfExportImage.ExportAsImage(0, pdfExportImage.PageCount-1, new SizeF(200, 300),200,200,false); -for (int i = 0; i < pdfExportImage.PageCount; i++) -{ - //Save the exported image in disk - bitmapimage[i].Save(@"currentDirectory/../../../../Images/" + "bitmapImage.png"); -} - -``` - -N> Ensure the provided document path and output image saved locations in your application level. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text-completed.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text-completed.md deleted file mode 100644 index 5c42b9f23a..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text-completed.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -layout: post -title: extractTextCompleted Event in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about extractTextCompleted Event in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Extract text using extractTextCompleted Event - -The PDF Viewer library allows you to extract the text from a page along with the bounds. Text extraction can be done using the **isExtractText** property and [**extractTextCompleted**](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_ExtractTextCompleted) event. `extractTextCompleted` event Triggers when an text extraction is completed in the PDF Viewer. - -Here is an example of how you can use the extractTextCompleted event: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
- - @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - - - - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text-option.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text-option.md deleted file mode 100644 index fd1c10e36b..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text-option.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -layout: post -title: Extract text Option in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Extract text Option in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Extract Text Option in Syncfusion PDF Viewer - -The `extractTextOption` property in the Syncfusion PdfViewer control allows you to optimize memory usage by controlling the level of text extraction. This setting influences the data returned in the `extractTextCompleted` event. You can select one of the following options to determine the kind of text extraction and layout information to retrieve. - -### Available Options: - -**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. - -**TextOnly:** Extracts only the plain text from the document. This option excludes any layout or positional information. - -**BoundsOnly:** Extracts layout information, such as bounds or coordinates, without including the plain text data. - -**TextAndBounds:** Extracts both the plain text and the layout (bounds) information, which is the default behavior. - -The following example demonstrates how to configure the `extractTextOption` property to control the level of text extraction: - - - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
- - @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - - - -{% endhighlight %} -{% endtabs %} - -### Description of Each Option -**extractTextOption.TextAndBounds (default):** This option returns both plain text and its positional data (bounds). Use this option when you need to access both the content of the PDF and its layout for further processing or analysis. - -**extractTextOption.TextOnly:** This option returns only the plain text from the PDF. No positional or layout data is included. Note that when using this option, text search functionality will be disabled. In such cases, it is recommended to use findTextAsync for text searching. - -**extractTextOption.BoundsOnly:** This option returns only the layout information (bounds) of the text, excluding the actual content. It is useful when the focus is on the position of text elements rather than the text itself. - -**extractTextOption.None:** This option does not extract or return any text or layout information. It is used to optimize memory usage when no text extraction is necessary. This setting is only relevant for the `extractTextCompleted` event and cannot be used with the `ExtractText` method. - -N> Text Search: When using the `extractTextOption.TextOnly` and `extractTextOption.None` option, the findText method will not work. Instead, you should use the findTextAsync method to perform text searches asynchronously. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text-using-text-collection.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text-using-text-collection.md deleted file mode 100644 index 6e6f86ab62..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text-using-text-collection.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -layout: post -title: Extract Text Using Text Collection in Syncfusion ##Platform_Name## Pdfviewer Component -description: Learn here all about Extract Text Using Text Collection in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Extract Text Using Text Collection -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Extract Text using TextLineCollection - -The PDF Viewer server library allows you to extract the text from a page along with the bounds using TextLineCollection. Text extracting can be done using the **ExtractText()** method. - -Add the following dependency to your application using the `NuGet Package Manager`. -* Syncfusion.EJ2.PdfViewer.AspNet.Mvc5 - -N>From Volume 2 2019 release Syncfusion.Pdf.AspNet.Mvc5 and Syncfusion.Compression.Base packages are added as dependency for PDF Viewer control. Ensure the dependency packages are referred in your application properly. - -The following code snippet explains how to extract the text from a page using TextLineCollection. - -```cs - -var path = @"currentDirectory/../../../../Data/Simple.pdf"; -var fileInfo = new FileInfo(path); -var docStream = new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read); -// Load the PDF document. -PdfLoadedDocument document = new PdfLoadedDocument(docStream); -// Loading page collections -PdfPageBase page = document.Pages[0] as PdfLoadedPage; -//Extract text from the page. -var text = page.ExtractText(out TextLineCollection textLineCollection); - -``` - -Find the sample [How to extract text using TextLineCollection](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Wordbound1901545288.zip) - -N>Ensure the provided document path and output text saved locations in your application level. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text.md deleted file mode 100644 index 9d4407f038..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/extract-text.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -layout: post -title: Extract Text in Syncfusion ##Platform_Name## Pdfviewer Component -description: Learn here all about Extract Text in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Extract Text -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Extract Text from PDF document -## Extract Text in server backed mode. - -The PDF Viewer server library allows you to extract the text from a page along with the bounds. Text extracting can be done using the ExtractText() method. Add the following dependency to your application using the `NuGet Package Manager`. -* Syncfusion.EJ2.PdfViewer.AspNet.Mvc5 - -N>From Volume 2 2019 release Syncfusion.Pdf.AspNet.Mvc5 and Syncfusion.Compression.Base packages are added as dependency for PDF Viewer control. Ensure the dependency packages are referred in your application properly. - -The following code snippet explains how to extract the text from a page. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExtractText = new PdfRenderer(); -pdfExtractText.Load("../../Data/HTTP Succinctly.pdf"); -//Returns the bounds of the text -List textCollection = new List(); -//Extracts the text from the first page of the PDF document along with its bounds -string text = pdfExtractText.ExtractText(0, out textCollection); -System.IO.File.WriteAllText("../../Data/data.txt", text); - -``` - -Sample: -[https://www.syncfusion.com/downloads/support/directtrac/general/ze/ExtractText853154752](https://www.syncfusion.com/downloads/support/directtrac/general/ze/ExtractText853154752) - -N>Ensure the provided document path and output text saved locations in your application level. - -## Extract Text Method in standalone mode - -The `extractText` method of the Syncfusion PdfViewer control enables text extraction from one or more pages in a PDF document. This method is useful for retrieving the text content along with its associated data, such as the bounds of each text element. - -### extractText Method -The extractText method retrieves text data from the specified page(s) of a PDF document. It can extract text from one page, a range of pages, or even provide detailed text data, depending on the options specified. - -#### Parameters: -**startIndex:** The starting page index for text extraction (0-based index). - -**endIndex Or isOptions:** This can either be the ending page index for the text extraction (for extracting from multiple pages) or an option specifying text extraction criteria for a single page. - -**options (optional):** Specifies additional options, such as extracting plain text `TextOnly` or more detailed text data `TextAndBounds`. You can specify various options for text extraction. These options determine whether you want to extract plain text, text with bounds, or detailed text data. - -***TextOnly:*** Extracts only the plain text content without bounds or additional information. - -***TextAndBounds:*** Extracts text content along with its bounds (coordinates) within the PDF. - -#### Returns: -The method returns a Promise that resolves to an object containing two properties: - -**textData:** An array of TextDataSettingsModel objects, each representing the details of the extracted text (including bounds, page text, etc.). - -**pageText:** A concatenated string of plain text extracted from the specified page(s). - -### Usage of extractText in Syncfusion PdfViewer Control -Here is an example that demonstrates how to use the extractText method: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
- - - - @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - - - - -{% endhighlight %} -{% endtabs %} - -#### Explanation: -**Single Page Extraction:** The first `extractText` call extracts text from page 1 (`startIndex = 1`), using the 'TextOnly' option for plain text extraction. - -**Multiple Pages Extraction:** The second extractText call extracts text from pages 0 through 2 (`startIndex = 0, endIndex = 2`), using the `TextOnly` option for plain text extraction. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/find-text-async.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/find-text-async.md deleted file mode 100644 index c17c8aef93..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/find-text-async.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -layout: post -title: Find Text Async in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn about the `findTextAsync` in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Find Text using findTextAsync Method in Syncfusion PdfViewer - -The findTextAsync method in the Syncfusion PdfViewer control allows you to search for specific text or an array of strings asynchronously within a PDF document. The method returns the bounding rectangles for each occurrence of the search term, allowing you to find and work with text positions in the document. - -Here is an example of how you can use the **findTextAsync** method: - - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
- - - - @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- - - - - -{% endhighlight %} -{% endtabs %} - -### Description: - -The `findTextAsync` method is designed for performing an asynchronous text search within a PDF document. You can use it to search for a single string or multiple strings, with the ability to control case sensitivity. By default, the search is applied to all pages of the document. However, you can adjust this behavior by specifying the page number (pageIndex), which allows you to search only a specific page if needed. - -### Parameters: - -**text (string | string[]):** - -The text or an array of texts you want to search for in the document. - -**matchCase (boolean):** - -Indicates whether the search should be case-sensitive. -When set to true, the search will match the exact case. -When set to false, the search will ignore case differences. - -**pageIndex (optional, number):** - -Specifies the page number (zero-based index) to search within the document. -If not provided, the search will be performed across all pages in the document. -For example, passing 0 would search only the first page of the document. - -### Example Workflow: - -**findTextAsync('pdf', false):** -This will search for the term "pdf" in a case-insensitive manner across all pages of the document. - -**findTextAsync(['pdf', 'the'], false):** -This will search for the terms "pdf" and "the" in a case-insensitive manner across all pages of the document. - -**findTextAsync('pdf', false, 0):** -This will search for the term "pdf" in a case-insensitive manner only on the first page (page 0). - -**findTextAsync(['pdf', 'the'], false, 1):** -This will search for the terms "pdf" and "the" in a case-insensitive manner only on the second page (page 1). - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/get-Page-Info.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/get-Page-Info.md deleted file mode 100644 index acff766cd0..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/get-Page-Info.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -layout: post -title: Get Page Info in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Get Page Info in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Get Page Info from PDF document - -The PDF Viewer library allows you to retrieves the information of a specified page in the viewer using the **getPageInfo()** method.This provides essential information such as the height, width and rotation. - -The following steps are used to getPageInfo. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** The following code snippet to implement the functionality for retrieving height, width and rotation of a specified page in the viewer. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
-
- - - - @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
-
- - - - - -{% endhighlight %} -{% endtabs %} - -By following these steps, you can successfully integrate and use the get page info API in the EJ2 PDF Viewer. - -[View Sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/get-base64.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/get-base64.md deleted file mode 100644 index de5605b55d..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/get-base64.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -layout: post -title: Retrieving Base64 Value in EJ2 ASP.NET MVC PdfViewer | Syncfusion -description: Learn how to retrieve the Base64 value in the Syncfusion ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: How to retrieve Base64 -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Retrieving Base64 Value from a PDF in PDF Viewer -### Overview - -This guide demonstrates how to fetch the base64-encoded value of a PDF document loaded in the Syncfusion PDF Viewer using ASP.NET MVC. This feature is beneficial for transferring the PDF data as a Base64 string or performing client-side processing. - -### How to Retrieve Base64 Value - -**Step 1:** Set Up the PdfViewer in Your ASP.NET MVC Project - - Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Add Button and Function for Fetching Base64 Value - -Incorporate a button in your view to enable users to start the process of converting the loaded PDF document into a Base64 string. - -```html -
-
- - - @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
-
- - - - - - -``` -### Conclusion - -By following these steps, you can easily convert and retrieve a PDF document's Base64 string. This conversion is particularly useful for transmitting PDF data or integrating with systems that require Base64 encoding. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/identify-the-loaded-document-is-edited.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/identify-the-loaded-document-is-edited.md deleted file mode 100644 index f833bcc292..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/identify-the-loaded-document-is-edited.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -layout: post -title: Identify The Loaded Document Is Edited in ##Platform_Name## Pdfviewer Component -description: Learn here all about Identify The Loaded Document Is Edited in Syncfusion ##Platform_Name## Pdfviewer component of syncfusion and more. -platform: ej2-asp-core-mvc -control: Identify The Loaded Document Is Edited -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Identify the loaded document is edited - -The PDF Viewer server library allows you to identify whether loaded PDF document is edited or not. Use the **isDocumentEdited** property to identify whether the changes made in PDF document. - -The following steps are used to identify loaded document is edited in PDF viewer control, - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample. - -**Step 2:** Add the following code snippet with button click event to identity loaded document edited. - -```html - - - - - - -``` - -Download the sample [how to identify the loaded document is edited](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVC_SAMPLE-609765609) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/import-export-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/import-export-annotation.md deleted file mode 100644 index 5a9891a56e..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/import-export-annotation.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -layout: post -title: Import Export Annotation in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn how to Import Export Annotation in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Import Export Annotation Object -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Import and Export annotation - -The PDF Viewer library allows you to import annotations from objects or streams instead of loading it as a file. To import such annotation objects, the PDF Viewer control must export the PDF annotations as objects using the [**ExportAnnotationsAsObject()**](https://ej2.syncfusion.com/documentation/api/pdfviewer/#exportannotationsasobject) method. Only the annotations objects that are exported from the PDF Viewer can be imported. - -The following steps are used to import and export annotations in various formats such as objects, JSON, and XFDF. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to perform import and export annotation. - -```html - - - - - - -``` - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/include-the-authorization-token.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/include-the-authorization-token.md deleted file mode 100644 index d35cdb9a01..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/include-the-authorization-token.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: post -title: Include The Authorization Token in ##Platform_Name## Pdfviewer Component -description: Learn here all about Include The Authorization Token in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Include The Authorization Token -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Include Authorization token - -The PDF Viewer server library allows you to include the Authorization token in the PDF Viewer AJAX request using the ajaxRequest headers properties available in AjaxRequestSettings and it will be included in every AJAX request send from PDF Viewer. - -The following steps are used to include the Authorization token for PDF viewer control, - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample. - -**Step 2:** Add the following code snippet to include the authorization token, - -```html - -@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("PDF_Succinctly.pdf").AjaxRequestSettings(new PdfViewerAjaxRequestSettings { WithCredentials = true, AjaxHeaders = new object[] { new { headerName = "Testingabc", headerValue = "Testing123" } } }).Render() - -``` - -Download the sample [how to include authorization token](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVCSAM~21380738543) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-balancing-environment.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-balancing-environment.md deleted file mode 100644 index c1dc55fee3..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-balancing-environment.md +++ /dev/null @@ -1,150 +0,0 @@ ---- -layout: post -title: Load balancing environment in ##Platform_Name## PDF Viewer | Syncfusion -description: Learn how to load balancing environment in ##Platform_Name## PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Load balancing environment -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Achieve Load balancing environment in MVC framework - -The PDF Viewer server library allows you to achieve a Load balancing environment in the MVC framework using the .NET 4.6.2 framework with the help of **StackExchange Redis package V1.2.6**. - -## Steps to achieve load balancing environment in the MVC framework - -**Step 1**: Install the [StackExchange.Redis.StrongName](https://www.nuget.org/packages/StackExchange.Redis.StrongName) NuGet in the web-service sample. - -**Step 2:** Create a new class in the web-service project (Example: CacheManager.cs) and implement the **Syncfusion.EJ2.PdfViewer.ICacheManager** interface in the class. - -```cs - -public class CacheManager:{{'**ICacheManager**'| markdownify }}{} - -``` - -**Step 3:** Connect the Redis database in the constructor by using the **redisconnectionstring** as provided in the below code. - -```cs - -private IDatabase m_redisDatabase = null; -private int m_slidingExpiration = 0; -public CacheManager(string redisConnectionstring = null, int slidingExpiration = 0) -{ - if (!string.IsNullOrEmpty(redisConnectionstring)) - { - ConnectionMultiplexer connection = new Lazy<ConnectionMultiplexer>(() => - { - return ConnectionMultiplexer.Connect(redisConnectionstring); - }).Value; - if (connection != null) - { - m_redisDatabase = connection.GetDatabase(); - m_slidingExpiration = slidingExpiration; - } - } -} - -``` - -**Step 4:** Override the **ICacheManager** interface methods into the newly created class for adding, retrieving, and deleting the data from the Redis cache. - -```cs - -//Adding the data in the redis database. -public void AddCache(string key, byte[] data) -{ - if (m_redisDatabase != null) - { - TimeSpan time = m_slidingExpiration > 0 ? new TimeSpan(0, m_slidingExpiration, 0) : new TimeSpan(24, 0, 0); // Provided the sliding expiration time - m_redisDatabase.StringSet(key, data, time); - } -} -//Retrieve the data in the redis database. -public byte[] GetCache(string key) -{ - byte[] documentContent = null; - if (m_redisDatabase != null) - { - documentContent = m_redisDatabase.StringGet(key); - } - return documentContent; -} -//Delete the data in the redis database. -public void DeleteCache(string key) -{ - if (m_redisDatabase != null) - { - m_redisDatabase.KeyDelete("PDF_CONTENT" + key); - m_redisDatabase.KeyDelete("PDF_INFO" + key); - } -} - -``` - -**Step 5:** In the controller, create a new object by passing the **redisconnectionstring** and the sliding expiration time. - -```cs - -pdfviewer.CacheManager = new CacheManager(redisconnectonstring, slidingexpiration); - -{{'**Note: The sliding expiration is the time in which the data has to be stored in the cache for a specific minutes. If 0 then it will store for 24 hours.**'| markdownify }} - -``` - -**Step 6:** Set the newly created object to **CacheManager** property by using the below code-snippet. - -```cs - -PdfRenderer pdfviewer = new PdfRenderer(); -pdfviewer.CacheManager = new CacheManager(redisconnectonstring, 0); - -``` - -**Step 7:** Use this code in all our controller methods (Load, RenderPdfPage). - -```cs - -public string {{'**redisconnectonstring**' | markdownify }} = "xxxx, {{'**ssl=True,abortConnect=False,syncTimeout=100000**'| markdownify }}"; - -[System.Web.Mvc.HttpPost] -public object Load(Dictionary<string, string> jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - string documentPath = GetDocumentPath(jsonObject["document"]); - if (!string.IsNullOrEmpty(documentPath)) - { - byte[] bytes = System.IO.File.ReadAllBytes(documentPath); - stream = new MemoryStream(bytes); - } - else - { - return (jsonObject["document"] + " is not found"); - } - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - {{'**pdfviewer.CacheManager = new CacheManager(redisconnectonstring, 0);**'| markdownify }} - jsonResult = pdfviewer.Load(stream, jsonObject); - return (JsonConvert.SerializeObject(jsonResult)); -} - -{{'**Note: Add the bold lines in all the controller methods.**'| markdownify }} - -``` - -Find the Web-service sample and Nuget package below: -* [Web service](https://www.syncfusion.com/downloads/support/directtrac/general/ze/PdfViewer_WebAPI_Service_(3)1568224382.zip) -* [Nuget](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion.EJ2.PdfViewer.AspNet.Mvc5.19.1.0.59-1399631455.zip) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-documents.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-documents.md deleted file mode 100644 index 83eb2aa27a..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-documents.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -layout: post -title: Load Documents in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Load Documents in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Load Documents -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Load PDF documents dynamically - -The PDF Viewer server library allows to switch or load the PDF documents dynamically after the initial load operation. To achieve this, load the PDF document as a base64 string or file name in PDF Viewer control using the **Load()** method dynamically. - -The following steps are used to load the PDF document dynamically. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to load PDF document using base64 string. - -```html - - -``` - -**Step 3:** Add the following code snippet in `PdfViewerController.cs` file to get the base64 string of the given document. - -```cs -public ActionResult GetDocument() -{ - var docBytes = System.IO.File.ReadAllBytes(GetDocumentPath("PDF_Succinctly.pdf")); - string docBase64 = "data:application/pdf;base64," + Convert.ToBase64String(docBytes); - return Content(docBase64); -} -``` - -**Step 4:** Use the following code snippet to load PDF document using document name. - -```html - - -``` - -T> Also can add the base64 string directly in the `DocumentPath()` method. - -Download the sample, [how to load PDF documents dynamically](https://www.syncfusion.com/downloads/support/directtrac/general/ze/EJ2MvcSample-1778613339.zip) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-n-number-page.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-n-number-page.md deleted file mode 100644 index be622ad839..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-n-number-page.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -layout: post -title: Load N number of pages on initial loading in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Load N number of pages on initial loading in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Load N number of pages on initial loading -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - -# Load N number of pages on initial loading - -The initial rendering in a PDF viewer allows users to control the number of pages displayed when opening a PDF document. This improves the user experience by providing flexibility in loading a specific number of pages initially, while additional pages are dynamically rendered as the user scrolls through the document. This approach enhances the responsiveness of the PDF viewer and minimizes delays as users can access specific pages without waiting for the entire document to load. - -To utilize this capability in Syncfusion® PDF Viewer, use the [initialRenderPages](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_InitialRenderPages) property. You can achieve the desired outcome by setting this property to the desired number of pages you want to load initially. However, it's important to exercise caution when setting a high value for the initialRenderPages in large documents with numerous pages. Rendering a large number of pages simultaneously can increase memory usage and slow down loading times, impacting the performance of the PDF viewer. - -Using the `initialRenderPages` property judiciously is advisable, especially when dealing with larger documents. It is more suitable for scenarios where a smaller range of pages, such as 10-20, can be loaded to provide a quick initial view of the document. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -```cs -@{ - ViewBag.Title = "Home Page"; - double InitialRenderPages = 10; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").InitialRenderPages(InitialRenderPages).Render() -
-
-``` - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -```cs -@{ - ViewBag.Title = "Home Page"; - double InitialRenderPages = 10; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").InitialRenderPages(InitialRenderPages).Render() -
-
- -``` -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to/Load%20N%20no%20of%20pages) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-the-document.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-the-document.md deleted file mode 100644 index ad4a411f25..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/load-the-document.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -layout: post -title: Load the document in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn how to doad the document in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Load The Document -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Load the PDF document - -The PDF Viewer server library allows you to load the PDF document in the PDF Viewer Control. PDF Document can be loaded by adding the necessary JSON object Properties in the **PdfViewerController.cs** file. - -The following steps are used to load a PDF document. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Add the following code snippet in PDFViewerController.cs file to load a PDF document. - -```cs - -public class jsonObjects -{ - public string document { get; set; } - public string password { get; set; } - public string zoomFactor { get; set; } - public string isFileName { get; set; } - public string xCoordinate { get; set; } - public string yCoordinate { get; set; } - public string pageNumber { get; set; } - public string documentId { get; set; } - public string hashId { get; set; } - public string sizeX { get; set; } - public string sizeY { get; set; } - public string startPage { get; set; } - public string endPage { get; set; } - public string stampAnnotations { get; set; } - public string textMarkupAnnotations { get; set; } - public string stickyNotesAnnotation { get; set; } - public string shapeAnnotations { get; set; } - public string measureShapeAnnotations { get; set; } - public string action { get; set; } - public string pageStartIndex { get; set; } - public string pageEndIndex { get; set; } - public string fileName { get; set; } - public string elementId { get; set; } - public string pdfAnnotation { get; set; } - public string importPageList { get; set; } - public string uniqueId { get; set; } - public string data { get; set; } - public string viewPortWidth { get; set; } - public string viewportHeight { get; set; } - public string tilecount { get; set; } - public string isCompletePageSizeNotReceived { get; set; } - public string freeTextAnnotation { get; set; } - public string signatureData { get; set; } - public string fieldsData { get; set; } -} - -``` - -Find the sample [how to load the PDF Document in MVC PDF Viewer](https://www.syncfusion.com/downloads/support/directtrac/general/ze/PDFViewTest-1000651816) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/min-max-zoom.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/min-max-zoom.md deleted file mode 100644 index d536c53184..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/min-max-zoom.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -layout: post -title: Minimum and Maximum Zoom in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Minimum and Maximum Zoom in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Minimum and Maximum Zoom Properties - -The Syncfusion® PDF Viewer provides the ability to control zoom levels for viewing PDF documents. The `minZoom` and `maxZoom` properties enable developers to set the minimum and maximum zoom levels, ensuring a consistent and controlled viewing experience. - -### minZoom - -The `minZoom` property specifies the minimum zoom percentage allowed in the PDF Viewer. This ensures that users cannot zoom out beyond a certain limit, which helps maintain readability and performance. Developers can set the `minZoom` property programmatically, defining the minimum zoom level based on the application's requirements. This is particularly useful for preventing users from zooming out too much, which could make the content difficult to read. - -### maxZoom - -The `maxZoom` property defines the maximum zoom percentage allowed in the PDF Viewer. By setting this property, developers can prevent users from zooming in too much, helping to avoid performance issues and maintain a smooth viewing experience. The `maxZoom` property can be set programmatically to control the upper limit of the zoom level. This is useful for applications where extremely high zoom levels might degrade performance or user experience. - -```cs - -@{ - ViewBag.Title = "Home Page"; - double maxZoom = 200; - double minZoom = 20; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").MaxZoom(maxZoom).MinZoom(minZoom).Render() -
-
-``` - -#### Restrict Zoom Percentage on Mobile Devices - -You can easily restrict the zoom percentage on mobile devices using the `minZoom` and `maxZoom` properties. This feature allows you to set specific limits for zooming, ensuring smoother scrolling performance and efficient document loading on mobile devices. By controlling the zoom levels, you can provide a better user experience across different devices. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentLoad("documentLoad").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentLoad("documentLoad").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -By implementing this, you ensure that the maximum zoom percentage on mobile devices is limited to 200% and the minimum zoom percentage is set to 10%. This prevents performance issues that may arise from excessive zooming on mobile platforms. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/open-bookmark.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/open-bookmark.md deleted file mode 100644 index 66076524b8..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/open-bookmark.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -layout: post -title: Open and Close Bookmark in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Open and Close Bookmark in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open and Close Bookmark pane programmatically - -The PDF Viewer library allows you to open the Bookmark pane programmatically using the **openBookmarkPane()** method. - -The following steps are used to open the Bookmark. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Insert the following code snippet to implement the functionality for opening the Bookmark pane: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -Similarly, to close the Bookmark pane programmatically, employ the following code snippet: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to/Open%20and%20Close%20bookmark%20pane/PDFViewerSample/PDFViewerSample) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/open-thumbnail.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/open-thumbnail.md deleted file mode 100644 index 44df671a21..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/open-thumbnail.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -layout: post -title: Open Thumbnail in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Open Thumbnail in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Open Thumbnail -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Open Thumbnail pane programmatically - -The PDF Viewer library allows you to open the thumbnail pane programmatically using the [**openThumbnailPane()**](https://ej2.syncfusion.com/documentation/api/pdfviewer/thumbnailView/#openthumbnailpane) method. - -The following steps are used to open the thumbnail. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to open thumbnail. - -```html - - - -``` - -Find the sample, [how to open the thumbnail pane programmatically](https://www.syncfusion.com/downloads/support/directtrac/general/ze/EJ2MvcSample1928984973.zip) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/pagerenderstarted-pagerendercompleted.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/pagerenderstarted-pagerendercompleted.md deleted file mode 100644 index 1b60c63cea..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/pagerenderstarted-pagerendercompleted.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -layout: post -title: Rendering event in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Rendering event in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# PageRenderInitiate and PageRenderComplete event - -In Syncfusion® PDF Viewer, `pageRenderInitiate` and `pageRenderComplete` actions are events that occur during the rendering process of PDF documents. - -**pageRenderInitiate** - -The `pageRenderInitiate` event is triggered when the rendering of a page in the PDF document begins. This event provides developers with an opportunity to perform any necessary initialization or setup before the rendering of the page content commences. It can be utilized to prepare resources, set up rendering parameters, or execute any other actions required before the page rendering process starts. - -**pageRenderComplete** - -The `pageRenderComplete` event is triggered when the rendering of a page in the PDF document is completed. This event allows developers to perform cleanup tasks or finalize rendering-related processes after the rendering of the page content finishes. It can be used to release resources, finalize rendering settings, or handle any post-rendering tasks necessary for the application. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@{ - ViewBag.Title = "Home Page"; -} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").PageRenderInitiate("pageRenderInitiate").PageRenderComplete("pageRenderComplete").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -@{ - ViewBag.Title = "Home Page"; -} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").PageRenderInitiate("pageRenderInitiate").PageRenderComplete("pageRenderComplete").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -The provided code demonstrates how to subscribe to the `pageRenderInitiate` and `pageRenderComplete` events in the Syncfusion® PDF Viewer component. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to/PageRenderStarted%20and%20PageRenderCompleted%20event/PDFViewerSample) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/redirect-to-home-page.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/redirect-to-home-page.md deleted file mode 100644 index 14273760b5..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/redirect-to-home-page.md +++ /dev/null @@ -1,422 +0,0 @@ ---- -layout: post -title: Redirect To Home Page in Syncfusion ##Platform_Name## Pdfviewer Component -description: Learn here all about Redirect To Home Page in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Redirect To Home Page -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Redirect to a home page after submitting PDF forms - -The PDF Viewer library allows you to redirect to a home page after submitting PDF forms in the PDF Viewer control programmatically using the [**ExportSuccess**](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_ExportSuccess) event. This event triggers once the form fields exporting is succeeded in the PDF Viewer. - -The following example steps are used to redirect to a home page programmatically after submitting PDF forms. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Add the following codes in new View pages HomePage.cshtml and FormFillingData.cshtml inside a folder(say FormFilling). - -FormFillingData.cshtml: - -```html -@{ - ViewBag.Title = "FormFillingData"; -} - -@using Syncfusion.EJ2 -@using Syncfusion.EJ2.PdfViewer - -@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/FormFilling/")).DocumentPath("FormFillingDocument.pdf").ToolbarSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings { ShowTooltip = true, ToolbarItems = "SubmitForm, DownloadOption, PrintOption" }).EnableFormFields(true).ValidateFormFields("validateFormFields").EnableFormFieldsValidation(true).ShowNotificationDialog(false).ExportSuccess("exportSuccess").Render() - - - - -``` - -HomePage.cshtml: - -```html -@{ - ViewBag.Title = "HomePage"; -} -

HomePage

-``` - -**Step 3:** Create a new Controller file called FormFillingController.cs inside the Controllers and add the below code to it. - -FormFillingController.cs: - -```cs -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using Syncfusion.EJ2.PdfViewer; -using Newtonsoft.Json; -using System.IO; -using System.Reflection; -using Syncfusion.Pdf.Parsing; -using System.Net.Http; -using System.Net; -using System.Text.RegularExpressions; -using Syncfusion.Pdf; -using Syncfusion.Pdf.Graphics; -using System.Drawing; -using Syncfusion.Pdf.Interactive; -using System.Web.Http; -using System.Threading.Tasks; - -namespace EJ2PdfViewer.Controllers -{ - public class FormFillingController : Controller - { - // GET: FormFilling - public ActionResult FormFillingData() - { - return View(); - } - - public ActionResult HomePage() - { - return View("HomePage"); - } - - [System.Web.Mvc.HttpPost] - public ActionResult Load(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - PdfRenderer.ReferencePath = "C:/";//_hostingEnvironment.WebRootPath + "/"; - MemoryStream stream = new MemoryStream(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = new object(); - if (jsonObject != null && jsonData.ContainsKey("document")) - { - if (bool.Parse(jsonData["isFileName"])) - { - string documentPath = GetDocumentPath(jsonData["document"]); - - if (!string.IsNullOrEmpty(documentPath)) - { - byte[] bytes = System.IO.File.ReadAllBytes(documentPath); - stream = new MemoryStream(bytes); - } - else - { - string fileName = jsonData["document"].Split(new string[] { "://" }, StringSplitOptions.None)[0]; - if (fileName == "http" || fileName == "https") - { - var WebClient = new WebClient(); - byte[] pdfDoc = WebClient.DownloadData(jsonData["document"]); - stream = new MemoryStream(pdfDoc); - } - else - { - return this.Content(jsonData["document"] + " is not found"); - } - - } - } - else - { - byte[] bytes = Convert.FromBase64String(jsonData["document"]); - stream = new MemoryStream(bytes); - - } - } - PdfLoadedDocument document = new PdfLoadedDocument(stream); - PdfBookmark bookmark = document.Bookmarks.Add("Page 1"); - bookmark.Destination = new PdfDestination(document.Pages[0]); - bookmark.Color = Color.Red; - bookmark.TextStyle = PdfTextStyle.Bold; - bookmark.Destination.Location = new PointF(20, 20); - MemoryStream docStream = new MemoryStream(); - document.Save(docStream); - docStream.Position = 0; - document.Close(true); - jsonResult = pdfviewer.Load(docStream, jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - public ActionResult GetDocument() - { - var docBytes = System.IO.File.ReadAllBytes(GetDocumentPath("PDF_Succinctly.pdf")); - string docBase64 = "data:application/pdf;base64," + Convert.ToBase64String(docBytes); - return Content(docBase64); - } - - public ActionResult SaveDocument(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonData); - string base64String = documentBase.Split(new string[] { "data:application/pdf;base64," }, StringSplitOptions.None)[1]; - if (base64String != null || base64String != string.Empty) - { - byte[] byteArray = Convert.FromBase64String(base64String); - var path = GetDocumentPath(jsonData["documentId"]); - // Document is saved in the project location - System.IO.File.WriteAllBytes(path, byteArray); - } - return Content(string.Empty); - } - - public Dictionary JsonConverter(jsonObjects results) - { - Dictionary resultObjects = new Dictionary(); - resultObjects = results.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public) - .ToDictionary(prop => prop.Name, prop => prop.GetValue(results, null)); - var emptyObjects = (from kv in resultObjects - where kv.Value != null - select kv).ToDictionary(kv => kv.Key, kv => kv.Value); - Dictionary jsonResult = emptyObjects.ToDictionary(k => k.Key, k => k.Value.ToString()); - return jsonResult; - } - - [System.Web.Mvc.HttpPost] - public ActionResult ExportAnnotations(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string jsonResult = pdfviewer.ExportAnnotation(jsonData); - return Content((jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult ImportAnnotations(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - string jsonResult = string.Empty; - var jsonData = JsonConverter(jsonObject); - if (jsonObject != null && jsonData.ContainsKey("fileName")) - { - string documentPath = GetDocumentPath(jsonData["fileName"]); - if (!string.IsNullOrEmpty(documentPath)) - { - jsonResult = System.IO.File.ReadAllText(documentPath); - } - else - { - return this.Content(jsonData["document"] + " is not found"); - } - } - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult ImportFormFields(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.ImportFormFields(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult ExportFormFields(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string jsonResult = pdfviewer.ExportFormFields(jsonData); - return Content(jsonResult); - } - - [System.Web.Mvc.HttpPost] - public ActionResult RenderPdfPages(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.GetPage(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult Unload(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - pdfviewer.ClearCache(jsonData); - return this.Content("Document cache is cleared"); - } - - [System.Web.Mvc.HttpPost] - public ActionResult RenderThumbnailImages(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object result = pdfviewer.GetThumbnailImages(jsonData); - return Content(JsonConvert.SerializeObject(result)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult Bookmarks(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.GetBookmarks(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult RenderAnnotationComments(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.GetAnnotationComments(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - [System.Web.Mvc.HttpPost] - public ActionResult Download(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonData); - return Content(documentBase); - } - - [System.Web.Mvc.HttpPost] - public ActionResult PrintImages(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object pageImage = pdfviewer.GetPrintImage(jsonData); - return Content(JsonConvert.SerializeObject(pageImage)); - } - - private HttpResponseMessage GetPlainText(string pageImage) - { - var responseText = new HttpResponseMessage(HttpStatusCode.OK); - responseText.Content = new StringContent(pageImage, System.Text.Encoding.UTF8, "text/plain"); - return responseText; - } - - private string GetDocumentPath(string document) - { - string documentPath = string.Empty; - if (!System.IO.File.Exists(document)) - { - var path = HttpContext.Request.PhysicalApplicationPath; - if (System.IO.File.Exists(path + "/App_Data/" + document)) - documentPath = path + "/App_Data/" + document; - } - else - { - documentPath = document; - } - return documentPath; - } - } - - public class jsonObjects - { - public string document { get; set; } - public string password { get; set; } - public string zoomFactor { get; set; } - public string isFileName { get; set; } - public string xCoordinate { get; set; } - public string yCoordinate { get; set; } - public string pageNumber { get; set; } - public string documentId { get; set; } - public string hashId { get; set; } - public string sizeX { get; set; } - public string sizeY { get; set; } - public string startPage { get; set; } - public string endPage { get; set; } - public string stampAnnotations { get; set; } - public string textMarkupAnnotations { get; set; } - public string stickyNotesAnnotation { get; set; } - public string shapeAnnotations { get; set; } - public string measureShapeAnnotations { get; set; } - public string action { get; set; } - public string pageStartIndex { get; set; } - public string pageEndIndex { get; set; } - public string fileName { get; set; } - public string elementId { get; set; } - public string pdfAnnotation { get; set; } - public string importPageList { get; set; } - public string uniqueId { get; set; } - public string data { get; set; } - public string viewPortWidth { get; set; } - public string viewportHeight { get; set; } - public string tilecount { get; set; } - public string isCompletePageSizeNotReceived { get; set; } - public string freeTextAnnotation { get; set; } - public string signatureData { get; set; } - public string fieldsData { get; set; } - public string formDesigner { get; set; } - public string inkSignatureData { get; set; } - } -} -``` - -**Step 4:** Modify the RegisterRoutes method in the RouteConfig.cs file inside the App_Start folder to map the default path. - -```cs -public static void RegisterRoutes(RouteCollection routes) -{ - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapRoute( - name: "Default", - url: "{controller}/{action}/{id}", - defaults: new { controller = "FormFilling", action = "FormFillingData", id = UrlParameter.Optional } - ); -} -``` - -Now, run the sample, fill in the form fields, and click the Submit Form option. You will be redirected to the home page. - -Download the sample, [how to redirect to a home page programmatically after submitting PDF forms](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVC_SAMPLE-1729180476.zip). diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/resolve-Unable-to-find-an-entry-point-error.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/resolve-Unable-to-find-an-entry-point-error.md deleted file mode 100644 index 09b34a5de7..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/resolve-Unable-to-find-an-entry-point-error.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -layout: post -title: Resolve unable to find an entry point error in ASP.NET MVC PDF Viewer component | Syncfusion -description: Learn here how to resolve unable to find an entry point named error in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Resolve unable to find an entry point error -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - -# Resolve "Unable to find an entry point named FPDFText_GetCharAngle" error - -From the release of version **21.1.0.35 (2023 Volume 1)** of Essential Studio®, the Pdfium package has been upgraded to improve various functionalities like text search, text selection, rendering, and even performance. If you are updating your project to this version of the Syncfusion® PDF Viewer, you may encounter the **"Web-Service is not listening"** error. The Network tab can help you identify the root cause of the issue, which is typically caused by an old version of pdfium assembly being referenced in the local web service project. Below are the assemblies to be referred to in the respective operating systems. - -* Windows – pdfium.dll -* Linux – libpdfium.so -* OSX – libpdfium.dylib - -![Error information in the Network tab](../../pdfviewer/images/ErrorinformationuintheNetworkTab.png) - -## To solve this issue, you should follow the below steps: - -1. Clear the bin and object files of the web-service project. -2. Re-publish the web-service project. - -N> **Note:** If you are hosting your application in Azure, AWS, or in Linux environments, delete the older published files and republish the application. diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/resolve-pdfium-issue.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/resolve-pdfium-issue.md deleted file mode 100644 index 0adbb33351..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/resolve-pdfium-issue.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: post -title: Resolve Pdfium Issue in Syncfusion ##Platform_Name## Pdfviewer Component -description: Learn here all about Resolve Pdfium Issue in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Resolve Pdfium Issue -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Resolve the Pdfium issue - -The issue, “The type initializer for 'Syncfusion.EJ2.PdfViewer.PdfiumNative' threw an exception” is due to the write access permission denied in the environment. The pdfium.dll will be created based on the operating system at the runtime. Due to the denial of permission, the pdfium.dll file couldn't have been created. So, copy the below x64 and x86 folders and paste them inside the folder into your project to resolve the issue or enable the write permission for that folder. - -Pdfium dll: [pdfium.dll](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Pdfium1515619754.zip) - -N> Use both the client and server-side of the same version in your project. -
Ensure whether the pdfium.dll file is created in your project during runtime. Else, place the pdfium assemblies in any of the production environment locations and refer to the path by using the ReferencePath API. - -For example, if the Pdfium assembly is available in this path C:\Pdfium\x64 or D:\Pdfium\x86, the reference path should be PdfRenderer.ReferencePath = "C:/"; - -The parent folder has to be provided as the path in the ReferencePath API. - -N> Provide this path in the Load method of the PDFViewerController.cs - -N> PdfRenderer PdfRenderer = new PdfRenderer(); -
PdfRenderer.ReferencePath = @"C:/"; - -## Steps to refer the Pdfium.dll - -1. Extract the given file (Pdfium folder) and copy it in the sample’s root directory (parallel to Controllers folder) - -2. Right-click on the pdfium.dll (both the X64 and X86 folder) and then choose the “Copy to Output Directory” property from the property window and set its value to “copy always”. This setting will ship the pdfium.dll assembly to the published location. -![Pdfium.dll settings](../../pdfviewer/images/pdfium_dll_settings.png) - -3. Provide this path in the Load method of the PDFViewerController.cs -N> You need to refer the ParentFolder up to the x64/x86 folder. -*PdfRenderer.ReferencePath = _hostingEnvironment.ContentRootPath + /Pdfium/;* - -4. Build and publish the application. - -Also, install the package, then build and run the project. Use the following library: - -• Syncfusion.EJ2.PdfViewer.AspNet.Core - -Following these steps should resolve the issue. diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/restricting-zoom-in-mobile-mode.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/restricting-zoom-in-mobile-mode.md deleted file mode 100644 index b07cf71d75..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/restricting-zoom-in-mobile-mode.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -layout: post -title: Restrict Zoom Percentage in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all how to restrict zoom percentage in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# How to Restrict Zoom Percentage on Mobile Devices - -In Syncfusion® PDF Viewer, you can easily restrict the zoom percentage on mobile devices using the **maxZoom** and **minZoom** property. This feature allows you to set specific limits for zooming, ensuring smoother scrolling performance and efficient document loading, on mobile devices. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentLoad("documentLoad").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentLoad("documentLoad").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% endtabs %} - -By implementing this, you ensure that the maximum zoom percentage on mobile devices is limited to 200% and the minimum zoom percentage is set to 10%. This prevents performance issues that may arise from excessive zooming on mobile platforms. - -[View Sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to/Restrict%20Zoom%20Percentage%20on%20Mobile%20Devices/PDFViewerSample) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/retry-timeout.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/retry-timeout.md deleted file mode 100644 index 566d2d0d19..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/retry-timeout.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -layout: post -title: Retry Timeout in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Retry Timeout in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Retry Timeout -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - -# Retry Timeout - -The **[Retry Timeout](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryTimeout)** feature allows you to specify a duration for the PDF Viewer to retry failed AJAX requests before considering them permanent failures. It helps in handling temporary failures due to network issues or server unavailability. - -The retryTimeout allows developers to specify a duration after which the AJAX request should retry failed requests automatically. Developers can ensure a more resilient and fault-tolerant PDF viewing experience by configuring an appropriate retry timeout value. - -By default, when an AJAX request fails, the Retry Timeout property is set to `0`, indicating that no timeout is set. In this case, the PDF Viewer will wait indefinitely for a response, potentially leading to a hanging request. However, you can set the Retry Timeout property to a positive number, specifying the maximum number of seconds the PDF Viewer should wait for a response. If the response is not received within the specified time, the request will be aborted, triggering an appropriate error or timeout property. - -To set the retry timeout, use the [retryTimeout](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryTimeout) property in the PDF Viewer configuration. This property takes a value in seconds. - -```cs - -@{ - ViewBag.Title = "Home Page"; - double RetryTimeout = 10; - double RetryCount = 5; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").RetryCount(RetryCount).RetryTimeout(RetryTimeout).Render() -
-
- -``` - -In the given example, the [retryTimeout](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryTimeout) is set to 10 seconds, and the `retryCount` is set to 5. This means that if a request made by the PDF Viewer takes longer than 10 seconds to receive a response, it will be considered a timeout. In such cases, The PDF Viewer will resend the same request based on the retryCount. Here, this process will repeat up to maximum of 5 retries. - -When an exception occurs during the AJAX request in the context of the PDF Viewer, the request will wait for the specified [retryTimeout](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryTimeout) duration. If the timeout duration is exceeded, the PDF Viewer will decrement the [retryCount](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryCount) and attempt to load the document again. This retry process continues until the document is successfully loaded or the retryCount limit is reached. - -The [retryCount](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryCount) property of the PDF Viewer allows you to set the number of retries for a specific request. This feature is particularly useful for handling temporary errors such as network timeouts or server issues. By initiating new requests according to the retry count, ensure a smoother user experience and efficiently handle network or server problems. - -If the timeout duration specified by [retryTimeout](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryTimeout) is exceeded during the AJAX request, the PDF Viewer will decrement the `retryCount` and initiate a new request. This process will continue until the document is successfully loaded or the retry count limit is reached. This functionality helps improve the handling of temporary errors and ensures a more efficient and user-friendly experience. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to/Retry%20Timeout) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/set-author-name-to-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/set-author-name-to-annotation.md deleted file mode 100644 index 0c80390be5..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/set-author-name-to-annotation.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -layout: post -title: Set Author Name To Annotation in ##Platform_Name## Pdfviewer Component -description: Learn here all about Set Author Name To Annotation in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Set Author Name To Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Set author name to annotation - -The PDF Viewer server library allows you to set author name to all annotations in the PDF document. Use the **author** property to set author name to all annotations. - -The following steps are used to set author name to all annotation for PDF Viewer, - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample. - -**Step 2:** Set author name to annotations using below code snippet. - -```html - - - -``` - -Download the sample [how to set author name to annotation](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVC_SAMPLE_(2)_(1)1717421659) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/show-custom-stamp-item.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/show-custom-stamp-item.md deleted file mode 100644 index 34c1a733c5..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/show-custom-stamp-item.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -layout: post -title: Displaying Custom stamp Item in EJ2 ASP.NET MVC PdfViewer | Syncfusion -description: Learn how to display custom stamp items in the custom stamp in the Syncfusion ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Displaying Custom Items in Custom Stamp Dropdown - -### Overview - -This guide explains how to add and display custom items in the custom stamp dropdown menu of Syncfusion's PDF Viewer using ASP.NET MVC. This feature allows users to easily access and apply custom stamps to their PDF documents. - -### Steps to Show Custom Items in Custom Stamp Dropdown - -**Step 1:** Set Up the PdfViewer in Your ASP.NET MVC Project - - Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Configure Custom Stamp Settings - -Within the PDF Viewer setup, utilize `PdfViewerCustomStampSettings` to specify the custom stamps that should appear in the dropdown menu. - -```cs -@using Syncfusion.EJ2.PdfViewer -@{ - ViewBag.Title = "Home Page"; -} -@{ - ViewData["Title"] = "Home page"; - - List customStamp = new List(); - - customStamp.Add(new - { - customStampName = "Image1", - customStampImageSource="data:image/png;base64,...' // Provide a valid base64 or URL for the image" - }); - customStamp.Add(new - { - customStampName = "Image2", - customStampImageSource ="data:image/png;base64,...' // Provide a valid base64 or URL for the image" - }); - PdfViewerCustomStampSettings CustomStampsSettings = new PdfViewerCustomStampSettings() - { - IsAddToMenu = true, - CustomStamps = customStamp, - EnableCustomStamp = true, - Opacity = 1, - }; - -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").CustomStampSettings(CustomStampsSettings).Render() -
-
- -``` - -By following these instructions, you can successfully configure to display custom items in the custom stamp dropdown, allowing users to easily apply personalized stamps to their documents. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/show-hide-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/show-hide-annotation.md deleted file mode 100644 index f75002b5f6..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/show-hide-annotation.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -layout: post -title: Show and Hide Annotations in EJ2 ASP.NET MVC PdfViewer | Syncfusion -description: Learn how to dynamically show and hide annotations in the Syncfusion ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Show and Hide Annotations -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Show and Hide Annotations in PDF Viewer - -### Overview - -This guide demonstrates how to implement functionality to dynamically show and hide annotations in a PDF document loaded in the Syncfusion PDF Viewer using ASP.NET MVC. This feature is particularly useful in scenarios where you need to present a clean view of the document or toggle between annotated and non-annotated views. - -### How to Show and Hide Annotations - -**Step 1:** Set Up the PdfViewer in Your ASP.NET MVC Project - -First, follow the steps provided in the [getting started guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Add Toggle Button and Implementation - -Add a button to toggle annotation visibility and implement the necessary JavaScript functions to handle the show/hide functionality: - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} -
-
- - -
-
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").ResourceUrl("https://cdn.syncfusion.com/ej2/30.1.37/dist/ej2-pdfviewer-lib").Render() -
-
- - - -{% endhighlight %} -{% endtabs %} - -This implementation provides a clean, efficient way to toggle the visibility of annotations in your PDF documents. It's particularly useful for presentation scenarios or when you need to focus on the document content without the distraction of annotations. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/show-notification-dialog.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/show-notification-dialog.md deleted file mode 100644 index 7f71fc2c3e..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/show-notification-dialog.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -layout: post -title: Show Notification Dialog in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Show Notification Dialog in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Show Notification Dialog -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Show the notification dialog in UI When form fields are empty - -The PDF Viewer server library allows you to show the notification dialog in UI when fields in the form are not filled or empty using the following properties and events below, - -* **EnableFormFieldsValidation** -* **ShowNotificationDialog** -* **validateFormFields** - -The following steps are used to show the notification dialog in UI. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to show the notification dialog when form fields are empty. - -```cs - -@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf").ValidateFormFields("validateFormFields").EnableFormFieldsValidation(true).ShowNotificationDialog(false).Render() - - - -``` - -Find the sample of [how to show the notification dialog in UI When form fields are empty](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVC_SAMPLE_d50d2de6-1937239856.zip) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/signature-date.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/signature-date.md deleted file mode 100644 index 67b2cc9b8a..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/signature-date.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -layout: post -title: Add date to signature field in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about how to add the date to the signature text in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: How to add the date to the signature text -publishingplatform: ej2-asp-core-mvc -documentation: UG ---- - -# How to add the date to the signature text - -To add a date with the signature text in Syncfusion® PDF Viewer, use the `updateFormFieldsValue()` method. Add a signature field to a PDF document and get the signature field in a PDF using the `retrieveFormFields()` method and store it in a variable. Modify the value of the signature field and get the current date. Use the `Date()` method to get the current date and format it as desired. - -Update the signature field in a PDF using the `updateFormFieldsValue()` method and pass the modified signature field as a parameter. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
-
- - @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf").Render() -
-
- - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
-
- - @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
-
- - -``` -{% endhighlight %} -{% endtabs %} - -[View Sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/EJ2-67373-sample/How%20to/Add%20date%20with%20the%20signature) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/signatureselect-signatureunselect.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/signatureselect-signatureunselect.md deleted file mode 100644 index b3309b22d6..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/signatureselect-signatureunselect.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -layout: post -title: Signature selection events in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about signatureSelect and signatureUnselect event in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# SignatureSelect and SignatureUnselect event - -The Syncfusion® PDF Viewer provides event-handling capabilities for various actions, including selecting and unselecting handwritten signatures. The `signatureSelect` and `signatureUnselect` events enable developers to programmatically manage the selection state of signatures within the PDF Viewer component. - -**signatureSelect** - -The `signatureSelect` event triggers when a handwritten signature annotation is selected. This event allows developers to capture the signature selection and handle it programmatically, such as updating the UI or storing the selection data for further processing. - -**signatureUnselect** - -The `signatureUnselect` event triggers when a handwritten signature annotation is unselected. This event enables developers to manage the unselection programmatically, which can be useful for tasks like cleanup operations or updating the application's state to reflect that a signature is no longer selected. - -The code snippet demonstrates how to subscribe to the `signatureSelect` and `signatureUnselect` events in the Syncfusion® PDF Viewer component. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@{ - ViewBag.Title = "Home Page"; -} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").SignatureUnselect("signatureUnselect").SignatureSelect("signatureSelect").Render() -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -@{ - ViewBag.Title = "Home Page"; -} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").SignatureUnselect("signatureUnselect").SignatureSelect("signatureSelect").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -The `signatureSelect` and `signatureUnselect` events in Syncfusion® PDF Viewer offer robust options for managing the state of handwritten signatures within your application. By handling these events, developers can create a more interactive and dynamic user experience, responding programmatically to signature selection and unselection. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/unload-document.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/unload-document.md deleted file mode 100644 index e715653065..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/unload-document.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -layout: post -title: Unload Document in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Unload Document in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Unload Document -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Unload the PDF document programmatically - -The PDF Viewer library allows you to unload the PDF document being displayed in the PDF Viewer control programmatically using the [**unload()**](https://ej2.syncfusion.com/documentation/api/pdfviewer/#unload) method. - -The following steps are used to unload the PDF document programmatically. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Add the following code snippet to perform the unload operation. - -```html - - - -``` - -Download the Sample, [how to unload the PDF document programmatically](https://www.syncfusion.com/downloads/support/directtrac/general/ze/EJ2MvcSample-1421635547.zip) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/webservice-not-listening.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/webservice-not-listening.md deleted file mode 100644 index d15f4e4dcb..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/webservice-not-listening.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -layout: post -title: Web-service is not listening to error in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn how to clear Web-service is not listening to error in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: How to clear Web-service is not listening to error -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - -# How to clear the "Web-service is not listening" to error - -![Alt text](./images/webservice.png) - -If you are facing a **Web-service is not listening** to error in the Syncfusion® PDF Viewer, there could be several reasons for this. To troubleshoot the issue, you can use the Network tab in your browser's developer tools to gather more information. Here are the steps you can follow: - -**Step 1:** Open the browser's developer tools by right-clicking on the page and selecting `Inspect` from the dropdown menu. Then Navigate to the `Network` tab. This will show you all of the requests that are being made by the page. - -![Alt text](./images/networktab.png) - -**Step 2:** Try to request the web service. If the service is not listening, the request will fail, and you should see an error message in the Network tab. Click on the failing request to see the details of the error, such as the error message or stack trace. This can help you identify the root cause of the issue. Check the server logs for any errors or warnings that may indicate the cause of the issue and help you to troubleshoot the problem. - -**Step 3:** Check the request URL and parameters to see if they are correct. If there is a type or an incorrect parameter, the web service may be unable to process the request. - -By following these steps and using the Network tab in your browser's developer tools, you can gather more information about the issue and troubleshoot the problem more effectively. - -N> Make sure you are connected to the internet and that your connection is stable. You can try accessing other websites or services to see if they are working, and make sure the URL you are using to access the web service is correct and properly formatted. - -## Here are some common exceptions - -* File not found. -* Document cache not found. -* Document pointer does not exist in the cache. - -## File not found - -If you are encountering an error message stating that the web service is not listening due to a file not being found in the Syncfusion® PDF viewer, you can try the following steps to resolve the issue: - -### Check the file path - -Ensure that the file path you use to access the PDF file is correct and that the file exists in that location. You will need to update the file path if the file does not exist. - -## Document cache not found - -The `Document cache not found` exception in Syncfusion® PDF Viewer typically occurs when the cache used to store the rendered pages of a PDF document is not found or has been deleted. This can happen if the cache directory is changed or deleted or if the application is running in a different environment than it was previously. - -### Check for multiple instances - -It's possible that you have multiple instances of the Syncfusion® PDF Viewer running simultaneously, which can cause issues with the document cache. To check for this, open the Task Manager on your computer and look for any instances of the Syncfusion® PDF Viewer running. If you find multiple instances, try closing them all and reopening the viewer. - -We can use Redis cache and distributive cache for this issue. - -### Check your network connection - -Ensure that your network connection is stable and strong enough to support the web service you are trying to use. Sometimes, simply restarting the web service can resolve the issue. Try stopping and starting the service again to see if it resolves the problem. - -## The document pointer does not exist in the cache. - -The `Document pointer does not exist in the cache` exception in the Syncfusion® PDF Viewer usually occurs when there is an issue with loading or caching the PDF document. This error can be caused by a variety of reasons, including: - -To clear this error in the Syncfusion® PDF Viewer, you can try the following steps: - -**Step 1:** Clearing the cache may help resolve the issue. To clear the cache, navigate to the cache location, which can be found in the Syncfusion® PDF Viewer's settings or configuration files. Once you locate the cache folder, delete its contents. - -**Step 2:** Try reloading the document to ensure it is loaded correctly. You can do this by calling the controller's Load() method. Ensure the document is not already loaded before attempting to load it again. - -**Step 3:** Restart the application. If clearing the cache does not work, you can try restarting the PDF Viewer application. This will reload all the necessary components and may resolve the error. - -## Internal server error - -Server-side exceptions happen for various use cases. We can't just define them if they are document-specific, provide the document, or you may need to contact Syncfusion® support for further assistance. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/interaction-mode.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/interaction-mode.md deleted file mode 100644 index c311c9d5ee..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/interaction-mode.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -layout: post -title: Interaction_mode in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Interaction_mode in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Interaction_mode -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Interaction Mode in PDF Viewer component - -The PDF Viewer provides interaction mode for easy interaction with the loaded PDF document. Selection mode and panning mode are the two interactions modes. - -## Selection mode - -In this mode, the text selection can be performed in the PDF document loaded in PDF Viewer. The panning and scrolling of the pages by touch cannot be performed in this mode. It allows users to select and copy text from the PDF files. This is helpful for copying and sharing text content. You can enable/disable the text selection using the following code snippet. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnableTextSelection(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableTextSelection(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/selection.png) - -## Panning Mode - -In this mode, the panning and scrolling of the pages by touch can be performed in the PDF document loaded in the PDF Viewer, but the text selection cannot be performed. - -![Alt text](./images/pan.png) - -You can switch the interaction mode of PDF Viewer by using the following code snippet., - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -```html -
- @Html.EJS().PdfViewer("pdfviewer").InteractionMode(Syncfusion.EJ2.PdfViewer.InteractionMode.Pan).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).InteractionMode(Syncfusion.EJ2.PdfViewer.InteractionMode.Pan).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/magnification.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/magnification.md deleted file mode 100644 index a73499a4dd..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/magnification.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -layout: post -title: Magnification in ##Platform_Name## Pdfviewer Component -description: Learn here all about Magnification in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Magnification -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Magnification - -The magnification tools of the PDF viewer contains ZoomIn,ZoomOut,Zoom,FitPage, and FitWidth tools in the default toolbar. The PDF Viewer also has an option to show or hide the magnification tools in the default toolbar. - -The following code snippet describes how to enable the magnification in PDF Viewer. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnableMagnification(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableMagnification(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -The following magnification options are available in the default toolbar of PDF Viewer:- - -* **ZoomIn**:- perform Zoom in from current zoom value of PDF pages. -* **ZoomOut**:- perform Zoom out from current zoom value of PDF pages. -* **Zoom**:- Zoom to specific zoom value of PDF pages. -* **FitPage**:- Fits the page width with-in the available view port size. -* **FitWidth**:- Fits the view port width based on the page content size. -* **Auto**:- Fits the page content with-in the viewport on resizing action. - -![Alt text](./images/zoom.png) - -N>PDF Viewer can support the zoom value ranges from 10 to 400. - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/mobile-toolbar.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/mobile-toolbar.md deleted file mode 100644 index c79e085dd3..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/mobile-toolbar.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -layout: post -title: Mobile Toolbar Interface in ##Platform_Name## Pdfviewer Component| Syncfusion -description: Learn All About the Mobile Toolbar Interface in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Mobile Toolbar Interface -documentation: ug -domainurl: ##DomainURL## ---- -# Mobile Toolbar Interface in ASP.NET MVC PDFViewer Control - -The Mobile PDF Viewer offers a variety of features for viewing, searching, annotating, and managing PDF documents on mobile devices. It includes essential tools like search, download, bookmarking, annotation, and page organization. Users also have the option to enable desktop toolbar features in mobile mode, providing a more extensive set of actions. - -## Mobile Mode Toolbar Configuration -In mobile mode, the toolbar is optimized for ease of use on small screens, presenting users with the most common actions for interacting with a PDF document. Below are the key features available in mobile mode: - -![Mobile toolbar with primary PDF interaction options](./images/mobileToolbar.png) - -### Main Toolbar Options: - -**OpenOption:** Tap to load a PDF document. - -**SearchOption:** Access the search bar to find text within the document. - -![Search bar displayed for finding text within a PDF](./images/searchOption.png) - -**UndoRedoTool:** Quickly undo or redo any annotations made. - -**OrganizePagesTool:** Enable or disable page organization features to modify document pages. - -![Page organization interface for modifying PDF pages](./images/organizePages.png) - -**AnnotationEditTool:** Activate or deactivate annotation editing to add or modify annotations. - -![Annotation editing toolbar allowing users to add, edit, or delete annotations on a PDF](./images/editAnnotation.png) - - -N> In mobile mode, the annotation toolbar is conveniently displayed at the bottom of the viewer. - -### More Options Menu: - -When you open the "more options" menu, you will see additional actions such as: - -**DownloadOption:** Tap to download the currently opened PDF document. - -**BookmarkOption:** Allows you to view bookmarks within the document. - -![More options menu showing additional actions like download and bookmark](./images/more-options.png) - -## Enabling Desktop Mode in Mobile - -The desktop version of the toolbar can be enabled on mobile devices by using the `enableDesktopMode` API. This API allows you to bring desktop-like features to the mobile PDF viewer, providing access to additional toolbar actions that are typically available on desktop platforms. - -### Steps to Enable Desktop Mode: - -**Step 1:** Set `enableDesktopMode` to true in the API configuration. - -**Step 2:** This will replace the mobile toolbar with the desktop toolbar layout, allowing access to more actions and controls. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").EnableDesktopMode(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).EnableDesktopMode(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% endtabs %} - -## Enable Scrolling in Desktop Mode with Touch Gestures - -To ensure smooth scrolling of PDF documents on a mobile device in desktop mode, it is important to enable touch gesture scrolling. You can achieve this by setting the `enableTextSelection` option to **false**. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").EnableDesktopMode(true).EnableTextSelection(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).EnableDesktopMode(true).EnableTextSelection(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% endtabs %} - -## Print Option Not Available - -The Print option is not available in mobile mode by default. However, if you need to use the print functionality on mobile devices, we recommend enabling the desktop toolbar on mobile using the `enableDesktopMode` API. - -### How to Use Print on Mobile: - -**Enable Desktop Mode:** Set `enableDesktopMode` to true to load the desktop version of the toolbar on your mobile device. - -**Print Option:** Once desktop mode is enabled, the print option will be available, allowing you to print the document directly from your mobile device. - -N> In mobile mode, the print functionality will not be available unless desktop mode is enabled. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/navigation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/navigation.md deleted file mode 100644 index 05f14d64c1..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/navigation.md +++ /dev/null @@ -1,148 +0,0 @@ ---- -layout: post -title: Navigation in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Navigation in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Navigation -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Navigation in PDF Viewer component - -The ASP.NET Core PDF Viewer supports different internal and external navigations. - -## Toolbar page navigation option - -The default toolbar of PDF Viewer contains the following navigation options: - -* **Go to page**:- Navigates to the specific page of a PDF document. -* **Show next page**:- Navigates to next page of a PDF document. -* **Show previous page**:- - Navigates to the previous page of a PDF document. -* **Show first page**:- Navigates to the first page of a PDF document. -* **Show last page**:- Navigates to the last page of a PDF document. - -You can enable/disable page navigation option in PDF Viewer using the following code snippet. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnableNavigation(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableNavigation(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/navigation.png) - -## Bookmark navigation - -The bookmarks saved in PDF files are loaded and made ready for easy navigation. -You can enable/disable bookmark navigation by using the following code snippet., - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnableBookmark(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableBookmark(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/bookmark.png) - -## Thumbnail navigation - -Thumbnails is the miniature representation of actual pages in PDF files. This feature displays thumbnails of the pages and allows navigation. -You can enable/disable thumbnail navigation by using the following code snippet., - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnableThumbnail(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableThumbnail(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/thumbnail.png) - -## Hyperlink navigation - -Hyperlink navigation features enables navigation to the URLs (website links) in a PDF file. - -![Alt text](./images/link.png) - -## Table of content navigation - -Table of contents navigation allows users to navigate to different parts of a PDF file that are listed in the table of contents section. - -You can enable/disable link navigation by using the following code snippet., - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnableHyperlink(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableHyperlink(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -You can change the open state of the hyperlink in the PDF Viewer by using the following code snippet., - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").HyperlinkOpenState(Syncfusion.EJ2.PdfViewer.LinkTarget.NewTab).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).HyperlinkOpenState(Syncfusion.EJ2.PdfViewer.LinkTarget.NewTab).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/toc.png) - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file.md deleted file mode 100644 index a72c42b3d9..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -layout: post -title: Open PDF files in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Opening PDF in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: How to Open PDF From Base64 -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Opening a PDF from Base64 data in PDF Viewer -### Overview - -This guide demonstrates how to load a PDF document from a Base64 string into the Syncfusion PDF Viewer using ASP.NET MVC. This feature is useful for loading PDF data received from a client, database, or other sources where the document is encoded in Base64. - -### Opening PDF from Base64 data - -**Step 1:** Set Up the PdfViewer in Your ASP.NET MVC Project - - Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to load PDF document using base64 string. - - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} -
-
- - - @Html.EJS().PdfViewer("pdfViewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").ResourceUrl("https://cdn.syncfusion.com/ej2/28.1.33/dist/ej2-pdfviewer-lib").Render() -
-
- - - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-amazon-s3.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-amazon-s3.md deleted file mode 100644 index 28d78e6014..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-amazon-s3.md +++ /dev/null @@ -1,181 +0,0 @@ ---- -layout: post -title: AWS S3 in ##Platform_Name## Syncfusion PDF Viewer Component -description: Learn here all about how to Open PDF files from AWS S3 in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF file from AWS S3 - -PDF Viewer allows to load PDF file from AWS S3 using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to open a PDF from AWS S3. - -## Using Standalone PDF Viewer - -To load a PDF file from AWS S3 in a PDF Viewer, you can follow the steps below - -**Step 1:** Create AWS S3 account - -Set up an AWS S3 account by following the instructions on the official AWS site: [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). Create an S3 bucket and generate access keys while ensuring secure storage of credentials. - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `~/Views/Shared/_Layout.cshtml` File in the Project - -1. Add the required scripts using CDN inside the `` of `~/Views/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - -{% endhighlight %} -{% endtabs %} - -**Step 4:** Modify the `~/Views/Home/Index.cshtml` File in the Project - -1. Configures AWS SDK with the region, access key, and secret access key. This configuration allows the application to interact with AWS services like S3. - -N> Replace **Your Region** with the actual Region of your AWS S3 account and **Your Access Key** with the actual Access Key of your AWS S3 account and **Your Security Access Key** with the actual Security Access Key of your AWS S3 account. - -```csharp -AWS.config.update({ - region: '**Your Region**', // Update this your region - accessKeyId: '*Your Access Key*', // Update this with your access key id - secretAccessKey: '*Your Security Access Key*', // Update this with your secret access key -}); -``` - -2. Sets the parameters for fetching the PDF document from S3, including the bucket name and file key. Then Uses the getObject method of the S3 instance to retrieve the document. Converts the document data to a Base64 string and loads it into the Syncfusion® PDF Viewer then load Base64 string generated into the viewer.load method. - -N> Replace **Your Bucket Name** with the actual Bucket name of your AWS S3 account and **Your Key** with the actual File Key of your AWS S3 account. - -```csharp -loadDocument() { - const s3 = new AWS.S3(); - const getObjectParams = { - Bucket: '**Your Bucket Name**', - Key: '**Your Key**', - }; - this.s3.getObject(getObjectParams, (err, data) => { - if (err) { - console.error('Error fetching document:', err); - } else { - if (data && data.Body) { - const bytes = new Uint8Array(data.Body as ArrayBuffer); - let binary = ''; - bytes.forEach((byte) => (binary += String.fromCharCode(byte))); - const base64String = window.btoa(binary); - console.log('Document data as Base64:', base64String); - var viewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - setTimeout(() => { - viewer.load("data:application/pdf;base64,"+base64String); - }, 2000); - } - } - }); -} -``` - -N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). - -## Using Server-Backed PDF Viewer - -To load a PDF file from AWS S3 in a PDF Viewer, you can follow the steps below - -**Step 1:** Create AWS S3 account - - Set up an AWS S3 account by following the instructions on the official AWS site: [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). Create an S3 bucket and generate access keys while ensuring secure storage of credentials. - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Amazon; -using Amazon.S3; -using Amazon.S3.Model; -``` - -2. Modify the `Load()` method to load the PDF files from AWS S3. - -```csharp - private readonly string _accessKey = "Your Access Key from AWS S35"; - private readonly string _secretKey = "Your Secret Key from AWS S3"; - private readonly string _bucketName = "Your Bucket name from AWS S3"; - - [System.Web.Mvc.HttpPost] - public async Task Load(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - MemoryStream stream = new MemoryStream(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = new object(); - if (jsonObject != null && jsonData.ContainsKey("document")) - { - if (bool.Parse(jsonData["isFileName"])) - { - RegionEndpoint bucketRegion = RegionEndpoint.USEast1; - - // Configure the AWS SDK with your access credentials and other settings - var s3Client = new AmazonS3Client(_accessKey, _secretKey, bucketRegion); - - string document = jsonData["document"]; - - // Specify the document name or retrieve it from a different source - var response = await s3Client.GetObjectAsync(_bucketName, document); - - Stream responseStream = response.ResponseStream; - responseStream.CopyTo(stream); - stream.Seek(0, SeekOrigin.Begin); - } - else - { - byte[] bytes = Convert.FromBase64String(jsonData["document"]); - stream = new MemoryStream(bytes); - - } - } - jsonResult = pdfviewer.Load(stream, jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - -``` - -N> Replace **Your Access Key from AWS S3**, **Your Secret Key from AWS S3**, and **Your Bucket name from AWS S3** with your actual AWS access key, secret key and bucket name - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from AWS S3. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").Render() -
-
- -``` - -N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Server-Backend) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-azure-active-directory.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-azure-active-directory.md deleted file mode 100644 index 0a258a334e..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-azure-active-directory.md +++ /dev/null @@ -1,210 +0,0 @@ ---- -layout: post -title: Open PDF from AAD in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about How to Open Pdf From AAD in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Open PDF from AAD -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF From Azure Active Directory in Viewer - -### **Overview** - -The Syncfusion PDF Viewer allows you to load and save PDF files directly from Azure Active Directory (AAD). Below are the steps to securely load and store PDF documents from and to AAD using the PDF Viewer. - -### **Steps to Open the PDF File from Azure Active Directory** - ---- - -### **Step 1: Register an Application in Azure Active Directory (AAD)** - -1. **Go to the Azure Portal**: - - Navigate to [Azure Portal](https://portal.azure.com). - -2. **Register your Application**: - - In the Azure portal, go to **Azure Active Directory** > **App registrations** > **New registration**. - - Register your application and note down the **Application (client) ID** and **Directory (tenant) ID**. - - ![app-registration](../../images/app-registration.png) - -3. **Create a Client Secret**: - - In the registered application, go to **Certificates & secrets**. - - Click **New client secret**. - - Provide a description and set an expiration period. - - Click **Add**. - - Copy the client secret value immediately, as it will be hidden later. Store it securely. - - ![client-secret](../../images/client-secret.png) - ---- - -### **Step 2: Create the Azure Storage Account** - -1. **Create a Storage Account**: - - In the Azure portal, use the search bar to search for **Storage accounts**. - - Create a new storage account by filling in the required details (e.g., name, location, resource group, etc.). - - ![storage-account](../../images/storage-account.png) - ---- - -### **Step 3: Assign Role to the Application** - -1. **Go to your Storage Account**: - - Navigate to **Access control (IAM)** > **Add role assignment** in your Azure Storage Account. - -2. **Assign Role**: - - Assign the **Storage Blob Data Contributor** role to your registered application. - - In the **Assign access to** dropdown, select **User, group, or service principal**. - - Click on **Select members** and search for your registered application by name or client ID. - - Select your application and click **Select**. - - Click **Review + assign** to finalize the role assignment. - - ![add-role](../../images/add-role.png) ---- - -### **Step 4: Upload the PDF Document to the Azure Storage Account** - -1. **Navigate to Data Storage**: - - In the Azure portal, go to **Data storage** > **Containers**. - -2. **Upload the PDF File**: - - Create a new container and upload the PDF document you want to access in the PDF Viewer. - - ![upload-pdf](../../images/upload-pdf.png) ---- - -### **Step 5: ASP.NET MVC PDF Viewer Control Configuration** -1. Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample. - -2. Add the following code snippet in `HomeController.cs`. - -{% tabs %} -{% highlight c# tabtitle="~/HomeController.cs" %} - -using Azure.Identity; -using Azure.Storage.Blobs; - -string tenantId = "YOUR_TENANT_ID"; -string clientId = "YOUR_CLIENT_ID"; -string clientSecret = "YOUR_CLIENT_SECRET"; -string blobServiceEndpoint = "https://your-storage-account.blob.core.windows.net"; -string containerName = "your-container-name"; - -public async Task LoadFromAAD(string fileName) -{ - var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret); - var blobServiceClient = new BlobServiceClient(new Uri(blobServiceEndpoint), clientSecretCredential); - var containerClient = blobServiceClient.GetBlobContainerClient(containerName); - var blobClient = containerClient.GetBlobClient(fileName); - - // Download the PDF file to a local stream - MemoryStream pdfStream = new MemoryStream(); - await blobClient.DownloadToAsync(pdfStream); - var base64 = Convert.ToBase64String(pdfStream.ToArray()); - return Content("data:application/pdf;base64," + base64); -} - - -public async Task SaveToAAD(jsonObjects responseData) -{ - var jsonObject = JsonConverterstring(responseData); - PdfRenderer pdfviewer = new PdfRenderer(); - var fileName = jsonObject.ContainsKey("documentId") ? jsonObject["documentId"] : "Test.pdf"; - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - string convertedBase = documentBase.Substring(documentBase.LastIndexOf(',') + 1); - // Decode the Base64 string to a byte array - byte[] byteArray = Convert.FromBase64String(convertedBase); - // Create a MemoryStream from the byte array - MemoryStream stream = new MemoryStream(byteArray); - // Create a new BlobServiceClient using the DefaultAzureCredential - var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret); - var blobServiceClient = new BlobServiceClient(new Uri(blobServiceEndpoint), clientSecretCredential); - // Get a reference to the container - var containerClient = blobServiceClient.GetBlobContainerClient(containerName); - // Get a reference to the blob - var blobClient = containerClient.GetBlobClient(fileName); - //FileStream uploadFileStream = new FileStream(); - await blobClient.UploadAsync(stream, true); - stream.Close(); - return Content(string.Empty); -} - -{% endhighlight %} -{% endtabs %} - -3. Configure Server-Side Code: - - Open the server-side application (e.g., ASP.NET Core) and configure the following details in the `PdfViewerController` file: - - `tenantId` (your Azure AD tenant ID), - - `clientId` (your registered application client ID), - - `clientSecret` (your registered application client secret), - - `blobServiceEndpoint` (your storage account blob service URL), - - `containerName` (your container name in Azure Blob Storage). - -4. Add the following code snippet in `Index.cshtml`. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml" %} - -@{ - ViewBag.Title = "Home Page"; -} - -
- -
- - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
-
- - - -{% endhighlight %} -{% endtabs %} - -5. Run the Application - - Build and run your MVC application. The PDF Viewer will be displayed with Load from AAD and Save to AAD buttons. - -6. Load PDF from AAD - - Click the Load from AAD button. - - The server fetches the PDF from Azure Blob Storage and loads it into the Syncfusion PDF Viewer. - -7. Save PDF to AAD - - Click the Save to AAD button. - - The server uploads the modified PDF back to Azure Blob Storage. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aad). \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-azure-blob-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-azure-blob-storage.md deleted file mode 100644 index 08669d846c..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-azure-blob-storage.md +++ /dev/null @@ -1,187 +0,0 @@ ---- -layout: post -title: Open PDF from Azure Blob Storage in ##Platform_Name## PdfViewer | Syncfusion -description: Learn here all about how to Open PDF files from Azure Blob Storage in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF file from Azure Blob Storage - -PDF Viewer allows to load PDF file from Azure Blob Storage using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to open a PDF from Azure Blob Storage. - -## Using Standalone PDF Viewer - -To load a PDF file from Azure Blob Storage in a PDF Viewer, you can follow the steps below - -**Step 1:** Create the Azure Blob Storage account - -Log in to the Azure Portal. Create a new Storage Account with preferred settings. Note access keys during the setup. Within the Storage Account, create a Blob Container following the steps in this [link](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal). - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `Views/Home/index.cshtml` File in the Project - -1. Add the following properties to the `Views/Home/index.cshtml`, and assign the values from the configuration to the corresponding properties - -N> Replace **Your account name in Azure** with the actual account name for your Azure Blob Storage account and **Your container name in Azure** with the actual container name and **Your Blob name in Azure** with the actual container name. - -```csharp -var accountName = "*Your account name in Azure*"; -var containerName = "*Your container name in Azure*"; -var blobName = "*Your Blob name in Azure*"; -``` - -2. Constructs the URL to the PDF in Azure Blob Storage. Calls fetchAndConvertToBase64 to fetch the PDF and convert it to a base64 string. Then Loads the base64 string into the PDF Viewer. - -```csharp -function loadDocument() { - var url = 'https://' + accountName + '.blob.core.windows.net/' + containerName + '/' + blobName; - fetchAndConvertToBase64(url).then(function(base64String) { - if (base64String) { - setTimeout(function() { - viewer.load("data:application/pdf;base64," + base64String); - }, 2000); - } else { - console.error('Failed to fetch and convert file to base64.'); - } - }).catch(function(error) { - console.error('Error:', error); - }); -} -``` - -3. Then it retrieves the PDF file from the given URL and converts the fetched Blob to a base64 string using blobToBase64. - -```csharp -function fetchAndConvertToBase64(url) { - return new Promise(function(resolve, reject) { - fetch(url).then(function(response) { - if (!response.ok) { - throw new Error('HTTP error! Status: ' + response.status); - } - return response.blob(); - }).then(function(blob) { - blobToBase64(blob).then(function(base64String) { - resolve(base64String); - }); - }).catch(function(error) { - console.error('Error fetching file:', error); - reject(null); - }); - }); -} -``` - -4. Uses FileReader to convert a Blob to a base64 string. Resolves the promise with the base64 string or rejects it in case of an error. - -```csharp -function blobToBase64(blob) { - return new Promise(function(resolve, reject) { - var reader = new FileReader(); - reader.onload = function() { - var base64String = reader.result ? reader.result.toString().split(',')[1] : ''; - resolve(base64String); - }; - reader.onerror = function(error) { - reject(error); - }; - reader.readAsDataURL(blob); - }); -} -``` - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). - -## Using Server-Backed PDF Viewer - -To load a PDF file from Azure Blob Storage in a PDF Viewer, you can follow the steps below - -**Step 1:** Create the Azure Blob Storage account - -Log in to the Azure Portal. Create a new Storage Account with preferred settings. Note access keys during the setup. Within the Storage Account, create a Blob Container following the steps in this [link](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal). - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; -``` - -2. Modify the `Load()` method to load the PDF files from Azure Blob Storage. - -```csharp - -private readonly string _connectionString = "Your Connection string from Azure"; -private readonly string _containerName = "Your container name in Azure"; - -public ActionResult Load(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - MemoryStream stream = new MemoryStream(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = new object(); - if (jsonObject != null && jsonData.ContainsKey("document")) - { - if (bool.Parse(jsonData["isFileName"])) - { - - // Create a BlobServiceClient object by passing the connection string. - BlobServiceClient blobServiceClient = new BlobServiceClient(_connectionString); - - // Get a reference to the container - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(_containerName); - - string fileName = jsonData["document"]; - // Get a reference to the block blob - BlockBlobClient blockBlobClient = containerClient.GetBlockBlobClient(fileName); - - blockBlobClient.DownloadTo(stream); - } - else - { - byte[] bytes = Convert.FromBase64String(jsonData["document"]); - stream = new MemoryStream(bytes); - - } - } - jsonResult = pdfviewer.Load(stream, jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); -} - -``` - -N> Replace **Your Connection string from Azure** with the actual connection string for your Azure Blob Storage account and **Your container name in Azure** with the actual container name - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Azure Blob Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").Render() -
-
- -``` - -N> The **Azure.Storage.Blobs** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Server-Backend). \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-box-cloud-file-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-box-cloud-file-storage.md deleted file mode 100644 index 1df0acb813..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-box-cloud-file-storage.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -layout: post -title: Box cloud file storage in ##Platform_Name## PDF Viewer Component -description: Learn here all about how to Open PDF files from Box cloud file storage in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF file from Box cloud file storage - -To load a PDF file from Box cloud file storage in a PDF Viewer, you can follow the steps below - -**Step 1** Set up a Box developer account and create a Box application - -To access Box storage programmatically, you'll need a developer account with Box. Go to the [Box Developer Console](https://developer.box.com/), sign in or create a new account, and then create a new Box application. This application will provide you with the necessary credentials Client ID and Client Secret to authenticate and access Box APIs. Before accessing files, you need to authenticate your application to access your Box account. Box API supports `OAuth 2.0 authentication` for this purpose. - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using Box.V2; -using Box.V2.Auth; -using Box.V2.Config; -using Box.V2.Models; -``` - -2. Modify the `Load()` method to load the PDF files from Box cloud file storage. - -```csharp - - private readonly string _clientId = "Your_Box_Storage_ClientID"; - private readonly string _clientSecret = "Your_Box_Storage_ClientSecret"; - private readonly string _accessToken = "Your_Box_Storage_Access_Token"; - private readonly string _folderId = "Your_Folder_ID"; - - [System.Web.Mvc.HttpPost] - - public async Task Load(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - MemoryStream stream = new MemoryStream(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = new object(); - if (jsonObject != null && jsonData.ContainsKey("document")) - { - if (bool.Parse(jsonData["isFileName"])) - { - string objectName = jsonData["document"]; - // Initialize the Box API client with your authentication credentials - var auth = new OAuthSession(_accessToken, "YOUR_REFRESH_TOKEN", 3600, "bearer"); - var config = new BoxConfigBuilder(_clientId, _clientSecret, new Uri("http://boxsdk")).Build(); - var client = new BoxClient(config, auth); - - // Download the file from Box storage - var items = await client.FoldersManager.GetFolderItemsAsync(_folderId, 1000, autoPaginate: true); - var files = items.Entries.Where(i => i.Type == "file"); - - // Filter the files based on the objectName - var matchingFile = files.FirstOrDefault(file => file.Name == objectName); - - // Fetch the file from Box storage by its name - var fileStream = await client.FilesManager.DownloadAsync(matchingFile.Id); - stream = new MemoryStream(); - await fileStream.CopyToAsync(stream); - - // Reset the position to the beginning of the stream - stream.Position = 0; - } - else - { - byte[] bytes = Convert.FromBase64String(jsonData["document"]); - stream = new MemoryStream(bytes); - - } - } - jsonResult = pdfviewer.Load(stream, jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } -``` - -N> replace **Your_Box_Storage_Access_Token** with your actual box access token, and **Your_Folder_ID** with the ID of the folder in your box storage where you want to perform specific operations. Remember to use your valid box API credentials, as **Your_Box_Storage_ClientID** and **Your_Box_Storage_ClientSecret"** are placeholders for your application's API key and secret. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Box cloud file storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").Render() -
-
- -``` -N> The **Box.V2.Core** NuGet package must be installed in your application to use the previous code example. - -N> Replace `PDF_Succinctly.pdf` with the actual document name that you want to load from Box cloud file storage. Make sure to pass the document name from the box folder to the `documentPath` property of the PDF viewer component - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-box-cloud-file-storage) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-google-cloud-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-google-cloud-storage.md deleted file mode 100644 index f0d5312df8..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-google-cloud-storage.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -layout: post -title: Google Cloud Storage in ##Platform_Name## PDF Viewer Component -description: Learn here all about how to Open PDF files from Google Cloud Storage in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF file from Google Cloud Storage - -To load a PDF file from Google Cloud Storage in a PDF Viewer, you can follow the steps below - -**Step 1** Create a Service Account - -Open the Google Cloud Console. Navigate to `IAM & Admin` > `Service accounts`. Click `Create Service Account`.` Enter a name, assign roles (e.g., Storage Object Admin), and create a key in JSON format. Download the key file securely. Utilize the downloaded key file in your applications or services for authentication and access to the Google Cloud Storage bucket. For additional details, refer to the [official documentation](https://cloud.google.com/iam/docs/service-accounts-create). - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Google.Cloud.Storage.V1; -using Google.Apis.Auth.OAuth2; - -``` -2. Add the following private fields and constructor parameters to the `HomeController.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp - - // The key file is used to authenticate with Google Cloud Storage. - private string keyFilePath = @"path/to/service-account-key.json"; - private readonly string _bucketName = "Your Bucket name from Google Cloud Storage"; - private readonly StorageClient _storageClient; - - public HomeController() - { - // Load the service account credentials from the key file. - var credentials = GoogleCredential.FromFile(keyFilePath); - - // Create a storage client with Application Default Credentials - _storageClient = StorageClient.Create(credentials); - } - -``` -3. Modify the `Load()` method to load the PDF files from Google Cloud Storage bucket. - -```csharp - -public ActionResult Load(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - MemoryStream stream = new MemoryStream(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = new object(); - if (jsonObject != null && jsonData.ContainsKey("document")) - { - if (bool.Parse(jsonData["isFileName"])) - { - - - string bucketName = _bucketName; - string fileName = jsonData["document"]; - _storageClient.DownloadObject(bucketName, fileName, stream); - stream.Position = 0; - - } - else - { - byte[] bytes = Convert.FromBase64String(jsonData["document"]); - stream = new MemoryStream(bytes); - - } - } - jsonResult = pdfviewer.Load(stream, jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); -} - -``` - -N> Replace **Your Bucket name from Google Cloud Storage** with the actual name of your Google Cloud Storage bucket - -N> Replace **path/to/service-account-key.json** with the actual file path to your service account key JSON file. Make sure to provide the correct path and filename. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Google Cloud Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").Render() -
-
- -``` - -N> The **Google.Cloud.Storage.V1** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-google-cloud-storage) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-google-drive.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-google-drive.md deleted file mode 100644 index 631f262b6d..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/open-pdf-file/from-google-drive.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -layout: post -title: AWS S3 in ##Platform_Name## PDF Viewer Component -description: Learn here all about how to Open PDF files from AWS S3 in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF file from Google Drive - -To load a PDF file from Google Drive in a PDF Viewer, you can follow the steps below - -**Step 1** Set up Google Drive API - -You must set up a project in the Google Developers Console and enable the Google Drive API. Obtain the necessary credentials to access the API. For more information, view the official [link](https://developers.google.com/drive/api/guides/enable-sdk). - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Google.Apis.Drive.v3; -using Google.Apis.Auth.OAuth2; -using Google.Apis.Services; -using Google.Apis.Util.Store; -``` - -2. Modify the `Load()` method to load the PDF files from Google Drive. - -```csharp - -// Specify the path to the credentials file -private string credentialsPath = "Your Path to the OAuth 2.0 Client IDs json file"; -// Specify the folder ID where you want to upload the PDF on Google Drive -private readonly string folderId = "Your Google Drive Folder ID"; -private readonly string ApplicationName = "Your Application Name"; -private readonly string tokenjson = "Path to create token.json file"; - - public async Task Load(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - MemoryStream stream = new MemoryStream(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = new object(); - - if (jsonObject != null && jsonData.ContainsKey("document")) - { - if (bool.Parse(jsonData["isFileName"])) - { - string objectName = jsonData["document"]; - - // Google Drive API setup - UserCredential credential; - string[] Scopes = { DriveService.Scope.DriveReadonly }; - - // Load the credentials file - using (var streammen = new FileStream(credentialsPath, FileMode.Open, FileAccess.Read)) - { - // The file token.json stores the user's access and refresh tokens, and is created - // automatically when the authorization flow completes for the first time. - string tokenPath = tokenjson; - credential = GoogleWebAuthorizationBroker.AuthorizeAsync( - GoogleClientSecrets.Load(streammen).Secrets, - Scopes, - "user", - CancellationToken.None, - new FileDataStore(tokenPath, true)).Result; - } - - // Create the Drive service - var service = new DriveService(new BaseClientService.Initializer() - { - HttpClientInitializer = credential, - ApplicationName = ApplicationName, - }); - - - FilesResource.ListRequest listRequest = service.Files.List(); - listRequest.Q = "mimeType='application/pdf' and '" + folderId + "' in parents and trashed=false"; - listRequest.Fields = "files(id, name)"; - var files = await listRequest.ExecuteAsync(); - - // Process the list of files (you can use 'files' to retrieve the list of files) - string fileIdToDownload = null; - foreach (var file in files.Files) - { - string fileId = file.Id; - string fileName = file.Name; - if (fileName == objectName) - { - // Save the matching fileId - fileIdToDownload = fileId; - break; - } - } - string fileIds = fileIdToDownload; - var request = service.Files.Get(fileIds); - await request.DownloadAsync(stream); - stream.Position = 0; - } - else - { - byte[] bytes = Convert.FromBase64String(jsonData["document"]); - stream = new MemoryStream(bytes); - } - } - - jsonResult = pdfviewer.Load(stream, jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); - } -``` - -N> Replace **Your Google Drive Folder ID**, **Your Application name**, **tokenPath** and **Your Path to the OAuth 2.0 Client IDs json file** with your actual Google drive folder ID , Your name for your application, Path to the token file to generate and the path for the JSON file. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Google Drive. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").Render() -
-
- -``` - -N> The **Google.Apis.Drive.v3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-google-drive) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/organize-pdf.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/organize-pdf.md deleted file mode 100644 index 3f3a137482..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/organize-pdf.md +++ /dev/null @@ -1,315 +0,0 @@ ---- -layout: post -title: Organize Pages Feature with EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Organize Pages Feature in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Organize Pages in PDF Viewer component - -The PDF Viewer allows you to manage your PDF documents efficiently by organizing pages seamlessly. Whether you need to add new pages, remove unnecessary ones, rotate pages, move pages within the document, and copy or duplicate pages, the PDF Viewer facilitate these tasks effortlessly. - -## Getting started - -To access the organize pages feature, simply open the PDF document in the PDF Viewer and navigate to the left vertical toolbar. Look for the `Organize Pages` option to begin utilizing these capabilities. - -![Alt text](./images/organize-page.png) - -The page organization support enables you to perform various actions such as rotating, rearranging, inserting, copying, and deleting pages within a PDF document using organize pages dialog. - -### Rotating PDF pages - -You can adjust the orientation of PDF pages to ensure proper alignment. The rotate icon offers the following options: - -* `Rotate clockwise`: Rotate the selected pages 90 degrees clockwise. -* `Rotate counter-clockwise`: Rotate the selected pages 90 degrees counter-clockwise. - -### Rearranging PDF pages - -You can easily change the sequence of pages within your document using the drag and drop method: - -* `Drag and drop`: Click and drag a page thumbnail to the desired position within the document, then release it to rearrange the page order. - -![Alt text](./images/rotate-rearrange.gif) - -### Inserting new pages - -Effortlessly add new pages to your document with the following options: - -* `Insert blank page left`: Insert a blank page to the left of the selected page using the respective icon. -* `Insert blank page right`: Insert a blank page to the right of the selected page using the corresponding icon. - -### Deleting PDF pages - -Removing unwanted pages from your document is straight forward: - -* `Select pages to delete`: Click on the page thumbnails you wish to remove. You can select multiple pages at once. -* `Delete selected pages`: Use the delete option in the organize pages pane to remove the selected pages from the document. - -### Copying PDF pages - -Duplicate the pages within your PDF document effortlessly: - -* `Select pages to copy`: Click on the page thumbnails you wish to duplicate. Use the copy option to create duplicates. When a page is copied, the duplicate is automatically added to the right of the selected page. Multiple copies can be made using the toolbar action. - -![Alt text](./images/insert-delete-copy.gif) - -### Importing a PDF Document - -Seamlessly import a PDF document into your existing document: - -* `Import PDF document`: Click the **Import Document** button to import a PDF. If a page is selected, the imported document’s thumbnail will be inserted to the right of the selected page. If multiple or no pages are selected, the thumbnail will be added as the first page. When **Save** or **Save As** is clicked, the imported PDF will be merged with the current document. You can insert a blank page to the left or right of the imported thumbnail, delete it, or drag and drop it to reposition as needed. - -![Alt text](./images/import.gif) - -### Selecting all pages - -Make comprehensive adjustments by selecting all pages simultaneously. This facilitates efficient editing and formatting across the entire document. - -![Alt text](./images/selectall.png) - -### Zooming Page Thumbnails - -Adjust the size of page thumbnails within the organizer panel for better visibility and precision when editing. The zoom functionality allows you to: - -* Increase or decrease the size of page thumbnails using the zoom slider -* See more details on pages when zoomed in -* View more pages simultaneously when zoomed out - -This feature is especially useful when working with documents containing complex layouts or small details that need careful examination during organization. - -![Alt text](./images/zoomOrganize.png) - -### Real-time updates - -Witness instant changes in page organization reflected within the PDF Viewer. Simply click the **Save** button to preserve your modifications. - -### SaveAs functionality - -Safeguard your edits by utilizing the **Save As** feature. This enables you to download the modified version of the PDF document for future reference, ensuring that your changes are securely stored. - -## API's supported - -**enablePageOrganizer:** This API enables or disables the page organizer feature in the PDF Viewer. By default, it is set to `true`, indicating that the page organizer is enabled. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").EnablePageOrganizer(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).EnablePageOrganizer(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% endtabs %} - -**isPageOrganizerOpen:** This API determines whether the page organizer dialog will be displayed automatically when a document is loaded into the PDF Viewer. By default, it is set to `false`, meaning the dialog is not displayed initially. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").IsPageOrganizerOpen(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).IsPageOrganizerOpen(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
- -{% endhighlight %} -{% endtabs %} - -**pageOrganizerSettings:** This API allows control over various page management functionalities within the PDF Viewer. It includes options to enable or disable actions such as deleting, inserting, rotating, copying, importing and rearranging pages, as well as configuring thumbnail zoom settings. By default, all these actions are enabled and standard zoom settings are applied. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").PageOrganizerSettings(new Syncfusion.EJ2.PdfViewer.PageOrganizerSettings { canDelete: true, canInsert: true, canRotate: true, canCopy: true, canRearrange: true, canImport: true, imageZoom: 1, showImageZoomingSlider: true, imageZoomMin: 1, imageZoomMax: 5 }).Render() -
- -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").PageOrganizerSettings(new Syncfusion.EJ2.PdfViewer.PageOrganizerSettings { canDelete: true, canInsert: true, canRotate: true, canCopy: true, canRearrange: true, canImport: true, imageZoom: 1, showImageZoomingSlider: true, imageZoomMin: 1, imageZoomMax: 5 }).Render() -
- -{% endhighlight %} -{% endtabs %} - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
- - - -
`, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - public pageOrganizerSettings = { canDelete: true, canInsert: true, canRotate: true, canCopy: true, canRearrange: true, imageZoom: 1, showImageZoomingSlider: true, imageZoomMin: 1, imageZoomMax: 5 }; - ngOnInit(): void { - } -} - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - - import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
- - - -
`, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://services.syncfusion.com/angular/production/api/pdfviewer'; - public pageOrganizerSettings = { canDelete: true, canInsert: true, canRotate: true, canCopy: true, canRearrange: true, imageZoom: 1, showImageZoomingSlider: true, imageZoomMin: 1, imageZoomMax: 5 }; - ngOnInit(): void { - } -} -{% endhighlight %} -{% endtabs %} - -**openPageOrganizer:** This API opens the page organizer dialog within the PDF Viewer, providing access to manage PDF pages. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -**closePageOrganizer:** This API closes the currently open page organizer dialog within the PDF Viewer, if it is present. It allows users to dismiss the dialog when done with page organization tasks. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -## Keyboard shortcuts - -The following keyboard shortcuts are available at the organize pages dialog. - -* **Ctrl+Z** : Undo the last action performed. -* **Ctrl+Y** : Redo the action that was undone -* **Ctrl+Scroll** : Zoom in and zoom out page thumbnails for better visibility. - -![Alt text](./images/undo-redo.png) - -#### Conclusion - -With the Organize Pages feature in the PDF Viewer, managing your PDF documents has never been easier. Whether you are adding new content, adjusting page orientation, moving the pages, duplicating the pages, or removing unnecessary pages, this feature provides the tools you need to streamline your document management workflow. Explore these capabilities today and take control of your PDF documents with ease! - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to/Organize%20pdf/PDFViewerSample) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/print.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/print.md deleted file mode 100644 index b4407dd949..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/print.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -layout: post -title: Print in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Print in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Print -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Print in ASP.NET MVC PDFViewer Control - -The PDF Viewer supports printing the loaded PDF file. You can enable/disable the print using the following code snippet. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnablePrint(true).DocumentLoad("print").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnablePrint(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -``` -{% endhighlight %} -{% endtabs %} - -![Alt text](images/print.png) - -## Customization of Print Quality using printScaleFactor API. - -The PDF Viewer allows you to adjust the print quality using the [PrintScaleFactor](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_PrintScaleFactor) API. The quality of the print improves as the print quality value increases from 0.5 to 5. - -When the value is less than 0.5, the PDF is printed at a standard quality. When the value exceeds 5, the PDF is still printed at the standard quality. In standard quality, printScaleFactor value is set to 1 as default value. -The effective range for print quality is between 0.5 and 5. Higher values within this range will result in better print quality, but also increase the print time. - -By default, the printScaleFactor is set to 1. - -* **The following code snippet demonstrates how to customize print quality using the PrintScaleFactor API in the PDF Viewer.** - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnablePrint(true).DocumentLoad("print").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render().PrintScaleFactor(0.5) -
- - -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnablePrint(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render().PrintScaleFactor(0.5) -
- - -``` -{% endhighlight %} -{% endtabs %} -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-amazon-s3.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-amazon-s3.md deleted file mode 100644 index 50637f5b07..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-amazon-s3.md +++ /dev/null @@ -1,208 +0,0 @@ ---- -layout: post -title: AWS S3 in ##Platform_Name## Syncfusion PDF Viewer Component -description: Learn here all about how to Save PDF files from AWS S3 in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF file to AWS S3 - -PDF Viewer allows to save PDF file to AWS S3 using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to save PDF to AWS S3. - -## Using Standalone PDF Viewer - -To save a PDF file to AWS S3 bucket, you can follow the steps below - -**Step 1:** Create AWS S3 account - - Set up an AWS S3 account by following the instructions on the official AWS site: [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). Create an S3 bucket and generate access keys while ensuring secure storage of credentials. - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `~/Views/Shared/_Layout.cshtml` File in the Project - -1. Add the required scripts using CDN inside the `` of `~/Views/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - -{% endhighlight %} -{% endtabs %} - -**Step 4:** Modify the `~/Views/Home/Index.cshtml` File in the Project - -1. Configures AWS SDK with the region, access key, and secret access key. This configuration allows the application to interact with AWS services like S3. - -N> Replace **Your Region** with the actual Region of your AWS S3 account and **Your Access Key** with the actual Access Key of your AWS S3 account and **Your Security Access Key** with the actual Security Access Key of your AWS S3 account. - -```csharp -AWS.config.update({ - region: '**Your Region**', // Update this your region - accessKeyId: '*Your Access Key*', // Update this with your access key id - secretAccessKey: '*Your Security Access Key*', // Update this with your secret access key -}); -``` - -2. Configure a custom toolbar item for the download function to save a PDF file in Azure Blob Storage. - -```csharp -
-
- @Html.EJS().PdfViewer("pdfviewer").ResourceUrl("https://cdn.syncfusion.com/ej2/24.1.41/dist/ej2-pdfviewer-lib").Created("loadDocument").ToolbarClick("toolbarClick").Render() -
-
- - -``` - -3. Retrieve the PDF viewer instance and save the current PDF as a Blob. Then, read the Blob using a FileReader to convert it into an ArrayBuffer, and upload the ArrayBuffer to AWS S3 using the putObject method of the S3 instance. - -N> Replace **Your Bucket Name** with the actual Bucket name of your AWS S3 account and **Your Key** with the actual File Key of your AWS S3 account. - -```csharp -function saveDocument() { - const s3 = new AWS.S3(); - var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0]; - pdfViewer.saveAsBlob().then(function (value) { - var reader = new FileReader(); - reader.onload = () => { - const uint8Array = new Uint8Array(reader.result); - const putObjectParams = { - Bucket: '**Your Bucket Name**', - Key: '**Your Key**', - Body: uint8Array, - ContentType: 'application/pdf', - }; - s3.putObject(putObjectParams, (err, data) => { - if (err) { - console.error('Error uploading document:', err); - } else { - console.log('Document uploaded successfully:', data); - } - }); - }; - reader.readAsArrayBuffer(value); - }); -} -``` - -N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). - -## Using Server-Backed PDF Viewer - -To save a PDF file to AWS S3 bucket, you can follow the steps below - -**Step 1:** Create AWS S3 account - - Set up an AWS S3 account by following the instructions on the official AWS site: [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). Create an S3 bucket and generate access keys while ensuring secure storage of credentials. - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Amazon; -using Amazon.S3; -using Amazon.S3.Model -``` - -3. Modify the `Download()` method to save the downloaded PDF files to AWS S3 container - -```csharp - private readonly string _accessKey = "Your Access Key from AWS S35"; - private readonly string _secretKey = "Your Secret Key from AWS S3"; - private readonly string _bucketName = "Your Bucket name from AWS S3"; - -[System.Web.Mvc.HttpPost] -public ActionResult Download(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonData); - RegionEndpoint bucketRegion = RegionEndpoint.USEast1; - - // Configure the AWS SDK with your access credentials and other settings - var s3Client = new AmazonS3Client(_accessKey, _secretKey, bucketRegion); - string bucketName = _bucketName; - string documentName = jsonData["documentId"]; - string result = Path.GetFileNameWithoutExtension(documentName); - byte[] bytes = Convert.FromBase64String(documentBase.Split(',')[1]); - using (MemoryStream stream = new MemoryStream(bytes)) - { - var request = new PutObjectRequest - { - BucketName = bucketName, - Key = result + "_downloaded.pdf", - InputStream = stream, - }; - // Upload the PDF document to AWS S3 - var response = s3Client.PutObjectAsync(request).Result; - } - return Content(documentBase); -} - -``` - -N> Replace **Your Access Key from AWS S3**, **Your Secret Key from AWS S3**, and **Your Bucket name from AWS S3** with your actual AWS access key, secret key and bucket name - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from AWS S3. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").Render() -
-
- -``` - -N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Server-Backend) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-azure-active-directory.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-azure-active-directory.md deleted file mode 100644 index adf7201391..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-azure-active-directory.md +++ /dev/null @@ -1,210 +0,0 @@ ---- -layout: post -title: Save PDF To AAD in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about How to Save Pdf To AAD in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Save PDF To AAD -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF To Azure Active Directory in Viewer - -### **Overview** - -The Syncfusion PDF Viewer allows you to load and save PDF files directly from Azure Active Directory (AAD). Below are the steps to securely load and store PDF documents from and to AAD using the PDF Viewer. - -### **Steps to Open the PDF File from Azure Active Directory** - ---- - -### **Step 1: Register an Application in Azure Active Directory (AAD)** - -1. **Go to the Azure Portal**: - - Navigate to [Azure Portal](https://portal.azure.com). - -2. **Register your Application**: - - In the Azure portal, go to **Azure Active Directory** > **App registrations** > **New registration**. - - Register your application and note down the **Application (client) ID** and **Directory (tenant) ID**. - - ![app-registration](../../images/app-registration.png) - -3. **Create a Client Secret**: - - In the registered application, go to **Certificates & secrets**. - - Click **New client secret**. - - Provide a description and set an expiration period. - - Click **Add**. - - Copy the client secret value immediately, as it will be hidden later. Store it securely. - - ![client-secret](../../images/client-secret.png) - ---- - -### **Step 2: Create the Azure Storage Account** - -1. **Create a Storage Account**: - - In the Azure portal, use the search bar to search for **Storage accounts**. - - Create a new storage account by filling in the required details (e.g., name, location, resource group, etc.). - - ![storage-account](../../images/storage-account.png) - ---- - -### **Step 3: Assign Role to the Application** - -1. **Go to your Storage Account**: - - Navigate to **Access control (IAM)** > **Add role assignment** in your Azure Storage Account. - -2. **Assign Role**: - - Assign the **Storage Blob Data Contributor** role to your registered application. - - In the **Assign access to** dropdown, select **User, group, or service principal**. - - Click on **Select members** and search for your registered application by name or client ID. - - Select your application and click **Select**. - - Click **Review + assign** to finalize the role assignment. - - ![add-role](../../images/add-role.png) ---- - -### **Step 4: Upload the PDF Document to the Azure Storage Account** - -1. **Navigate to Data Storage**: - - In the Azure portal, go to **Data storage** > **Containers**. - -2. **Upload the PDF File**: - - Create a new container and upload the PDF document you want to access in the PDF Viewer. - - ![upload-pdf](../../images/upload-pdf.png) ---- - -### **Step 5: ASP.NET MVC PDF Viewer Control Configuration** -1. Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample. - -2. Add the following code snippet in `HomeController.cs`. - -{% tabs %} -{% highlight c# tabtitle="~/HomeController.cs" %} - -using Azure.Identity; -using Azure.Storage.Blobs; - -string tenantId = "YOUR_TENANT_ID"; -string clientId = "YOUR_CLIENT_ID"; -string clientSecret = "YOUR_CLIENT_SECRET"; -string blobServiceEndpoint = "https://your-storage-account.blob.core.windows.net"; -string containerName = "your-container-name"; - -public async Task LoadFromAAD(string fileName) -{ - var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret); - var blobServiceClient = new BlobServiceClient(new Uri(blobServiceEndpoint), clientSecretCredential); - var containerClient = blobServiceClient.GetBlobContainerClient(containerName); - var blobClient = containerClient.GetBlobClient(fileName); - - // Download the PDF file to a local stream - MemoryStream pdfStream = new MemoryStream(); - await blobClient.DownloadToAsync(pdfStream); - var base64 = Convert.ToBase64String(pdfStream.ToArray()); - return Content("data:application/pdf;base64," + base64); -} - - -public async Task SaveToAAD(jsonObjects responseData) -{ - var jsonObject = JsonConverterstring(responseData); - PdfRenderer pdfviewer = new PdfRenderer(); - var fileName = jsonObject.ContainsKey("documentId") ? jsonObject["documentId"] : "Test.pdf"; - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - string convertedBase = documentBase.Substring(documentBase.LastIndexOf(',') + 1); - // Decode the Base64 string to a byte array - byte[] byteArray = Convert.FromBase64String(convertedBase); - // Create a MemoryStream from the byte array - MemoryStream stream = new MemoryStream(byteArray); - // Create a new BlobServiceClient using the DefaultAzureCredential - var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret); - var blobServiceClient = new BlobServiceClient(new Uri(blobServiceEndpoint), clientSecretCredential); - // Get a reference to the container - var containerClient = blobServiceClient.GetBlobContainerClient(containerName); - // Get a reference to the blob - var blobClient = containerClient.GetBlobClient(fileName); - //FileStream uploadFileStream = new FileStream(); - await blobClient.UploadAsync(stream, true); - stream.Close(); - return Content(string.Empty); -} - -{% endhighlight %} -{% endtabs %} - -3. Configure Server-Side Code: - - Open the server-side application (e.g., ASP.NET Core) and configure the following details in the `PdfViewerController` file: - - `tenantId` (your Azure AD tenant ID), - - `clientId` (your registered application client ID), - - `clientSecret` (your registered application client secret), - - `blobServiceEndpoint` (your storage account blob service URL), - - `containerName` (your container name in Azure Blob Storage). - -4. Add the following code snippet in `Index.cshtml`. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml" %} - -@{ - ViewBag.Title = "Home Page"; -} - -
- -
- - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render() -
-
- - - -{% endhighlight %} -{% endtabs %} - -5. Run the Application - - Build and run your MVC application. The PDF Viewer will be displayed with Load from AAD and Save to AAD buttons. - -6. Load PDF from AAD - - Click the Load from AAD button. - - The server fetches the PDF from Azure Blob Storage and loads it into the Syncfusion PDF Viewer. - -7. Save PDF to AAD - - Click the Save to AAD button. - - The server uploads the modified PDF back to Azure Blob Storage. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aad). \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-azure-blob-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-azure-blob-storage.md deleted file mode 100644 index 16efa333eb..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-azure-blob-storage.md +++ /dev/null @@ -1,255 +0,0 @@ ---- -layout: post -title: Save PDF to Azure Blob Storage in ##Platform_Name## PdfViewer | Syncfusion -description: Save PDF files to Azure Blob Storage in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF file to Azure Blob Storage - -PDF Viewer allows to save PDF file to Azure Blob Storage using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to save PDF to Azure Blob Storage. - -## Using Standalone PDF Viewer - -To save a PDF file to Azure Blob Storage, you can follow the steps below. - -**Step 1:** Create the Azure Blob Storage account - -Log in to the Azure Portal. Create a new Storage Account with preferred settings. Note access keys during the setup. Within the Storage Account, create a Blob Container following the steps in this [link](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal). - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Azure.Storage.Blobs; -``` - -2. Add `Upload()` method to save the downloaded PDF files to Azure Blob Storage container. - -```csharp -private readonly string ConnectionString = "Your Connection string from Azure"; -private readonly string blobContainerName = "Your container name in Azure"; - -[HttpPost] -public async Task Upload(UploadFileRequest request) -{ - if (request == null || string.IsNullOrEmpty(request.FileName) || string.IsNullOrEmpty(request.FileContent)) - { - return Json(new { error = "Invalid file or file name." }); - } - - try - { - byte[] fileBytes = Convert.FromBase64String(request.FileContent); - BlobServiceClient blobServiceClient = new BlobServiceClient(ConnectionString); - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(blobContainerName); - BlobClient blobClient = containerClient.GetBlobClient(request.FileName); - - using (var stream = new MemoryStream(fileBytes)) - { - await blobClient.UploadAsync(stream, true); - } - - var fileUrl = blobClient.Uri.ToString(); - return Json(new { fileUrl }); - } - catch (Exception ex) - { - return Json(new { error = ex.Message }); - } -} - -public class UploadFileRequest -{ - public string FileName { get; set; } - public string FileContent { get; set; } -} -``` - -N> Replace **Your Connection string from Azure** with the actual connection string for your Azure Blob Storage account and **Your container name in Azure** with the actual container name. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -1. Configure a custom toolbar item for the download function to save a PDF file in Azure Blob Storage. - -```csharp -
-
- @Html.EJS().PdfViewer("pdfviewer").ResourceUrl("https://cdn.syncfusion.com/ej2/24.1.41/dist/ej2-pdfviewer-lib").Created("loadDocument").ToolbarClick("toolbarClick").Render() -
-
- - -``` - -2. Retrieve the PDF viewer instance and save the current PDF as a Blob. Next, read the Blob as an ArrayBuffer and convert it to a Base64 string using arrayBufferToBase64 method. Finally, upload the Base64 string to Azure Blob Storage using the `HomeController`. - -```csharp -function saveDocument() { - var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0]; - var fileName = pdfViewer.fileName; - pdfViewer.saveAsBlob().then(function (value) { - var reader = new FileReader(); - reader.onload = async () => { - if (reader.result) { - const arrayBuffer = reader.result; - var base64String = arrayBufferToBase64(arrayBuffer); - var data = { - fileName: fileName, - fileContent: base64String - }; - fetch('/Home/Upload', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(data) - }).then(response => response.json()) - .then(data => { - if (data.fileUrl) { - alert('File uploaded successfully! Blob URI: ' + data.uri); - } else { - alert('Error occurred..' + data.error); - } - }).catch(error => { - alert('Error occurred..' + data.error); - }); - } - }; - reader.readAsArrayBuffer(value); - }); -} - -function arrayBufferToBase64(buffer) { - var binary = ''; - var bytes = new Uint8Array(buffer); - var len = bytes.byteLength; - for (var i = 0; i < len; i++) { - binary += String.fromCharCode(bytes[i]); - } - return window.btoa(binary); -} -``` - -N> The **Azure.Storage.Blobs** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). - -## Using Server-Backed PDF Viewer - -To save a PDF file to Azure Blob Storage, you can follow the steps below - -**Step 1:** Create the Azure Blob Storage account - -Log in to the Azure Portal. Create a new Storage Account with preferred settings. Note access keys during the setup. Within the Storage Account, create a Blob Container following the steps in this [link](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal). - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; -``` - -3. Modify the `Download()` method to save the downloaded PDF files to Azure Blob Storage container - -```csharp - -private readonly string _connectionString = "Your Connection string from Azure"; -private readonly string _containerName = "Your container name in Azure"; - -public ActionResult Download(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - - string documentBase = pdfviewer.GetDocumentAsBase64(jsonData); - - string document = jsonData["documentId"]; - - // Create a BlobServiceClient object by passing the connection string. - BlobServiceClient blobServiceClient = new BlobServiceClient(_connectionString); - - // Get a reference to the container - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(_containerName); - - string result = Path.GetFileNameWithoutExtension(document); - // Get a reference to the blob - BlobClient blobClient = containerClient.GetBlobClient(result + "_download.pdf"); - - // Convert the document base64 string to bytes - byte[] bytes = Convert.FromBase64String(documentBase.Split(',')[1]); - - - // Upload the document to Azure Blob Storage - using (MemoryStream stream = new MemoryStream(bytes)) - { - blobClient.Upload(stream, true); - } - return Content(documentBase); -} - - -``` - -N> Replace **Your Connection string from Azure** with the actual connection string for your Azure Blob Storage account and **Your container name in Azure** with the actual container name - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Azure Blob Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").Render() -
-
- -``` - -N> The **Azure.Storage.Blobs** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Server-Backend). \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-box-cloud-file-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-box-cloud-file-storage.md deleted file mode 100644 index 75f24568ff..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-box-cloud-file-storage.md +++ /dev/null @@ -1,98 +0,0 @@ ---- -layout: post -title: Box cloud file storage in ##Platform_Name## PDF Viewer Component -description: Save PDF files to Box cloud file storage in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF file to Box cloud file storage - -To save a PDF file to Box cloud file storage, you can follow the steps below - -**Step 1** Set up a Box developer account and create a Box application - -To access Box storage programmatically, you'll need a developer account with Box. Go to the [Box Developer Console](https://developer.box.com/), sign in or create a new account, and then create a new Box application. This application will provide you with the necessary credentials Client ID and Client Secret to authenticate and access Box APIs. Before accessing files, you need to authenticate your application to access your Box account. Box API supports `OAuth 2.0 authentication` for this purpose. - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using Box.V2; -using Box.V2.Auth; -using Box.V2.Config; -using Box.V2.Models; -``` - -3. Modify the `Download()` method to save the downloaded PDF files to Box cloud file storage folder. - -```csharp - -private readonly string _clientId = "Your_Box_Storage_ClientID"; -private readonly string _clientSecret = "Your_Box_Storage_ClientSecret"; -private readonly string _accessToken = "Your_Box_Storage_Access_Token"; -private readonly string _folderId = "Your_Folder_ID"; - -public async Task Download(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonData); - byte[] documentBytes = Convert.FromBase64String(documentBase.Split(',')[1]); - - string documentId = jsonData["documentId"]; - string result = Path.GetFileNameWithoutExtension(documentId); - string fileName = result + "_downloaded.pdf"; - - // Initialize the Box API client with your authentication credentials - var auth = new OAuthSession(_accessToken, "YOUR_REFRESH_TOKEN", 3600, "bearer"); - var config = new BoxConfigBuilder(_clientId, _clientSecret, new Uri("http://boxsdk")).Build(); - var client = new BoxClient(config, auth); - - var fileRequest = new BoxFileRequest - { - Name = fileName, - Parent = new BoxFolderRequest { Id = _folderId }, - }; - - using (var stream = new MemoryStream(documentBytes)) - { - var boxFile = await client.FilesManager.UploadAsync(fileRequest, stream); - } - return Content(documentBase); -} - -``` - -N> replace **Your_Box_Storage_Access_Token** with your actual box access token, and **Your_Folder_ID** with the ID of the folder in your box storage where you want to perform specific operations. Remember to use your valid box API credentials, as **Your_Box_Storage_ClientID** and **Your_Box_Storage_ClientSecret"** are placeholders for your application's API key and secret. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Box cloud file storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").Render() -
-
- -``` - -N> The **Box.V2.Core** NuGet package must be installed in your application to use the previous code example. - -N> Replace `PDF_Succinctly.pdf` with the actual document name that you want to load from Box cloud file storage. Make sure to pass the document name from the box folder to the `documentPath` property of the PDF viewer component - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-box-cloud-file-storage) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-google-cloud-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-google-cloud-storage.md deleted file mode 100644 index 9077eef9de..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-google-cloud-storage.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -layout: post -title: Google Cloud Storage in ##Platform_Name## PDF Viewer Component -description: Save PDF files to Google Cloud Storage in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF file to Google Cloud Storage - -To save a PDF file to Google Cloud Storage, you can follow the steps below - -**Step 1** Create a Service Account - -Open the Google Cloud Console. Navigate to `IAM & Admin` > `Service accounts`. Click `Create Service Account`.` Enter a name, assign roles (e.g., Storage Object Admin), and create a key in JSON format. Download the key file securely. Utilize the downloaded key file in your applications or services for authentication and access to the Google Cloud Storage bucket. For additional details, refer to the [official documentation](https://cloud.google.com/iam/docs/service-accounts-create). - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Google.Cloud.Storage.V1; -using Google.Apis.Auth.OAuth2; - -``` -2. Add the following private fields and constructor parameters to the `HomeController.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp - - // The key file is used to authenticate with Google Cloud Storage. - private string keyFilePath = @"path/to/service-account-key.json"; - private readonly string _bucketName = "Your Bucket name from Google Cloud Storage"; - private readonly StorageClient _storageClient; - - public HomeController() - { - // Load the service account credentials from the key file. - var credentials = GoogleCredential.FromFile(keyFilePath); - - // Create a storage client with Application Default Credentials - _storageClient = StorageClient.Create(credentials); - } - -``` - -3. Modify the `Download()` method to save the downloaded PDF files to Google Cloud Storage bucket - -```csharp - - public ActionResult Download(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonData); - string bucketName = _bucketName; - string fileName = jsonData["documentId"]; - - // Convert the base64 string back to bytes - string result = Path.GetFileNameWithoutExtension(fileName); - byte[] documentBytes = Convert.FromBase64String(documentBase.Split(',')[1]); - - // Upload the document to Google Cloud Storage - using (var memoryStream = new MemoryStream(documentBytes)) - { - _storageClient.UploadObject(bucketName, result + "_downloaded.pdf", null, memoryStream); - } - return Content(documentBase); - } -``` - -N> Replace **Your Bucket name from Google Cloud Storage** with the actual name of your Google Cloud Storage bucket - -N> Replace **path/to/service-account-key.json** with the actual file path to your service account key JSON file. Make sure to provide the correct path and filename. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Google Cloud Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").Render() -
-
- -``` - -N> The **Google.Cloud.Storage.V1** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-google-cloud-storage) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-google-drive.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-google-drive.md deleted file mode 100644 index e70c156369..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/save-pdf-file/to-google-drive.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -layout: post -title: Google Drive in ##Platform_Name## PDF Viewer Component -description: Save PDF files to Google Drive in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF file to Google Drive - -To save a PDF file to Google Drive, you can follow the steps below - -**Step 1** Set up Google Drive API - -You must set up a project in the Google Developers Console and enable the Google Drive API. Obtain the necessary credentials to access the API. For more information, view the official [link](https://developers.google.com/drive/api/guides/enable-sdk). - -**Step 2:** Create PDF Viewer Sample in ASP.NET MVC - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started-with-server-backed#integrate-pdf-viewer-into-an-aspnet-mvc-application) to create a simple PDF Viewer sample in ASP.NET MVC. - -**Step 3:** Modify the `HomeController.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Google.Apis.Drive.v3; -using Google.Apis.Auth.OAuth2; -using Google.Apis.Services; -using Google.Apis.Util.Store; -``` - -3. Modify the `Download()` method to save the downloaded PDF files to Google Drive bucket - -```csharp - - // Specify the path to the credentials file - private string credentialsPath = "Your Path to the OAuth 2.0 Client IDs json file"; - // Specify the folder ID where you want to upload the PDF on Google Drive - private readonly string folderId = "Your Google Drive Folder ID"; - private readonly string ApplicationName = "Your Application Name"; - private readonly string tokenjson = "Path to create token.json file"; - - public async Task Download(jsonObjects jsonObject) - { - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string[] Scopes = { DriveService.Scope.DriveFile }; - - // Download the PDF document - string documentBase = pdfviewer.GetDocumentAsBase64(jsonData); - byte[] documentBytes = Convert.FromBase64String(documentBase.Split(',')[1]); - string documentId = jsonData["documentId"]; - string result = Path.GetFileNameWithoutExtension(documentId); - string fileName = result + "_downloaded.pdf"; - - UserCredential credential; - - using (var streammen = new FileStream(credentialsPath, FileMode.Open, FileAccess.Read)) - { - // The file token.json stores the user's access and refresh tokens and is created - // automatically when the authorization flow completes for the first time. - string tokenPath = tokenjson; - credential = await GoogleWebAuthorizationBroker.AuthorizeAsync( - GoogleClientSecrets.Load(streammen).Secrets, - Scopes, - "user", - CancellationToken.None, - new FileDataStore(tokenPath, true)); - } - - // Create the Drive API service - var service = new DriveService(new BaseClientService.Initializer() - { - HttpClientInitializer = credential, - ApplicationName = ApplicationName, - }); - - // Create file metadata - var fileMetadata = new Google.Apis.Drive.v3.Data.File() - { - Name = fileName, - Parents = new List { folderId } - }; - - FilesResource.CreateMediaUpload request; - - // Upload the file to Google Drive - using (var stream = new MemoryStream(documentBytes)) - { - request = service.Files.Create(fileMetadata, stream, "application/pdf"); - request.Fields = "id"; - var uploadedFile = await request.UploadAsync(); - } - - return Content(documentBase); - } - -``` - -N> Replace **Your Google Drive Folder ID**, **Your Application name**, **tokenPath** and **Your Path to the OAuth 2.0 Client IDs json file** with your actual Google drive folder ID , Your name for your application, Path to the token file to generate and the path for the JSON file. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET MVC PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Google Drive. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@{ - ViewBag.Title = "Home Page"; -} - -
-
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").Render() -
-
- -``` - -N> The **Google.Apis.Drive.v3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-google-drive) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/server-actions.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/server-actions.md deleted file mode 100644 index 16ab8da9c4..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/server-actions.md +++ /dev/null @@ -1,427 +0,0 @@ ---- -layout: post -title: Server Actions in EJ2 ASP.NET MVC PDF Viewer | Syncfusion -description: Learn here all about Server Actions in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Server Actions -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Server Actions with ASP.NET MVC PDFViewer Control - -Syncfusion® PDF Viewer control is client-server oriented. It processes the PDF document on the server-side and sends the processed PDF data to the client to render the PDF document and for further operations in the PDF Viewer. - -The server actions or server methods in the MVC PDF Viewer controller are: - -* Load -* RenderPdfPages -* RenderThumbnailImages -* Bookmarks -* RenderAnnotationComments -* Unload -* ExportAnnotations -* ImportAnnotations -* ImportFormFields -* ExportFormFields -* Download -* PrintImages - -## Load action - -N> public ActionResult Load(jsonObjects jsonObject) - -The [Load]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_Load_System_String_) action will be triggered initially on loading a PDF file. Syncfusion® PDF Viewer control will store the document in the cache based on the hashid during the initial loading of the pdf file. Initially, the request will be sent for 100 pages only and another request will be sent for the remaining pages. So the Load action will get triggered twice when loading a PDF file with pages more than 100, which is called virtual loading. - -This action on its first trigger calls the GetDocumentPath method in the PdfViewerController.cs with which the path of the document is determined. The PDF file to be loaded must be located in the folder structure as specified in the GetDocumentPath method. - -The Load action calls the [Load]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_Load_System_IO_Stream_System_Collections_Generic_Dictionary_System_String_System_String__) method to load the PDF file in the PDF Viewer. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult Load(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - MemoryStream stream = new MemoryStream(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = new object(); - if (jsonObject != null && jsonData.ContainsKey("document")) - { - if (bool.Parse(jsonData["isFileName"])) - { - string documentPath = GetDocumentPath(jsonData["document"]); - - if (!string.IsNullOrEmpty(documentPath)) - { - byte[] bytes = System.IO.File.ReadAllBytes(documentPath); - stream = new MemoryStream(bytes); - - } - else - { - string fileName = jsonData["document"].Split(new string[] { "://" }, StringSplitOptions.None)[0]; - if (fileName == "http" || fileName == "https") - { - var WebClient = new WebClient(); - byte[] pdfDoc = WebClient.DownloadData(jsonData["document"]); - stream = new MemoryStream(pdfDoc); - } - else - { - return this.Content(jsonData["document"] + " is not found"); - } - - } - } - else - { - byte[] bytes = Convert.FromBase64String(jsonData["document"]); - stream = new MemoryStream(bytes); - - } - } - jsonResult = pdfviewer.Load(stream, jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## RenderPdfPages - -N> public ActionResult RenderPdfPages(jsonObjects jsonObject) - -Whenever a new page is loaded, [RenderPdfPages]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_RenderPages_System_String_) action will be called. When a PDF file is loaded with PDF Viewer, only two pages will be loaded initially by hitting this action for loading each page. Further pages will be loaded on demand by hitting this action. - -The RenderPdfPages action calls the [GetPage](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetPage_System_Collections_Generic_Dictionary_System_String_System_String__) method to render each PDF pages. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult RenderPdfPages(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.GetPage(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## RenderThumbnailImages action - -N> public ActionResult RenderThumbnailImages(jsonObjects jsonObject) - -The [RenderThumbnailImages]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_RenderThumbnail_System_String_) action will be triggered initially on loading a PDF file. It renders the thumbnails images of all the pages in the PDF file. When a thumbnail image is clicked, the RenderPdfPages action will be triggered to load the selected page. - -This action calls the [GetThumbnailImages]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetThumbnailImages_System_Collections_Generic_Dictionary_System_String_System_String__) method. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult RenderThumbnailImages(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object result = pdfviewer.GetThumbnailImages(jsonData); - return Content(JsonConvert.SerializeObject(result)); -} -``` - -## Bookmarks - -N> public ActionResult Bookmarks(jsonObjects jsonObject) - -The Bookmarks action will be triggered initially on loading a PDF file. All the headings in the PDF file will get added to the Bookmarks collection in the bookmarks panel with the help of this action. When a bookmark is selected, the page containing the selected heading will be rendered or opened. - -This action calls the [GetBookmarks]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetBookmarks_System_Collections_Generic_Dictionary_System_String_System_String__) method. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult Bookmarks(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.GetBookmarks(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## RenderAnnotationComments - -N> public ActionResult RenderAnnotationComments(jsonObjects jsonObject) - -The [RenderAnnotationComments]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_RenderComments_System_String_) action will be triggered initially on loading a PDF file. - -It calls the [GetAnnotationComments]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetAnnotationComments_System_Collections_Generic_Dictionary_System_String_System_String__) method to retrieve the annotation comments in the PDF file. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult RenderAnnotationComments(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.GetAnnotationComments(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## Unload action - -N> public ActionResult Unload(jsonObjects jsonObject) - -The [Unload]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_Unload_System_String_) action will be triggered on unloading a PDF file by closing or refreshing the browser. - -This action calls the [ClearCache]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_ClearCache_System_Collections_Generic_Dictionary_System_String_System_String__) method to clear the cache objects while closing the PDF Viewer. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult Unload(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - pdfviewer.ClearCache(jsonData); - return this.Content("Document cache is cleared"); -} -``` - -## ExportAnnotations action - -N> public ActionResult ExportAnnotations(jsonObjects jsonObject) - -The [ExportAnnotations]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_ExportAnnotations_System_String_) action will be triggered by clicking either the “Export annotation to JSON file” option or the “Export annotation to XFDF file” option in the annotation toolbar. - -This action calls the [ExportAnnotation]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_ExportAnnotation_System_Collections_Generic_Dictionary_System_String_System_String__) method to export the annotations in the PDF Viewer to a JSON file or an XFDF file. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult ExportAnnotations(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string jsonResult = pdfviewer.ExportAnnotation(jsonData); - return Content((jsonResult)); -} -``` - -## ImportAnnotations - -N> public ActionResult ImportAnnotations(jsonObjects jsonObject) - -The [ImportAnnotations]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_ImportAnnotations_System_String_) action will be triggered by clicking the “Import annotation from XFDF file” option in the annotation toolbar. - -This action calls the [ImportAnnotation]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_ImportAnnotation_System_Collections_Generic_Dictionary_System_String_System_String__) method to import the annotations from an XFDF file. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult ImportAnnotations(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - string jsonResult = string.Empty; - var jsonData = JsonConverter(jsonObject); - if (jsonObject != null && jsonData.ContainsKey("fileName")) - { - string documentPath = GetDocumentPath(jsonData["fileName"]); - if (!string.IsNullOrEmpty(documentPath)) - { - jsonResult = System.IO.File.ReadAllText(documentPath); - } - else - { - return this.Content(jsonData["document"] + " is not found"); - } - } - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## ImportFormFields action - -N> public ActionResult ImportFormFields(jsonObjects jsonObject) - -The [ImportFormFields]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_ImportFormFields_System_String_) action will be triggered by calling it from the UI code. - -This action calls the [ImportFormFields]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_ImportFormFields_System_Collections_Generic_Dictionary_System_String_System_String__) method to import the form fields into the PDF Viewer from a JSON object or file. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult ImportFormFields(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object jsonResult = pdfviewer.ImportFormFields(jsonData); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## ExportFormFields action - -N> public ActionResult ExportFormFields(jsonObjects jsonObject) - -The [ExportFormFields]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_ExportFormFields_System_String_) action will be triggered by clicking the Submit Form option in the PDF Viewer toolbar. The Submit Form option is enabled only when there are form fields. It exports the form fields into a JSON file. - -This action calls the [ExportFormFields]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_ExportFormFields_System_Collections_Generic_Dictionary_System_String_System_String__) method to export the form fields into a JSON string. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult ExportFormFields(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string jsonResult = pdfviewer.ExportFormFields(jsonData); - return Content(jsonResult); -} -``` - -## Download action - -N> public ActionResult Download(jsonObjects jsonObject) - -The [Download]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_Download_System_String_) action will be triggered by clicking the Download option in the PDF Viewer toolbar to download the PDF file. - -This action calls the [GetDocumentAsBase64]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetDocumentAsBase64_System_Collections_Generic_Dictionary_System_String_System_String__) method to get the PDF file as a base64 string. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult Download(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonData); - return Content(documentBase); -} -``` - -## PrintImages - -N> public ActionResult PrintImages(jsonObjects jsonObject) - -The [PrintImages]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_Print_System_String_) action will be triggered by clicking the Print option in the PDF Viewer toolbar. - -It calls the [GetPrintImage]( https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetPrintImage_System_Collections_Generic_Dictionary_System_String_System_String__) method multiple times to get each page in the PDF file as images to print the entire file. - -```cs -[System.Web.Mvc.HttpPost] -public ActionResult PrintImages(jsonObjects jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(); - var jsonData = JsonConverter(jsonObject); - object pageImage = pdfviewer.GetPrintImage(jsonData); - return Content(JsonConvert.SerializeObject(pageImage)); -} -``` - -## Other methods - -### GetDocumentPath - -N> private string GetDocumentPath(string document) - -The GetDocumentPath method will be called inside the Load method to get the path of the document to be loaded. - -```cs -private string GetDocumentPath(string document) -{ - string documentPath = string.Empty; - if (!System.IO.File.Exists(document)) - { - var path = HttpContext.Request.PhysicalApplicationPath; - if (System.IO.File.Exists(path + "/App_Data/" + document)) - documentPath = path + "/App_Data/" + document; - } - else - { - documentPath = document; - } - return documentPath; -} -``` - -### JsonConverter method - -N> public Dictionary JsonConverter(jsonObjects results) - -The JsonConverter method will be called by other server action methods to convert the jsonObjects into JSON data of type `Dictionary`. - -```cs -public Dictionary JsonConverter(jsonObjects results) -{ - Dictionary resultObjects = new Dictionary(); - resultObjects = results.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public).ToDictionary(prop => prop.Name, prop => prop.GetValue(results, null)); - var emptyObjects = (from kv in resultObjects - where kv.Value != null - select kv).ToDictionary(kv => kv.Key, kv => kv.Value); - Dictionary jsonResult = emptyObjects.ToDictionary(k => k.Key, k => k.Value.ToString()); - return jsonResult; -} -``` - -### GetPlainText method - -N> private HttpResponseMessage GetPlainText(string pageImage) - -The GetPlainText method will be useful when you want to perform a server action without downloading the action result in the browser. This method just provides the status of the action result as a HttpResponseMessage by preventing the file download. - -```cs -private HttpResponseMessage GetPlainText(string pageImage) -{ - var responseText = new HttpResponseMessage(HttpStatusCode.OK); - responseText.Content = new StringContent(pageImage, System.Text.Encoding.UTF8, "text/plain"); - return responseText; -} -``` - -## jsonObjects class - -The jsonObjects used as the parameter in each method is a class with various properties needed for different features in the PDF Viewer. This class must be defined in the PdfViewerController to perform all the above actions. - -```cs - public class jsonObjects - { - public string document { get; set; } - public string password { get; set; } - public string zoomFactor { get; set; } - public string isFileName { get; set; } - public string xCoordinate { get; set; } - public string yCoordinate { get; set; } - public string pageNumber { get; set; } - public string documentId { get; set; } - public string hashId { get; set; } - public string sizeX { get; set; } - public string sizeY { get; set; } - public string startPage { get; set; } - public string endPage { get; set; } - public string stampAnnotations { get; set; } - public string textMarkupAnnotations { get; set; } - public string stickyNotesAnnotation { get; set; } - public string shapeAnnotations { get; set; } - public string measureShapeAnnotations { get; set; } - public string action { get; set; } - public string pageStartIndex { get; set; } - public string pageEndIndex { get; set; } - public string fileName { get; set; } - public string elementId { get; set; } - public string pdfAnnotation { get; set; } - public string importPageList { get; set; } - public string uniqueId { get; set; } - public string data { get; set; } - public string viewPortWidth { get; set; } - public string viewportHeight { get; set; } - public string tilecount { get; set; } - public string freeTextAnnotation { get; set; } - public string signatureData { get; set; } - public string fieldsData { get; set; } - public string FormDesigner { get; set; } - public string inkSignatureData { get; set; } - public string tileXCount { get; set; } - public string tileYCount { get; set; } - public string digitalSignaturePageList { get; set; } - public string annotationCollection { get; set; } - public string annotationsPageList { get; set; } - public string formFieldsPageList { get; set; } - public string documentLiveCount { get; set; } - public string annotationDataFormat { get; set; } - public bool isCompletePageSizeNotReceived { get; set; } - public bool hideEmptyDigitalSignatureFields { get; set; } - public bool showDigitalSignatureAppearance { get; set; } - public bool digitalSignaturePresent { get; set; } - public bool isAnnotationsExist { get; set; } - public bool isFormFieldAnnotationsExist { get; set; } - } -``` \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/text-markup-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/text-markup-annotation.md deleted file mode 100644 index ffdc7b58ca..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/text-markup-annotation.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: post -title: Text Markup Annotation in ##Platform_Name## Pdfviewer Component -description: Learn here all about Text Markup Annotation in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Text Markup Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -aspmvc/documentation/pdfviewer/annotation/text-markup-annotation/ \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/text-search.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/text-search.md deleted file mode 100644 index 06837e2abe..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/text-search.md +++ /dev/null @@ -1,209 +0,0 @@ ---- -layout: post -title: Text_search in ##Platform_Name## Pdfviewer Component | Syncfusion -description: Learn here all about Text_search in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Text_search -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Text Search in PDF Viewer component - -The Text Search option in PDF Viewer is used to find and highlight the text content from the document. You can enable/disable the text search using the following code snippet. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- @Html.EJS().PdfViewer("pdfviewer").EnableTextSearch(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableTextSearch(true).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-{% endhighlight %} -{% endtabs %} - -![Alt text](./images/search.png) - -## Test search Features - -### Real time search suggestion while typing -Entering text into the search input dynamically displays search suggestions based on the provided input. The suggestions are updated in real-time as text is typed, offering relevant matches from the available content. This feature enhances the search experience by allowing quick access to potential results while typing. - -![Alt text](./images/SingleSearchPopup.png) - -### Selecting Search Suggestions from the Popup -Entering text into the search input triggers a popup displaying relevant suggestions based on the input. Selecting a suggestion from the popup enables direct navigation to its occurrences in the document. - -![Alt text](./images/SearchResultFromPopup.png) - -### Search Text with enabling 'Match Case' checkbox -By enabling the 'Match Case' option and entering text into the search input, only the exact case-sensitive matches in the document are highlighted. This feature allows navigation through each occurrence of the exact text match within the document. - -![Alt text](./images/SearchNavigationMatchCase.png) - -### Search Text without enabling 'Match Case' checkbox -When text is entered into the search input without enabling the 'Match Case' option, all instances of the text, regardless of case, are highlighted in the document. This allows easy navigation through every occurrence of the search term. - -![Alt text](./images/SearchNavigationNoMatchCase.png) - -### Search list of text by enabling 'Match Any Word' checkbox -When the 'Match Any Word' option is enabled, the entered text in the search input is split into individual words based on spaces. As the text is typed, the popup dynamically displays search suggestions for each word in real time, highlighting potential matches within the document. - -![Alt text](./images/MultiSearchPopup.png) - -## Find text method -Searches for the specified text or an array of strings within the document and returns the bounding rectangles for each occurrence. The search can be case-sensitive based on the provided parameters. If a specific page index is provided, it returns the bounding rectangles for these search strings on that page; otherwise, it returns the bounding rectangles for all pages in the document where the strings were found. - -### Find and get the bounds of a text -Searches for the specified text within the document and returns the bounding rectangles of the matched text. The search can be case-sensitive based on the provided parameter. It returns the bounding rectangles for all pages in the document where the text was found. The below code snippet shows how to get the bounds of the given text: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -### Find and get the bounds of a text on the desired page -Searches for the specified text within the document and returns the bounding rectangles of the matched text. The search can be case-sensitive based on the provided parameter. It returns the bounding rectangles for that page in the document where the text was found. The below code snippet shows how to get the bounds of the given text from the desired page: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -### Find and get the bounds of the list of text -Searches for an array of strings within the document and returns the bounding rectangles for each occurrence. The search can be case-sensitive based on the provided parameters. It returns the bounding rectangles for all pages in the document where the strings were found. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -### Find and get the bounds of the list of text on desired page -Searches for an array of strings within the document and returns the bounding rectangles for each occurrence. The search can be case-sensitive based on the provided parameters. It returns the bounding rectangles for these search strings on that particular page where the strings were found. - -{% tabs %} -{% highlight cshtml tabtitle="standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-backed" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/text-selection.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/text-selection.md deleted file mode 100644 index 0774af5696..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/text-selection.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: post -title: Text_selection in ##Platform_Name## Pdfviewer Component -description: Learn here all about Text_selection in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Text_selection -publishingplatform: ##Platform_Name## -documentation: ug ---- - diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/toolbar.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/toolbar.md deleted file mode 100644 index bde04a4aed..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/toolbar.md +++ /dev/null @@ -1,586 +0,0 @@ ---- -layout: post -title: Toolbar in ##Platform_Name## Pdfviewer Component| Syncfusion -description: Learn here all about Toolbar in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Toolbar -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Built-in toolbar in ASP.NET MVC PDFViewer Control - -The PDF Viewer comes with a powerful built-in toolbar to execute important actions such as page navigation,text search,view mode,download print,bookmark and thumbnails. - -The following table shows built-in toolbar items and its actions:- - -| Option | Description | -|---|---| -| OpenOption | This option provides an action to load the PDF documents to the PDF Viewer.| -| PageNavigationTool | This option provides an action to navigate the pages in the PDF Viewer. It contains GoToFirstPage,GoToLastPage,GotoPage,GoToNext, and GoToLast tools.| -| MagnificationTool | This option provides an action to magnify the pages either with predefined or user defined zoom factors in the PDF Viewer. Contains ZoomIn, ZoomOut, Zoom, FitPage and FitWidth tools| -| PanTool |This option provides an action for panning the pages in the PDF Viewer.| -| SelectionTool |This option provides an action to enable/disable the text selection in the PDF Viewer.| -| SearchOption |This option provides an action to search a word in the PDF documents.| -| PrintOption |This option provides an action to print the PDF document being loaded in the PDF Viewer.| -| DownloadOption |This Download option provides an action to download the PDF document that has been loaded in the PDF Viewer.| -| UndoRedoTool | This tool provides options to undo and redo the annotation actions performed in the PDF Viewer.| -| AnnotationEditTool | This tool provides options to enable or disable the edit mode of annotation in the PDF Viewer.| - -## Show/Hide the built-in toolbar - -The PDF Viewer has an option to show or hide the complete built-in toolbar. You can achieve this by using the following two ways., - -* **Show/Hide toolbar using enableToolbar API as in the following code snippet.** - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").EnableToolbar(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -```html -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableToolbar(false).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
-``` -{% endhighlight %} -{% endtabs %} - -* **Show/Hide toolbar using showToolbar as in the following code snippet.** - -```html - - -``` - -## Show/Hide the built-in toolbaritem - -The PDF Viewer has an option to show or hide these grouped items in the built-in toolbar. - -* **Show/Hide toolbaritem using toolbarSettings as in the following code snippet.** - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -```html - -
- @Html.EJS().PdfViewer("pdfviewer").EnableToolbar(true).ToolbarSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings { ShowTooltip = true, ToolbarItems = "OpenOption" }).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -``` - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -```html - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).EnableToolbar(false).ToolbarSettings(new Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings{ ShowTooltip = true, ToolbarItem = "OpenOption" ).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- -``` - -{% endhighlight %} -{% endtabs %} - -## Customize Built-In Toolbar - -PDF Viewer allows you to customize(add, show, hide, enable, and disable) existing items in a toolbar. - -* Add - New items can defined by **CustomToolbarItemModel** and with existing items in [**ToolbarSettings**](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html) property. Newly added item click action can be defined in `toolbarclick`. - -* Show, Hide - Existing items can be shown or hidden using the [`ToolbarSettings`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html) property. Pre-defined toolbar items are available with [`ToolbarItem`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html#Syncfusion_EJ2_PdfViewer_PdfViewerToolbarSettings_ToolbarItems) . - -* Enable, Disable - Toolbar items can be enabled or disable using `enabletoolbaritem`. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@using Syncfusion.EJ2 -@{ - ViewBag.Title = "Home Page"; -} - -
-
-

- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").ResourceUrl("https://cdn.syncfusion.com/ej2/29.1.33/dist/ej2-pdfviewer-lib").ToolbarClick("toolbarClick").Render() -
-
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -@{ - ViewBag.Title = "Home Page"; -} -@using Syncfusion.EJ2.PdfViewer -@using ToolbarCustomization.Controllers -@{ - var toolItem1 = new { id = "submit_form", text = "Submit Form", tooltipText = "Custom toolbar item", align = "Center", cssClass = "custom_button" }; - CustomToolbarItems customToolbarItems = new CustomToolbarItems(); - customToolbarItems.ToolbarItems = new List { toolItem1, "OpenOption", "PageNavigationTool", "MagnificationTool", "PanTool", "SelectionTool", "SearchOption", "PrintOption", "DownloadOption", "UndoRedoTool", "AnnotationEditTool", "FormDesignerEditTool", "CommentTool" }; - PdfViewerToolbarSettings toolbarSettings = new PdfViewerToolbarSettings() - { - ShowTooltip = true, - ToolbarItems = customToolbarItems.ToolbarItems - }; -} -
-
-

- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/form-designer.pdf").ToolbarClick("toolbarClick").Created("onLoadedPage").DocumentLoad("documentLoaded").FormFieldAdd("formFieldAdd").ToolbarSettings(toolbarSettings).Render() -
-
- - - - -{% endhighlight %} -{% endtabs %} - -N> Default value of toolbar items is ['OpenOption', 'PageNavigationTool','MagnificationTool', 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'DownloadOption','UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', 'CommentTool', 'SubmitForm'] - -### Align Property - -The align property is used to specify the alignment of a toolbar item within the toolbar. - -`Left`: Aligns the item to the left side of the toolbar. -`Right`: Aligns the item to the right side of the toolbar. - -### Tooltip Property - -The tooltip property is used to set the tooltip text for a toolbar item. Tooltip provides additional information when a user hovers over the item. - -### CssClass Property - -The cssClass property is used to apply custom CSS classes to a toolbar item. It allows custom styling of the toolbar item. - -### Prefix Property - -The prefix property is used to set the CSS class or icon that should be added as a prefix to the existing content of the toolbar item. - -### ID Property - -The id property within a CustomToolbarItemModel is a compulsory attribute that plays a vital role in toolbar customization. It serves as a unique identifier for each toolbar item, facilitating distinct references and interactions. - -When defining or customizing toolbar items, it is mandatory to assign a specific and descriptive id to each item. -These properties are commonly used when defining custom toolbar items with the `CustomToolbarItemModel`` in the context of Syncfusion® PDF Viewer. When configuring the toolbar using the `ToolbarSettings`` property, you can include these properties to customize the appearance and behavior of each toolbar item. - -N> When customizing toolbar items, you have the flexibility to include either icons or text based on your design preference. - -[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to/Customize%20existing%20toolbar) - -## Custom Toolbar - -The PDF Viewer provides API for user interactions options provided in it's built-in toolbar. Using this we can create our own User Interface for toolbar actions in application level by hiding the built-in toolbar. The following steps are used to create the custom toolbar for PDF Viewer, - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetmvc/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample. - -**Step 2:** Add EJ2 Toolbar for perform primary actions like Open, Previous page, Next page, Go to page,Print and Download using the following code snippet, - -```html -@using Syncfusion.EJ2.Navigations; - -@Html.EJS().Toolbar("topToolbar").Height("56px").Items(new List { -new ToolbarItem { Type = ItemType.Button, PrefixIcon = "e-pv-open-document-icon",TooltipText = "Open",Align=ItemAlign.Left,Click="openFile"}, -new ToolbarItem { Type = ItemType.Button, PrefixIcon = "e-pv-previous-page-navigation-icon",TooltipText = "Previous Page",Align=ItemAlign.Center,Click="previousClicked",Id="previousPage"}, -new ToolbarItem { Type = ItemType.Button, PrefixIcon = "e-pv-next-page-navigation-icon", TooltipText = "Next Page",Align=ItemAlign.Center,Click="nextClicked",Id="nextPage"}, -new ToolbarItem {Template="
" ,PrefixIcon = "e-pv-next-page-navigation-icon", TooltipText = "Page Number",Align=ItemAlign.Center}, -new ToolbarItem { Type = ItemType.Input, Template="
of 0
" , PrefixIcon = "e-pv-next-page-navigation-icon", TooltipText = "Page Number",Click="currentPageClicked",Align=ItemAlign.Center}, -new ToolbarItem { Type = ItemType.Button, PrefixIcon = "e-pv-print-document-icon" ,TooltipText = "Print",Align=ItemAlign.Right,Click="printClicked"}, -new ToolbarItem { Type = ItemType.Button, PrefixIcon = "e-pv-download-document-icon" ,TooltipText = "Download",Align=ItemAlign.Right,Click="downloadClicked"}, -}).Render() - -``` - -**Step 3:** Hide the built-in toolbar of PDF Viewer using below code snippet, - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -```html -@Html.EJS().PdfViewer("pdfviewer") -.EnableToolbar(false).EnableThumbnail(false) -.DocumentLoad("documentLoaded").PageChange("pageChanged") -.DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -```html -@Html.EJS().PdfViewer("pdfviewer") -.ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")) -.EnableToolbar(false).EnableThumbnail(false) -.DocumentLoad("documentLoaded").PageChange("pageChanged") -.DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -``` -{% endhighlight %} -{% endtabs %} - -**Step 4:** Add EJ2 Toolbar for perform magnification actions in PDF Viewer using following code snippet, - -```html - -@Html.EJS().Toolbar("magnificationToolbar").Items(new List { -new ToolbarItem { Type = ItemType.Button, PrefixIcon = "e-pv-fit-page", TooltipText = "Fit to page",Click="pageFitClicked"}, -new ToolbarItem { Type = ItemType.Button, PrefixIcon = "e-pv-zoom-in-icon",TooltipText = "Zoom in",Click="zoomInClicked" }, -new ToolbarItem { Type = ItemType.Button, PrefixIcon = "e-pv-zoom-out-icon", TooltipText = "Zoom out",Click="zoomOutClicked"}, -}).Render() - -``` - -**Step 5:** Add the following style to achieve the custom toolbar styling, - -```html - -``` - -N>The icons are embedded in the font file used in above code snippet. - -**Step 6:** Add the following scripts for performing user interaction in PDF Viewer in code behind - -```html - - -``` - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Create%20Custom%20Toolbar) - -## See also - -* [Toolbar customization](./how-to/toolbar_customization) -* [Feature Modules](./feature-module) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/troubleshooting/document-loading-issues.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/troubleshooting/document-loading-issues.md deleted file mode 100644 index bebbb309f8..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/troubleshooting/document-loading-issues.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: post -title: Document Loading Issues in Version 23.1 or Newer ##Platform_Name## Pdfviewer Component -description: Learn here all about troubleshooting Document Loading Issues in Version 23.1 or newer in ##Platform_Name## Pdfviewer of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Document Loading Issues in Version 23.1 or Newer - -If you're experiencing problems with your document not rendering in the viewer, especially when using version 23.1 or a newer version, follow these troubleshooting steps to resolve the issue: - -1. **Check for `viewer.dataBind()` Requirement**: Ensure that you have called `viewer.dataBind()` as required in version 23.1 or newer. This explicit call is essential for initializing data binding and document rendering correctly. It is must to call the dataBind() method before load. - -```html - -
- @Html.EJS().PdfViewer("pdfviewer").Render() -
- - -``` - -2. **Verify Document Source**: Confirm that the document source or URL you're trying to display is valid and accessible. Incorrect URLs or document paths can lead to loading issues. - -3. **Network Connectivity**: Ensure that your application has a stable network connection. Document rendering may fail if the viewer can't fetch the document due to network issues. - -4. **Console Errors**: Use your browser's developer tools to check for any error messages or warnings in the console. These messages can provide insights into what's causing the document not to load. - -5. **Loading Sequence**: Make sure that you're calling `viewer.dataBind()` and initiating document loading in the correct sequence. The viewer should be properly initialized before attempting to load a document. - -7. **Update Viewer**: Ensure that you're using the latest version of the viewer library or framework. Sometimes, issues related to document loading are resolved in newer releases. - -8. **Cross-Origin Resource Sharing (CORS)**: If you're loading documents from a different domain, ensure that CORS headers are correctly configured to allow cross-origin requests. - -9. **Content Security Policies (CSP)**: Check if your application's Content Security Policy allows the loading of external resources, as this can affect document loading. Refer [here](https://ej2.syncfusion.com/javascript/documentation/common/troubleshoot/content-security-policy) to troubleshoot. - -By following these troubleshooting steps, you should be able to address issues related to document loading in version 23.1 or newer, ensuring that your documents render correctly in the viewer. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/Select-aspnet-core-project.png b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/Select-aspnet-core-project.png deleted file mode 100644 index 88edadb595..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/Select-aspnet-core-project.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/Set-project-name.png b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/Set-project-name.png deleted file mode 100644 index 70a1982afa..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/Set-project-name.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/additional-info.png b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/additional-info.png deleted file mode 100644 index 8d8b50c8d8..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/additional-info.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/pdfviewer-control.png b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/pdfviewer-control.png deleted file mode 100644 index 46fb505fbe..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/Core_Images/pdfviewer-control.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/accessibility.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/accessibility.md deleted file mode 100644 index 088023e612..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/accessibility.md +++ /dev/null @@ -1,223 +0,0 @@ ---- -layout: post -title: Accessibility with EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn here all about accessibility in ASP.NET Core Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- -# Accessibility in Syncfusion® PDF Viewer components - -The PDF Viewer component followed the accessibility guidelines and standards, including [ADA](https://www.ada.gov/), [Section 508](https://www.section508.gov/), [WCAG 2.2](https://www.w3.org/TR/WCAG22/) standards, and [WCAG roles](https://www.w3.org/TR/wai-aria/#roles) that are commonly used to evaluate accessibility. - -The accessibility compliance for the PDF Viewer component is outlined below. - -| Accessibility Criteria | Compatibility | -| -- | -- | -| [WCAG 2.2 Support]| Yes | -| [Section 508 Support] | Yes | -| [Screen Reader Support]| Yes | -| [Right-To-Left Support]| Yes | -| [Color Contrast] | Yes | -| [Mobile Device Support]| Intermediate | -| [Keyboard Navigation Support]| Yes | -| [Accessibility Checker Validation] | Yes | -| [Axe-core Accessibility Validation]| Yes | - - -
Yes - All features of the component meet the requirement.
- -
Intermediate - Some features of the component do not meet the requirement.
- -
No - The component does not meet the requirement.
- -## WAI-ARIA attributes - -[WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/alert/) (Accessibility Initiative – Accessible Rich Internet Applications) defines a way to increase the accessibility of web pages, dynamic content, and user interface components developed with Ajax, HTML, JavaScript,and related technologies. ARIA provides additional semantics to describe the role, state, and functionality of web components. The following ARIA attributes are used in the PDF Viewer component: - -| Attributes | Purpose | -| --- | --- | -| `aria-disabled`| Indicates whether the PDF Viewer component is in a disabled state or not.| -| `aria-expanded`| Indicates whether the suggestion list has expanded or not. | -| `aria-readonly` | Indicates the readonly state of the PDF Viewer element. | -| `aria-haspopup` | Indicates whether the PDF Viewer input element has a suggestion list or not. | -| `aria-label` | Indicates the breadcrumb item text. | -| `aria-labelledby` | Provides a label for the PDF Viewer. Typically, the "aria-labelledby" attribute will contain the id of the element used as the PDF Viewer's title. | -| `aria-describedby` | This attribute points to the PDF Viewer element describing the one it's set on. | -| `aria-orientation` | Indicates whether the PDF Viewer element is oriented horizontally or vertically. | -| `aria-valuetext` | Returns the current text of the PDF Viewer. | -| `aria-valuemax` | Indicates the Maximum value of the PDF Viewer. | -| `aria-valuemin` | Indicates the Minimum value of the PDF Viewer. | -| `aria-valuenow` | Indicates the current value of the PDF Viewer. | -| `aria-controls` | Attribute is set to the button and it points to the corresponding content. | - -## Keyboard interaction - -The PDF Viewer component followed the [keyboard interaction](https://www.w3.org/WAI/ARIA/apg/patterns/alert/#keyboardinteraction) guideline, making it easy for people who use assistive technologies (AT) and those who completely rely on keyboard navigation. The following keyboard shortcuts are supported by the Message component. - -| **Press (Windows)** |**Press (Macintosh)** | **To do this** | -| --- | --- | --- | -|||**Shortcuts for page navigation**| -| CONTROL + Left Arrow (or) CONTROL + Up Arrow | COMMAND + Left Arrow (or) COMMAND + Up Arrow |Navigate to the first page | -| CONTROL + Right Arrow (or) CONTROL + Down Arrow |COMMAND + Right Arrow (or) COMMAND + Down Arrow |Navigate to the last page | -|Left Arrow | Left Arrow (or) Shift + Space |Navigate to the previous page| -| Right Arrow | Right Arrow (or) Space | Navigate to the next page | -| CONTROL + G | COMMAND + G | Go To The Page| -|Up Arrow |Up Arrow |Scroll up| -| Down Arrow | Down Arrow | Scroll down| -|||**Shortcuts for Zooming**| -|CONTROL + = |COMMAND + = | Perform zoom-in operation | -| CONTROL + - | COMMAND + - | Perform zoom-out operation | -|CONTROL + 0 |COMMAND + 0 | Retain the zoom level to 1 | -|||**Shortcut for Text Search**| -| CONTROL + F | COMMAND + F |Open the search toolbar| -|||**Shortcut for Text Selection**| -|CONTROL + C |CONTROL + C | Copy the selected text or annotation or form field | -| CONTROL + X | CONTROL + X |Cut the selected text or annotation of the form field| -|CONTROL + Y |CONTROL + Y |Paste the selected text or annotation or form field| -|||**Shortcuts for the general operation**| -| CONTROL + Z | CONTROL + Z |Undo the action| -|CONTROL + Y |CONTROL + Y |Redo the action| -| CONTROL + P | COMMAND + P |Print the document| -|Delete |Delete |Delete the annotations and form fields| -|CONTROL + Shift + A |COMMAND + Shift + A |Toggle Annotation Toolbar| -|CONTROL + Alt + 0 |COMMAND + Option + 0 |Show Command panel| -|CONTROL + Alt + 2 |COMMAND + Option + 2 |Show Bookmarks| -|CONTROL + Alt + 1 |COMMAND + Option + 1 |Show Thumbnails| -|CONTROL + S |COMMAND + S |Download| -|Shift + H |Shift + H |Enable pan mode| -|Shift + V |Shift + V |Enable text selection mode| - -The current implementation of our PDF Viewer includes keyboard shortcuts for various functions like scrolling, zooming, text search, printing, and annotation deletion. - -To enhance user experience, we're adding additional keyboard shortcuts for actions such as navigating between pages, accessing specific pages, toggling annotation tools, and displaying PDF elements like outlines, annotations, bookmarks, and thumbnails. - -To support this, we're introducing a new class called **commandManager**, which handles custom commands triggered by specific key gestures. These custom commands will be defined by users and executed accordingly. - -The **commandManager** will have a parameter called Commands, which will hold the collection of custom keyboard commands specified by users. Each custom command will be represented by a KeyboardCommand class, containing the `command name` and associated `keyboard combination`. - -Additionally, we're introducing the **keyboardCustomCommands** parameter for the CommandManager, which will utilize the EventCallback to handle keyboard events and trigger appropriate methods when specific key combinations are pressed. - - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -Each `keyboardCommand` object consists of a name property, specifying the `name` of the `custom command`, and a `gesture property`, defining the key gesture associated with the command. - -For example, the first command named `customCopy` is associated with the **G** key and requires both the **Shift** and **Alt** modifier keys to be pressed simultaneously. - -Additionally, there's an explanation of the key modifiers used in the gestures: - -* Ctrl corresponds to the Control key, represented by the value `1`. -* Alt corresponds to the Alt key, represented by the value `2`. -* Shift corresponds to the Shift key, represented by the value `4`. -* Meta corresponds to the Command key on macOS or the Windows key on Windows, represented by the value `8`. - -This setup allows users to perform custom actions within the PDF viewer by pressing specific key combinations, enhancing the user experience and providing more efficient navigation and interaction options. - -## Ensuring accessibility - -The PDF Viewer component's accessibility levels are ensured through an [accessibility-checker](https://www.npmjs.com/package/accessibility-checker) and [axe-core](https://www.npmjs.com/package/axe-core) software tools during automated testing. - -The accessibility compliance of the PDF Viewer component is shown in the following sample. Open the [sample](https://ej2.syncfusion.com/accessibility/pdfviewer.html) in a new window to evaluate the accessibility of the PDF Viewer component with accessibility tools. - -{% previewsample "https://ej2.syncfusion.com/accessibility/pdfviewer.html" %} - -N> Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/comments.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/comments.md deleted file mode 100644 index 09b461d471..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/comments.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -layout: post -title: Comments in ##Platform_Name## PDF Viewer Component | Syncfusion -description: Learn here all about Comments in Syncfusion ##Platform_Name## PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Comments -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Comments in the ASP.NET Core PDF Viewer component - -The PDF Viewer control provides options to add, edit, and delete the comments to the following annotation in the PDF documents: - -* Shape annotation -* Stamp annotation -* Sticky note annotation -* Measurement annotation -* Text markup annotation -* Free text annotation -* Ink annotation - -![Comments](../../pdfviewer/images/commentannot.png) - -## Adding a comment to the annotation - -Annotation comment, comment replies, and status can be added to the PDF document using the comment panel. - -### Comment panel - -Annotation comments can be added to the PDF using the comment panel. The comment panel can be opened in the following ways: - -1. Using the annotation menu - - * Click the Edit Annotation button in the PDF Viewer toolbar. A toolbar appears below it. - * Click the Comment Panel button. A comment panel will appear. - -2. Using Context menu - - * Select annotation in the PDF document and right-click it. - * Select the comment option in the context menu that appears. - -3. Using the Mouse click - - * Select annotation in the PDF document and double click it, a comment panel will appear. - -If the comment panel is already in the open state, you can select the annotations and add annotation comments using the comment panel. - -### Adding comments - -* Select annotation in the PDF document and click it. -* The selected annotation comment container is highlighted in the comment panel. -* Now, you can add comment and comment replies using the comment panel. - -![AddingComments](../../pdfviewer/images/stickycomment.png) - -### Adding Comment Replies - -* The PDF Viewer control provides an option to add multiple replies to the comment. -* After adding the annotation comment, you can add a reply to the comment. - -### Adding Comment or Reply Status - -* Select the Annotation Comments in the comment panel. -* Click the more options button showing in the Comments or reply container. -* Select the Set Status option in the context menu that appears. -* Select the status of the annotation comment in the context menu that appears. - -![CommentStatus](../../pdfviewer/images/commentstatus.png) - -### Editing the comments and comments replies of the annotations - -The comment, comment replies, and status of the annotation can be edited using the comment panel. - -### Editing the Comment or Comment Replies - -The annotation comment and comment replies can be edited in the following ways: - -1. Using the Context menu - - * Select the Annotation Comments in the comment panel. - * Click the More options button showing in the Comments or reply container. - * Select the Edit option in the context menu that appears. - * Now, an editable text box appears. You can change the content of the annotation comment or comment reply. - -2. Using the Mouse Click - - * Select the annotation comments in the comment panel. - * Double click the comment or comment reply content. - * Now, an editable text box appears. You can change the content of the annotation comment or comment reply. - -### Editing Comment or Reply Status - -* Select the Annotation Comments in the comment panel. -* Click the more options button showing in the Comments or reply container. -* Select the Set Status option in the context menu that appears. -* Select the status of the annotation comment in the context menu that appears. -* Status ‘None’ is the default state. If the status is set to ‘None,’ the comments or reply does not appear. - -![CommentEdit](../../pdfviewer/images/commentsedit.png) - -### Delete Comment or Comment Replies - -* Select the Annotation Comments in the comment panel. -* Click the more options button shown in the Comments or reply container. -* Select the Delete option in the context menu that appears. - -![CommentEdit](../../pdfviewer/images/commentsdelete.png) - -N>The annotation will be deleted on deleting the comment using comment panel. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/free-text-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/free-text-annotation.md deleted file mode 100644 index a89eebe558..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/free-text-annotation.md +++ /dev/null @@ -1,294 +0,0 @@ ---- -layout: post -title: Free Text Annotation in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Free Text Annotation in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Free Text Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Free Text Annotation in the ASP.NET Core PDF Viewer component - -The PDF Viewer control provides the options to add, edit, and delete the free text annotations. - -## Adding a free text annotation to the PDF document - -The Free text annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Select the **Free Text Annotation** button in the annotation toolbar. It enables the Free Text annotation mode. -* You can add the text over the pages of the PDF document. - -In the pan mode, if the free text annotation mode is entered, the PDF Viewer control will switch to text select mode. - -![FreeTextAnnotation in ASP.NET Core PDF Viewer](../../pdfviewer/images/freetext_tool.png) - -Refer to the following code sample to switch to the Free Text annotation mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Adding a free text annotation programmatically to the PDF document - -The PDF Viewer library allows you to add the free text annotation in the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here is an example of how you can use the **addAnnotation()** method to move the free text annotation programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Change the content of an existing Free text annotation programmatically - -To change the content of an existing free text annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method to change the content of a free text annotation: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Editing the properties of free text annotation - -The font family, font size, font styles, font color, text alignment, fill color, the border stroke color, border thickness, and opacity of the free text annotation can be edited using the Font Family tool, Font Size tool, Font Color tool, Text Align tool, Font Style tool Edit Color tool, Edit Stroke Color tool, Edit Thickness tool, and Edit Opacity tool in the annotation toolbar. - -### Editing font family - -The font family of the annotation can be edited by selecting the desired font in the Font Family tool. - -![FontFamily](../../pdfviewer/images/fontfamily.png) - -### Editing font size - -The font size of the annotation can be edited by selecting the desired size in the Font Size tool. - -![FontSize](../../pdfviewer/images/fontsize.png) - -### Editing font color - -The font color of the annotation can be edited using the color palette provided in the Font Color tool. - -![FontColor](../../pdfviewer/images/fontcolor.png) - -### Editing the text alignment - -The text in the annotation can be aligned by selecting the desired styles in the drop-down pop-up in the Text Align tool. - -![FreeTextAnnotation](../../pdfviewer/images/textalign.png) - -### Editing text styles - -The style of the text in the annotation can be edited by selecting the desired styles in the drop-down pop-up in the Font Style tool. - -![FontStyle](../../pdfviewer/images/fontstyle.png) - -### Editing fill color - -The fill color of the annotation can be edited using the color palette provided in the Edit Color tool. - -![FillColor](../../pdfviewer/images/fillcolor.png) - -### Editing stroke color - -The stroke color of the annotation can be edited using the color palette provided in the Edit Stroke Color tool. - -![StrokeColor](../../pdfviewer/images/fontstroke.png) - -### Editing thickness - -The border thickness of the annotation can be edited using the range slider provided in the Edit Thickness tool. - -![FontThickness](../../pdfviewer/images/fontthickness.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![FontOpacity](../../pdfviewer/images/fontopacity.png) - -## Setting default properties during control initialization - -The properties of the free text annotation can be set before creating the control using the FreeTextSettings. - -After editing the default values, they will be changed to the selected values. -Refer to the following code sample to set the default free text annotation settings. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/ink-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/ink-annotation.md deleted file mode 100644 index ee2b45775a..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/ink-annotation.md +++ /dev/null @@ -1,211 +0,0 @@ ---- -layout: post -title: Ink Annotation in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Ink Annotation in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Ink Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Ink Annotation in the ASP.NET Core PDF Viewer component - -The PDF Viewer control provides the options to add, edit, and delete the ink annotations. - -![InkAnnotation](../../pdfviewer/images/ink_annotation.png) - -## Adding an ink annotation to the PDF document - -The ink annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Select the **Draw Ink** button in the annotation toolbar. It enables the ink annotation mode. -* You can draw anything over the pages of the PDF document. - -![InkTool](../../pdfviewer/images/ink_tool.png) - -Refer to the following code sample to switch to the ink annotation mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Adding a Ink annotation to the PDF document Programmatically - -With the PDF Viewer library, you can add a Ink annotation to the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here's a example of how you can utilize the **addAnnotation()** method to include a Ink annotation programmatically - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Edit the existing Ink annotation programmatically - -To modify existing Ink annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Editing the properties of the ink annotation - -The stroke color, thickness, and opacity of the ink annotation can be edited using the Edit stroke color tool, Edit thickness tool, and Edit opacity tool in the annotation toolbar. - -### Editing stroke color - -The stroke color of the annotation can be edited using the color palette provided in the Edit Stroke Color tool. - -![InkStrokeColor](../../pdfviewer/images/ink_strokecolor.png) - -### Editing thickness - -The thickness of the border of the annotation can be edited using the range slider provided in the Edit Thickness tool. - -![InkThickness](../../pdfviewer/images/ink_thickness.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![InkOpacity](../../pdfviewer/images/ink_opacity.png) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/measurement-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/measurement-annotation.md deleted file mode 100644 index cf7e32b082..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/measurement-annotation.md +++ /dev/null @@ -1,499 +0,0 @@ ---- -layout: post -title: Measurement Annotation in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Measurement Annotation in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Measurement Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Measurement Annotation in the ASP.NET Core PDF Viewer component - -The PDF Viewer provides the options to add measurement annotations. You can measure the page annotations with the help of measurement annotation. The supported measurement annotations in the PDF Viewer control are: - -* Distance -* Perimeter -* Area -* Radius -* Volume - -![CalibrateAnnotation](../../pdfviewer/images/calibrate_annotation.png) - -## Adding a measurement annotation to the PDF document - -The measurement annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Measurement Annotation** dropdown button. A dropdown pop-up will appear and shows the measurement annotations to be added. -* Select the measurement type to be added to the page in the dropdown pop-up. It enables the selected measurement annotation mode. -* You can measure and add the annotation over the pages of the PDF document. - -In the pan mode, if the measurement annotation mode is entered, the PDF Viewer control will switch to text select mode. - -![CalibrateTool](../../pdfviewer/images/calibrate_tool.png) - -Refer to the following code sample to switch to the distance annotation mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Adding a measurement annotation to the PDF document Programmatically - -With the PDF Viewer library, you can add a measurement annotation to the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here's a example of how you can utilize the **addAnnotation()** method to include a measurement annotation programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Edit the existing measurement annotation programmatically - -To modify existing measurement annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -## Editing the properties of measurement annotation - -The fill color, stroke color, thickness, and opacity of the measurement annotation can be edited using the Edit Color tool, Edit Stroke Color tool, Edit Thickness tool, and Edit Opacity tool in the annotation toolbar. - -### Editing fill color - -The fill color of the annotation can be edited using the color palette provided in the Edit Color tool. - -![CalibrateFillColor](../../pdfviewer/images/calibrate_fillcolor.png) - -### Editing stroke color - -The stroke color of the annotation can be edited using the color palette provided in the Edit Stroke Color tool. - -![CalibrateStrokeColor](../../pdfviewer/images/calibrate_stroke.png) - -### Editing thickness - -The thickness of the border of the annotation can be edited using the range slider provided in the Edit thickness tool. - -![CalibrateThickness](../../pdfviewer/images/calibrate_thickness.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![CalibrateOpacity](../../pdfviewer/images/calibrate_opacity.png) - -### Editing the line properties - -The properties of the line shapes such as distance and perimeter annotations can be edited using the Line properties window. It can be opened by selecting the Properties option in the context menu that appears on right-clicking the distance and perimeter annotations. - -![CalibrateProperty](../../pdfviewer/images/calibrate_lineprop.png) - -## Setting default properties during control initialization - -The properties of the shape annotations can be set before creating the control using DistanceSettings, PerimeterSettings, AreaSettings, RadiusSettings, and VolumeSettings. -Refer to the following code sample to set the default annotation settings. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## Editing scale ratio and unit of the measurement annotation - -The scale ratio and unit of measurement can be modified using the scale ratio option provided in the context menu of the PDF Viewer control. - -![CalibrateScaleRatio](../../pdfviewer/images/calibrate_scaleratio.png) - -The Units of measurements supported for the measurement annotations in the PDF Viewer are: - -* Inch -* Millimeter -* Centimeter -* Point -* Pica -* Feet - -![CalibrateScaleDialog](../../pdfviewer/images/calibrate_scaledialog.png) - -## Setting default scale ratio settings during the control initialization - -The properties of scale ratio for measurement annotation can be set before creating the control using the ScaleRatioSettings as shown in the following code sample. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/shape-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/shape-annotation.md deleted file mode 100644 index 0a786f68f6..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/shape-annotation.md +++ /dev/null @@ -1,450 +0,0 @@ ---- -layout: post -title: Shape Annotation in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Shape Annotation in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Shape Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Shape Annotation in the ASP.NET Core PDF Viewer component - -The PDF Viewer control provides the options to add, edit, and delete the shape annotations. The shape annotation types supported in the PDF Viewer control are: - -* Line -* Arrow -* Rectangle -* Circle -* Polygon - -![ShapeAnnotation](../../pdfviewer/images/shape_annot.png) - -## Adding a shape annotation to the PDF document - -Shape annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Shape Annotation** drop-down button. A drop-down pop-up will appear and shows the shape annotations to be added. -* Select the shape types to be added to the page in the drop-down pop-up. It enables the selected shape annotation mode. -* You can add the shapes over the pages of the PDF document. - -In the pan mode, if the shape annotation mode is entered, the PDF Viewer control will switch to text select mode. - -![ShapeTool](../../pdfviewer/images/shape_toolbar.png) - -Refer to the following code sample to switch to the circle annotation mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Adding a shape annotation to the PDF document Programmatically - -With the PDF Viewer library, you can add a shape annotation to the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here's a example of how you can utilize the **addAnnotation()** method to include a shape annotation programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Edit the existing shape annotation programmatically - -To modify existing shape annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Editing the properties of the shape annotation - -The fill color, stroke color, thickness, and opacity of the shape annotation can be edited using the Edit color tool, Edit stroke color tool, Edit thickness tool, and Edit opacity tool in the annotation toolbar. - -### Editing fill color - -The fill color of the annotation can be edited using the color palette provided in the Edit Color tool. - -![ShapeFillColor](../../pdfviewer/images/shape_fillcolor.png) - -### Editing stroke color - -The stroke color of the annotation can be edited using the color palette provided in the Edit Stroke Color tool. - -![ShapeStrokeColor](../../pdfviewer/images/shape_strokecolor.png) - -### Editing thickness - -The thickness of the border of the annotation can be edited using the range slider provided in the Edit Thickness tool. - -![ShapeThickness](../../pdfviewer/images/shape_thickness.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![ShapeOpacity](../../pdfviewer/images/shape_opacity.png) - -### Editing the line properties - -The properties of the line shapes such as line and arrow annotations can be edited using the Line Properties window. It can be opened by selecting the Properties option in the context menu that appears on right-clicking the line and arrow annotations. - -Refer to the following code sample to set the default annotation settings. - -![ShapeProperty](../../pdfviewer/images/shape_lineproperty.png) - -## Setting default properties during the control initialization - -The properties of the shape annotations can be set before creating the control using LineSettings, ArrowSettings, RectangleSettings, CircleSettings, and PolygonSettings. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/stamp-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/stamp-annotation.md deleted file mode 100644 index 0e63fa259c..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/stamp-annotation.md +++ /dev/null @@ -1,332 +0,0 @@ ---- -layout: post -title: Stamp Annotation in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Stamp Annotation in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Stamp Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Stamp Annotation in the ASP.NET Core PDF Viewer Control - -The PDF Viewer control provides options to add, edit, delete, and rotate the following stamp annotation in the PDF documents: - -* Dynamic -* Sign Here -* Standard Business -* Custom Stamp - -![StampAnnotation](../../pdfviewer/images/stamp_annot.png) - -## Adding stamp annotations to the PDF document - -The stamp annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Stamp Annotation** drop-down button. A drop-down pop-up will appear and shows the stamp annotations to be added. - -![StampTool](../../pdfviewer/images/stamp_tool.png) - -* Select the annotation type to be added to the page in the pop-up. - -![StampPopup](../../pdfviewer/images/selectstamp_annot.png) - -* You can add the annotation over the pages of the PDF document. - -In the pan mode, if the stamp annotation mode is entered, the PDF Viewer control will switch to text select mode. - -Refer to the following code sample to switch to the stamp annotation mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -## Adding custom stamp to the PDF document - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Stamp Annotation** drop-down button. A drop-down pop-up will appear and shows the stamp annotations to be added. -* Click the Custom Stamp button. - -![CustomStamp](../../pdfviewer/images/customstamp.png) - -* The file explorer dialog will appear, choose the image and then add the image to the PDF page. - -N>The JPG and JPEG image format is only supported in the custom stamp annotations. - -## Adding a Stamp annotation to the PDF document Programmatically - -With the PDF Viewer library, you can add a Stamp annotation to the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here's a example of how you can utilize the **addAnnotation()** method to include a Stamp annotation programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Edit the existing sticky note annotation programmatically - -To modify existing sticky note annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## Setting default properties during control initialization - -The properties of the stamp annotation can be set before creating the control using the StampSettings. - -After editing the default opacity using the Edit Opacity tool, they will be changed to the selected values. - -Refer to the following code sample to set the default sticky note annotation settings. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/sticky-notes-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/sticky-notes-annotation.md deleted file mode 100644 index ff8b57f656..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/sticky-notes-annotation.md +++ /dev/null @@ -1,230 +0,0 @@ ---- -layout: post -title: Sticky Notes Annotation in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Sticky Notes Annotation in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Sticky Notes Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Sticky Notes Annotation in the ASP.NET Core PDF Viewer component - -The PDF Viewer control provides the options to add, edit, and delete the sticky note annotations in the PDF document. - -![StickyNotesAnnotation](../../pdfviewer/images/stickynotes_annotation.png) - -## Adding a sticky note annotation to the PDF document - -Sticky note annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Comments** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the position where you want to add sticky note annotation in the PDF document. -* Sticky note annotation will be added in the clicked positions. - -![StickyNotesTool](../../pdfviewer/images/stickynotes_tool.png) - -Annotation comments can be added to the PDF document using the comment panel. - -* Select a Sticky note annotation in the PDF document and right-click it. -* Select the Comment option in the context menu that appears. -* Now, you can add Comments, Reply, and Status using the Comment Panel. -* Now, you can add Comments, Reply, and Status using the Comment Panel. - -![StickyNotesComment](../../pdfviewer/images/stickynotes_comment.png) - -## Editing the properties of the sticky note annotation - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![StickyNotesOpacity](../../pdfviewer/images/sticky_opacity.png) - -### Editing comments - -The comment, comment reply, and comment status of the annotation can be edited using the Comment Panel. - -* Open the comment panel using the Comment Panel button showing in the annotation toolbar. - -![StickyNotesComment](../../pdfviewer/images/commentPanel.png) - -You can modify or delete the comments or comments replay and it’s status using the menu option provided in the comment panel. - -![StickyNotesEdit](../../pdfviewer/images/sticky_editbtn.png) - -## Adding a sticky note annotation to the PDF document Programmatically - -With the PDF Viewer library, you can add a sticky note annotation to the PDF Viewer control programmatically using the **addAnnotation()** method. - -Here's a example of how you can utilize the **addAnnotation()** method to include a sticky note annotation programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Edit the existing sticky note annotation programmatically - -To modify existing sticky note annotation in the Syncfusion® PDF viewer programmatically, you can use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Setting default properties during the control initialization - -The properties of the sticky note annotation can be set before creating the control using the StickyNotesSettings. - -After editing the default opacity using the Edit Opacity tool, they will be changed to the selected values. Refer to the following code sample to set the default sticky note annotation settings. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## Disabling sticky note annotations - -The PDF Viewer control provides an option to disable the sticky note annotations feature. The code sample for disabling the feature is as follows. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/text-markup-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/text-markup-annotation.md deleted file mode 100644 index 812932918d..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/annotation/text-markup-annotation.md +++ /dev/null @@ -1,887 +0,0 @@ ---- -layout: post -title: Text Markup Annotation in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Text Markup Annotation in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Text Markup Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Text Markup Annotation in the ASP.NET Core PDF Viewer Control - -The PDF Viewer control provides the options to add, edit, and delete text markup annotations such as highlight, underline, strikethrough and squiggly annotations in the PDF document. - -![Alt text](../../pdfviewer/images/text_markup_annotation.png) - -## Highlight a text - -There are two ways to highlight a text in the PDF document: - -1.Using the context menu - -* Select a text in the PDF document and right-click it. -* Select **Highlight** option in the context menu that appears. - -![Alt text](../../pdfviewer/images/highlight_context.png) - - -2.Using the annotation toolbar - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Select the **Highlight** button in the annotation toolbar. It enables the highlight mode. -* Select the text and the highlight annotation will be added. -* You can also select the text and apply the highlight annotation using the **Highlight** button. - -![Alt text](../../pdfviewer/images/highlight_button.PNG) - -In the pan mode, if the highlight mode is entered, the PDF Viewer control will switch to text select mode to enable the text selection for highlighting the text. - -Refer to the following code sample to switch to the highlight mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -Refer to the following code sample to switch back to normal mode from the highlight mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Highlight a text programmatically - -The PDF Viewer library enables you to programmatically highlight text within the PDF Viewer control using the **addAnnotation()** method. - -Here's an example of how you can use the **addAnnotation()** method to apply highlighting programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Underline a text - -There are two ways to underline a text in the PDF document: - -1.Using the context menu - -* Select a text in the PDF document and right-click it. -* Select the **Underline** option in the context menu that appears. - -![Alt text](../../pdfviewer/images/underline_context.png) - - -2.Using the annotation toolbar - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Select the **Underline** button in the annotation toolbar. It enables the underline mode. -* Select the text and the underline annotation will be added. -* You can also select the text and apply the underline annotation using the **Underline** button. - -![Alt text](../../pdfviewer/images/underline_button.png) - -In the pan mode, if the underline mode is entered, the PDF Viewer control will switch to text select mode to enable the text selection for underlining the text. - -Refer to the following code sample to switch to the underline mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -Refer to the following code sample to switch back to normal mode from the underline mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Underline a text programmatically - -The PDF Viewer library enables you to programmatically Underline text within the PDF Viewer control using the **addAnnotation()** method. - -Here's an example of how you can use the **addAnnotation()** method to apply Underline programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Strikethrough a text - -There are two ways to strikethrough a text in the PDF document: - -1.Using the context menu - -* Select a text in the PDF document and right-click it. -* Select the **Strikethrough** option in the context menu that appears. - -![Alt text](../../pdfviewer/images/strikethrough_context.png) - - -2.Using the annotation toolbar - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Select the **Strikethrough** button in the annotation toolbar. It enables the strikethrough mode. -* Select the text and the strikethrough annotation will be added. -* You can also select the text and apply the strikethrough annotation using the **Strikethrough** button. - -![Alt text](../../pdfviewer/images/strikethrough_button.png) - -In the pan mode, if the strikethrough mode is entered, the PDF Viewer control will switch to text select mode to enable the text selection for striking through the text. - -Refer to the following code sample to switch to the strikethrough mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -Refer to the following code sample to switch back to normal mode from the strikethrough mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Strikethrough a text programmatically - -The PDF Viewer library enables you to programmatically Strikethrough text within the PDF Viewer control using the **addAnnotation()** method. - -Here's an example of how you can use the **addAnnotation()** method to apply Strikethrough programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Squiggly a text - -There are two ways to add a squiggly annotation to text in the PDF document: - -1.Using the context menu - -* Select a text in the PDF document and right-click it. -* Select the **Squiggly** option in the context menu that appears. - -![Alt text](../../pdfviewer/images/squiggly_context.png) - - -2.Using the annotation toolbar - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Select the **Squiggly** button in the annotation toolbar. It enables the squiggly mode. -* Select the text and the squiggly annotation will be added. -* You can also select the text and apply the squiggly annotation using the **Squiggly** button. - -![Alt text](../../pdfviewer/images/squiggly_button.png) - -In the pan mode, if the squiggly mode is entered, the PDF Viewer control will switch to text select mode to enable the text selection for adding squiggly to the text. - -Refer to the following code sample to switch to the squiggly mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -Refer to the following code sample to switch back to normal mode from the squiggly mode. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Squiggly a text programmatically - -The PDF Viewer library enables you to programmatically Squiggly text within the PDF Viewer control using the **addAnnotation()** method. - -Here's an example of how you can use the **addAnnotation()** method to apply Squiggly programmatically: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Deleting a text markup annotation - -The selected annotation can be deleted in the following ways: - -1. Using the Delete key - * Select the annotation to be deleted. - * Click the Delete key in the keyboard. The selected annotation will be deleted. - -2. Using the annotation toolbar - * Select the annotation to be deleted. - * Click the **Delete Annotation** button in the annotation toolbar. The selected annotation will be deleted. - -![Alt text](../../pdfviewer/images/delete_button.png) - -## Editing the properties of the text markup annotation - -The color and the opacity of the text markup annotation can be edited using the Edit Color tool and the Edit Opacity tool in the annotation toolbar. - -### Editing color - -The color of the annotation can be edited using the color palette provided in the Edit Color tool. - -![Alt text](../../pdfviewer/images/edit_color.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![Alt text](../../pdfviewer/images/edit_opacity.png) - -## Setting default properties during the control initialization - -The properties of the text markup annotation can be set before creating the control using the highlightSettings, underlineSettings, strikethroughSettings and squiggly. - -N>After editing the default color and opacity using the Edit Color tool and Edit Opacity tool, they will be changed to the selected values. - -Refer to the following code sample to set the default annotation settings. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## Performing undo and redo - -The PDF Viewer performs undo and redo for the changes made in the PDF document. In the text markup annotation, undo and redo actions are provided for: - -* Inclusion of the text markup annotations. -* Deletion of the text markup annotations. -* Change of either color or opacity of the text markup annotations. - -The undo and redo actions can be done by the following ways: - -1. Using the keyboard shortcuts: - After performing a text markup annotation action, you can undo it by using the Ctrl + Z shortcut and redo by using the Ctrl + Y shortcut. -2. Using toolbar: - The undo and redo can be done using the **Undo** tool and **Redo** tool provided in the toolbar. - -Refer to the following code sample for calling undo and redo actions from the client-side. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Saving the text markup annotation - -When you click the download tool in the toolbar, the text markup annotations will be saved in the PDF document. This action will not affect the original document. - -## Printing the text markup annotation - -When the print tool is selected in the toolbar, the PDF document will be printed along with the text markup annotations added to the pages. This action will not affect the original document. - -## Disabling text markup annotation - -The PDF Viewer control provides an option to disable the text markup annotation feature. The code sample for disabling the feature is as follows. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/download.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/download.md deleted file mode 100644 index 17e6cab81d..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/download.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -layout: post -title: Download in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Download in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Download -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - -# Download a PDF document in PDF Viewer component - -The PDF Viewer supports downloading the loaded PDF file. You can enable/disable the download using the following code snippet. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} -
- - -
-{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} -
- - -
-{% endhighlight %} -{% endtabs %} - -![Alt text](./images/download.png) - -You can invoke download action using following code snippet., - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/feature-module.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/feature-module.md deleted file mode 100644 index 2197e36297..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/feature-module.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -layout: post -title: Feature Module in ##Platform_Name## Pdfviewer Component -description: Learn here all about Feature Module in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Feature Module -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Feature modules in ASP.NET Core PDF Viewer control - -The PDF Viewer features are segregated into individual feature-wise modules to enable selectively referencing in the application. The required modules should be injected to extend its functionality. The following are the selective modules of PDF Viewer that can be included as required: - -The available PdfViewer modules are: - -* **Toolbar**:- Built-in toolbar for better user interaction. -* **Magnification**:- Perform zooming operation for better viewing experience. -* **Navigation**:- Easy navigation across the PDF pages. -* **LinkAnnotation**:- Easy navigation within and outside of the PDF document. -* **ThumbnailView**:- Easy navigation with in the PDF document. -* **BookmarkView**:- Easy navigation based on the bookmark content of the PDF document. -* **TextSelection**:- Select and copy text from a PDF file. -* **TextSearch**:- Search a text easily across the PDF document. -* **Print**:- Print the entire document or a specific page directly from the browser. -* **Annotation**:- Annotations can be added or edited in the PDF document. - -N>In addition to injecting the required modules in your application, enable corresponding properties to extend the functionality for a PDF Viewer instance. -Refer to the following table. - -| Module | Property to enable the functionality for a PDF Viewer instance | -|---|---| -|Toolbar|``| -|Magnification|``| -|Navigation|``| -|LinkAnnotation|``| -|ThumbnailView|``| -|BookmarkView|``| -|TextSelection|``| -|TextSearch|``| -|Print|``| -|Annotation|``| - -## See also - -* [Toolbar items](./toolbar) -* [Toolbar customization](./how-to/toolbar-customization) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/form-designer/create-programmatically.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/form-designer/create-programmatically.md deleted file mode 100644 index 0931512ecb..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/form-designer/create-programmatically.md +++ /dev/null @@ -1,1916 +0,0 @@ ---- -layout: post -title: Create Programmatically in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Create Programmatically in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Create Programmatically -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Create form fields programmatically - -The PDF Viewer control provides the option to add, edit and delete the Form Fields. The Form Fields type supported by the PDF Viewer Control are: - -* Textbox -* Password -* CheckBox -* RadioButton -* ListBox -* DropDown -* SignatureField -* InitialField - -## Add a form field to PDF document programmatically - -Using addFormField method, the form fields can be added to the PDF document programmatically. We need to pass two parameters in this method. They are Form Field Type and Properties of Form Field Type. To add form field programmatically, Use the following code. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## Edit/Update form field programmatically - -Using updateFormField method, Form Field can be updated programmatically. We should get the Form Field object/Id from FormFieldCollections property that you would like to edit and pass it as a parameter to updateFormField method. The second parameter should be the properties that you would like to update for Form Field programmatically. We have updated the value and background Color properties of Textbox Form Field. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Delete form field programmatically - -Using deleteFormField method, the form field can be deleted programmatically. We should retrieve the Form Field object/Id from FormFieldCollections property that you would like to delete and pass it as a parameter to deleteFormField method. To delete a Form Field programmatically, use the following code. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - -{% endhighlight %} -{% endtabs %} - - -## Saving the form fields - -When the download icon is selected on the toolbar, the Form Fields will be saved in the PDF document and this action will not affect the original document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/saveformfield.gif) - -You can invoke download action using following code snippet. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - -{% endhighlight %} -{% endtabs %} - - -## Printing the form fields - -When the print icon is selected on the toolbar, the PDF document will be printed along with the Form Fields added to the pages and this action will not affect the original document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/printformfield.gif) - -You can invoke print action using the following code snippet., - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Open the existing PDF document - -We can open the already saved PDF document contains Form Fields in it by clicking the open icon in the toolbar. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/openexistingpdf.gif) - -## Validate form fields - -The form fields in the PDF Document will be validated when the `enableFormFieldsValidation` is set to true and hook the validateFormFields. The validateFormFields will be triggered when the PDF document is downloaded or printed with the non-filled form fields. The non-filled fields will be obtained in the `nonFillableFields` property of the event arguments of validateFormFields. - -Add the following code snippet to validate the form fields, - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -## Export and import form fields - -The PDF Viewer control provides the support to export and import the form field data in the following formats using the `importFormFields`, `exportFormFields`, and `exportFormFieldsAsObject` methods. - -* FDF -* XFDF -* JSON - -### Export and import as FDF - -Using the `exportFormFields` method, the form field data can be exported in the specified data format. This method accepts two parameters: - -* The first one must be the destination path for the exported data. If the path is not specified, it will ask for the location while exporting. -* The second parameter should be the format type of the form data. - -The following code explains how to export the form field data as FDF. - -```html - - - - -
- - -
- - - -``` - -### Export and import as XFDF - -The following code explains how to export the form field data as XFDF. - -```html - - - - -
- - -
- - - -``` - -### Export and import as JSON - -The following code explains how to export the form field data as JSON. - -```html - - - - -
- - -
- - - -``` - -### Export and import as Object - -The PDF Viewer control supports exporting the form field data as an object, and the exported data will be imported into the current PDF document from the object. - -The following code shows how to export the form field data as an object and import the form field data from that object into the current PDF document via a button click. - -```html - - - - -
- - -
- - - -``` - - -## Form Field Properties - -Form field properties in Syncfusion® PDF Viewer allow you to customize and interact with form fields embedded within PDF documents. This documentation provides an overview of the form field properties supported by the Syncfusion® PDF Viewer and explains how to use them effectively. - - * Textbox - * Password - * CheckBox - * RadioButton - * ListBox - * DropDown - * SignatureField - * InitialField - -### Signature and initial fields settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the signature field properties on a button click. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -The following code example explains how to update the properties of the signature field added to the document from the form designer toolbar. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - -{% endhighlight %} -{% endtabs %} - - -![Signature Field Settings](../../pdfviewer/images/signature_field.png) - -The following code example explains how to update the properties of the initial field added to the document from the form designer toolbar. - - - -![Initial Field Settings](../../pdfviewer/images/initialfield.png) - -### Textbox field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the Textbox field properties on a button click. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -The following code example explains how to update the properties of the textbox field added to the document from the form designer toolbar. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -![Textbox Field Settings](../../pdfviewer/images/Textbox.png) - -### Password field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the Password field properties on a button click. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -The following code example explains how to update the properties of the password field added to the document from the form designer toolbar. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -![Password Field Settings](../../pdfviewer/images/Password.png) - -### CheckBox field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the CheckBox field properties on a button click. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -The following code example explains how to update the properties of the CheckBox field added to the document from the form designer toolbar. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -![CheckBox Field Settings](../../pdfviewer/images/Checkbox.png) - -### RadioButton field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the RadioButton field properties on a button click. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -The following code example explains how to update the properties of the RadioButton field added to the document from the form designer toolbar. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -![RadioButton Field Settings](../../pdfviewer/images/Radiobutton.png) - -### ListBox field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the ListBox field properties on a button click. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -The following code example explains how to update the properties of the ListBox field added to the document from the form designer toolbar. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -![ListBox Field Settings](../../pdfviewer/images/Listbox.png) - -### DropDown field settings - -Using the `updateFormField` method, the form fields can be updated programmatically. - -The following code example explains how to update the DropDown field properties on a button click. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -The following code example explains how to update the properties of the dropdown field added to the document from the form designer toolbar. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -![DropDownBox Field Settings](../../pdfviewer/images/Dropdown.png) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/form-designer/create-with-user-interface-interaction.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/form-designer/create-with-user-interface-interaction.md deleted file mode 100644 index 55fe727fb4..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/form-designer/create-with-user-interface-interaction.md +++ /dev/null @@ -1,140 +0,0 @@ ---- -layout: post -title: User Interface Interaction in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about User Interface Interaction in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Create With User Interface Interaction -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Create form fields with UI interaction - -The PDF viewer control provides the option for interaction with Form Fields such as Drag and resize. you can draw a Form Field dynamically by clicking the Form Field icon on the toolbar and draw it in the PDF document. The Form Fields type supported by the PDF Viewer Control are: - -* Textbox -* Password -* CheckBox -* RadioButton -* ListBox -* DropDown -* SignatureField -* InitialField - -## Enable or Disable form designer toolbar - -We should inject FormDesigner module and set enableFormDesignerToolbar as true to enable the Form designer icon on the toolbar. By default, enableFormDesignerToolbar is set as true. Use the following code to inject FormDesigner module and to enable the enableFormDesignerToolbar property. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## Add the form field dynamically - -Click the Form Field icon on the toolbar and then click on to the PDF document to draw a Form Field. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/addformfield.gif) - -## Drag the form field - -We provide options to drag the Form Field which is currently selected in the PDF document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/dragformfield.gif) - -## Resize the form field - -We provide options to resize the Form Field which is currently selected in the PDF document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/resizeformfield.gif) - -## Edit or Update the form field dynamically - -The properties of the Form Fields can be edited using the Form Field Properties window. It can be opened by selecting the Properties option in the context menu that appears on the right by clicking the Form Field object. Refer the below image for the properties available to customize the appearance of the Form Field. - -![Alt text](../../pdfviewer/images/generalproperties.png) - -![Alt text](../../pdfviewer/images/appearanceproperties.png) - -![Alt text](../../pdfviewer/images/dropdownproperties.png) - -## Clipboard operation with form field - -The PDF Viewer control supports the clipboard operations such as cut, copy and paste for Form Fields. You can right click on the Form Field object to view the context menu and select to the clipboard options that you would like to perform. Refer the below image for the options in the context menu. - -![Alt text](../../pdfviewer/images/clipboardformfield.png) - -## Undo and Redo - -We provided support to undo/redo the Form Field actions that are performed at runtime. Use the following code example to perform undo/redo actions. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/form-designer/form-field-events.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/form-designer/form-field-events.md deleted file mode 100644 index 7e8772f9ba..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/form-designer/form-field-events.md +++ /dev/null @@ -1,608 +0,0 @@ ---- -layout: post -title: Form Field Events in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about form field event in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Form Field Events -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# PDF Viewer Form Field events - -The PDF Viewer control provides the support to different Form Field events. The Form Field events supported by the PDF Viewer Control are: - -| Form Field events | Description | -|---|---| -| formFieldAdd | Event trigger when a form field is added.| -| formFieldClick | Events trigger when the form field is selected.| -| formFieldDoubleClick | Events trigger when the form field is double-clicked.| -| formFieldFocusOut | Events trigger when focus out from the form fields.| -| formFieldMouseLeave | Events trigger when the mouse cursor leaves the form field.| -| formFieldMouseOver | Events trigger when the mouse cursor is over a form field.| -| formFieldMove | Events trigger when a form field is moved.| -| formFieldPropertiesChange | Events trigger when a property of form field is changed.| -| formFieldRemove | Events trigger when a form field is removed.| -| formFieldResize | Events trigger when a form field is resized.| -| formFieldSelect | Events trigger when a form field is selected.| -| formFieldUnselect | Events trigger when a form field is unselected.| -| validateFormFields | Events trigger when validation is failed.| - -## formFieldAdd event - -The [formFieldAdd](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldAdd) event is triggered when a new form field is added, either programmatically or through user interaction. The event arguments provide the necessary information about the form field addition. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldClick event - -The [formFieldClick](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldClick) event is triggered when a form field is clicked. The event arguments provide the necessary information about the form field click event. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldDoubleClick event - -The [formFieldDoubleClick](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldDoubleClick/) event is triggered when a form field is double-clicked. The event arguments provide the necessary information about the form field double-click event. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldFocusOut event - -The [formFieldFocusOut](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldFocusOut/) event is triggered when a form field loses focus. The event arguments provide the necessary information about the form field focus out event. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldMouseLeave event - -The [formFieldMouseLeave](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldMouseLeave/) event is triggered when the mouse leaves a form field. The event arguments provide the necessary information about the form field mouse leave event. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldMouseOver event - -The [formFieldMouseOver](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldMouseover/) event is triggered when the mouse hovers over a form field. The event arguments provide the necessary information about the form field mouse over event. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldMove event - -The [formFieldMove](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldMove/) event is triggered when the mouse moves inside a form field. The event arguments provide the necessary information about the form field mouse move event. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldPropertiesChange event - -The [formFieldPropertiesChange](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldPropertiesChange/) event is triggered when the properties of a form field are changed. The event arguments provide the necessary information about which property of the form field has been changed. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldRemove event - -The [formFieldRemove](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldRemove/) event is triggered when a form field is removed from the PDF. The event arguments provide the necessary information about which form field has been removed. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldResize event - -The [formFieldResize](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldResize/) events are triggered when a form field in a PDF is resized. These events provide the relevant details about the specific form field that has been resized. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldSelect event - -The [formFieldSelect](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldSelect/) events are triggered when a form field in a PDF is selected. These events provide the necessary details about the specific form field that has been selected. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## formFieldUnselect event - -The [formFieldUnselect](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_FormFieldUnselect/) events are triggered when a form field in a PDF is unselected. These events provide the necessary details about the specific form field that has been unselected. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## validateFormFields event - -The [ValidateFormFields](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_ValidateFormFields/) events are triggered when a required form field is left unfilled before downloading the PDF. These events provide the necessary information for validating which form fields are incomplete. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/formdesigner/programmatically-work-with-form-field.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/formdesigner/programmatically-work-with-form-field.md deleted file mode 100644 index e207e4829f..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/formdesigner/programmatically-work-with-form-field.md +++ /dev/null @@ -1,151 +0,0 @@ ---- -layout: post -title: Programmatically Work With Form Field in ##Platform_Name## Pdfviewer Component -description: Learn here all about Programmatically Work With Form Field in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Programmatically Work With Form Field -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Programmatically work with form field - -The PDF Viewer control provides the option to add, edit and delete the Form Fields. The Form Fields type supported by the PDF Viewer Control are: - - * Textbox - * Password - * CheckBox - * RadioButton - * ListBox - * DropDown - * SignatureField - * InitialField - -## Add a form field to PDF document programmatically - -Using addFormField method, the form fields can be added to the PDF document programmatically. We need to pass two parameters in this method. They are Form Field Type and Properties of Form Field Type. To add form field programmatically, Use the following code. - -```html -
- - -
- - -``` - -## Edit/Update form field programmatically - -Using updateFormField method, Form Field can be updated programmatically. We should get the Form Field object/Id from FormFieldCollections property that you would like to edit and pass it as a parameter to updateFormField method. The second parameter should be the properties that you would like to update for Form Field programmatically. We have updated the value and background Color properties of Textbox Form Field. - -```html -
- - -
- - -``` - -## Delete form field programmatically - -Using deleteFormField method, the form field can be deleted programmatically. We should retrieve the Form Field object/Id from FormFieldCollections property that you would like to delete and pass it as a parameter to deleteFormField method. To delete a Form Field programmatically, use the following code. - -```html -
- - -
- - -``` - -## Saving the form fields - -When the download icon is selected on the toolbar, the Form Fields will be saved in the PDF document and this action will not affect the original document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/saveformfield.gif) - -You can invoke download action using following code snippet. - -```html -
- - -
- - -``` - -## Printing the form fields - -When the print icon is selected on the toolbar, the PDF document will be printed along with the Form Fields added to the pages and this action will not affect the original document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/printformfield.gif) - -You can invoke print action using the following code snippet., - -```html -
- - -
- - -``` - -## Open the existing PDF document - -We can open the already saved PDF document contains Form Fields in it by clicking the open icon in the toolbar. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/openexistingpdf.gif) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/formdesigner/user-interaction-with-form-fields.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/formdesigner/user-interaction-with-form-fields.md deleted file mode 100644 index 848a4ccbb4..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/formdesigner/user-interaction-with-form-fields.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -layout: post -title: User Interaction With Form Fields in ##Platform_Name## Pdfviewer Component -description: Learn here all about User Interaction With Form Fields in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: User Interaction With Form Fields -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# User interaction with form fields - -The PDF viewer control provides the option for interaction with Form Fields such as Drag and resize. you can draw a Form Field dynamically by clicking the Form Field icon on the toolbar and draw it in the PDF document. The Form Fields type supported by the PDF Viewer Control are: - - * Textbox - * Password - * CheckBox - * RadioButton - * ListBox - * DropDown - * SignatureField - * InitialField - -## Enable or Disable form designer toolbar - -We should inject FormDesigner module and set enableFormDesignerToolbar as true to enable the Form designer icon on the toolbar. By default, enableFormDesignerToolbar is set as true. Use the following code to inject FormDesigner module and to enable the enableFormDesignerToolbar property. - -```html -
- - -
-``` - -## Add the form field dynamically - -Click the Form Field icon on the toolbar and then click on to the PDF document to draw a Form Field. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/addformfield.gif) - -## Drag the form field - -We provide options to drag the Form Field which is currently selected in the PDF document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/dragformfield.gif) - -## Resize the form field - -We provide options to resize the Form Field which is currently selected in the PDF document. Refer the below GIF for further reference. - -![Alt text](../../pdfviewer/images/resizeformfield.gif) - -## Edit or Update the form field dynamically - -The properties of the Form Fields can be edited using the Form Field Properties window. It can be opened by selecting the Properties option in the context menu that appears on the right by clicking the Form Field object. Refer the below image for the properties available to customize the appearance of the Form Field. - -![Alt text](../../pdfviewer/images/generalproperties.png) - -![Alt text](../../pdfviewer/images/appearanceproperties.png) - -![Alt text](../../pdfviewer/images/dropdownproperties.png) - -## Clipboard operation with form field - -The PDF Viewer control supports the clipboard operations such as cut, copy and paste for Form Fields. You can right click on the Form Field object to view the context menu and select to the clipboard options that you would like to perform. Refer the below image for the options in the context menu. - -![Alt text](../../pdfviewer/images/clipboardformfield.png) - -## Undo and Redo - -We provided support to undo/redo the Form Field actions that are performed at runtime. Use the following code example to perform undo/redo actions. - -```html - - -
- - -
- -``` \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/getting-started-with-server-backed.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/getting-started-with-server-backed.md deleted file mode 100644 index d3e0db8125..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/getting-started-with-server-backed.md +++ /dev/null @@ -1,431 +0,0 @@ ---- -layout: post -title: Getting Started with EJ2 ASP.NET Core PDF Viewer Control | Syncfusion -description: Learn how to getting started with PDF Viewer control in ASP.NET Core application. You can view and comment on PDFs in ease and also can fill forms. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Getting Started with ASP.NET Core PDF Viewer control - -The [ASP.NET Core PDF Viewer](https://www.syncfusion.com/aspnet-core-ui-controls/pdf-viewer) control is used to viewing and printing PDF files in any web application. It provides the best viewing experience available with core interactions such as zooming, scrolling, text searching, text selection, and text copying. Thumbnail, bookmark, hyperlink and table of contents support provides easy navigation within and outside the PDF files. - -This section briefly explains about how to integrate ASP.NET Core PDF Viewer control in your ASP.NET Core application using Visual Studio. - -## Prerequisites - -[System requirements for ASP.NET Core controls](https://ej2.syncfusion.com/aspnetcore/documentation/system-requirements) - -## Integrate PDF Viewer into an ASP.NET Core application - -1. Start Visual Studio and select **Create a new project**. -2. In the **Create a new project** dialog, select **ASP.NET Core Web App**. -![select-aspnet-core-web-app](Core_Images/Select-aspnet-core-project.png) -3. In the **Configure your new project** dialog, enter *Project Name* and select Next. -![Set-project-name](Core_Images/Set-project-name.png) -4. In the **Additional information** dialog, select **.NET 6.0 (Long-term Support) and then select Create**. -![Set-framework](Core_Images/additional-info.png) - -## ASP.NET Core PDF Viewer NuGet package installation - -To add ASP.NET Core PDF Viewer control, the following NuGet package need to be installed in your ASP.NET Core application. - -* Use [Syncfusion.EJ2.AspNet.Core](https://www.nuget.org/packages/Syncfusion.EJ2.AspNet.Core/) - -## Add Syncfusion® ASP.NET Core Tag Helper - -Open `~/Pages/_ViewImports.cshtml` file and import the `Syncfusion.EJ2` TagHelper. - -{% tabs %} -{% highlight c# tabtitle="~/_ViewImports.cshtml" %} - -@addTagHelper *, Syncfusion.EJ2 - -{% endhighlight %} -{% endtabs %} - -## Add style sheet - -The theme is referred using CDN inside the `` of `~/Pages/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - - -{% endhighlight %} -{% endtabs %} - -N> Checkout the [Themes topic](https://ej2.syncfusion.com/aspnetcore/documentation/appearance/theme) to learn different ways ([CDN](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#cdn-reference), [NPM package](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#node-package-manager-npm), and [CRG](https://ej2.syncfusion.com/aspnetcore/documentation/common/custom-resource-generator)) to refer styles in ASP.NET Core application, and to have the expected appearance for Syncfusion® ASP.NET Core controls. - -## Add script reference - -Add the required scripts using CDN inside the `` of `~/Pages/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - - -{% endhighlight %} -{% endtabs %} - -## Register Syncfusion® Script Manager - -Open `~/Pages/Shared/_Layout.cshtml` page and register the script manager in the ASP.NET Core application as follows. - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - .... - .... - - - - -{% endhighlight %} -{% endtabs %} - -N> Add the script manager `` at the **end of ``**. - -## Add ASP.NET Core PDF Viewer control - -Add the Syncfusion® ASP.NET Core PDF Viewer tag helper in `~/Pages/Index.cshtml` page. You can load a PDF file in the PDF Viewer by specifying the document name in the documentPath property as below. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -Add the below code in the Index.cshtml.cs which is placed inside the Pages folder. - -{% tabs %} -{% highlight c# tabtitle="Index.cshtml.cs" %} -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Memory; -using Syncfusion.EJ2.PdfViewer; -using Newtonsoft.Json; -using Microsoft.AspNetCore.Mvc.RazorPages; -using System.Reflection; -using System.Net; - -namespace PDFViewerSample.Pages -{ - [IgnoreAntiforgeryToken(Order = 1001)] - public class IndexModel : PageModel - { - - private readonly Microsoft.AspNetCore.Hosting.IHostingEnvironment _hostingEnvironment; - private IMemoryCache _cache; - - public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache) - { - _hostingEnvironment = hostingEnvironment; - _cache = cache; - } - - public IActionResult OnPostLoad([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - var jsonObject = JsonConverterstring(responseData); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - string documentPath = GetDocumentPath(jsonObject["document"]); - if (!string.IsNullOrEmpty(documentPath)) - { - byte[] bytes = System.IO.File.ReadAllBytes(documentPath); - stream = new MemoryStream(bytes); - } - else - { - string fileName = jsonObject["document"].Split(new string[] { "://" }, StringSplitOptions.None)[0]; - if (fileName == "http" || fileName == "https") - { - WebClient WebClient = new WebClient(); - byte[] pdfDoc = WebClient.DownloadData(jsonObject["document"]); - stream = new MemoryStream(pdfDoc); - } - else - return this.Content(jsonObject["document"] + " is not found"); - } - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - public Dictionary JsonConverterstring(jsonObjects results) - { - Dictionary resultObjects = new Dictionary(); - resultObjects = results.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public) - .ToDictionary(prop => prop.Name, prop => prop.GetValue(results, null)); - var emptyObjects = (from kv in resultObjects - where kv.Value != null - select kv).ToDictionary(kv => kv.Key, kv => kv.Value); - Dictionary jsonResult = emptyObjects.ToDictionary(k => k.Key, k => k.Value.ToString()); - return jsonResult; - } - - //Post action for processing the PDF documents. - public IActionResult OnPostRenderPdfPages([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - object jsonResult = pdfviewer.GetPage(jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - //Post action for unloading and disposing the PDF document resources - public IActionResult OnPostUnload([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - pdfviewer.ClearCache(jsonObject); - return this.Content("Document cache is cleared"); - } - - //Post action for rendering the ThumbnailImages - public IActionResult OnPostRenderThumbnailImages([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - object result = pdfviewer.GetThumbnailImages(jsonObject); - return Content(JsonConvert.SerializeObject(result)); - } - - //Post action for processing the bookmarks from the PDF documents - public IActionResult OnPostBookmarks([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - object jsonResult = pdfviewer.GetBookmarks(jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - //Post action for rendering the annotation comments - public IActionResult OnPostRenderAnnotationComments([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - object jsonResult = pdfviewer.GetAnnotationComments(jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); - } - - //Post action for exporting the annotations - public IActionResult OnPostExportAnnotations([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - string jsonResult = pdfviewer.ExportAnnotation(jsonObject); - return Content(jsonResult); - } - - //Post action for importing the annotations - public IActionResult OnPostImportAnnotations([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - string jsonResult = string.Empty; - object JsonResult; - if (jsonObject != null && jsonObject.ContainsKey("fileName")) - { - string documentPath = GetDocumentPath(jsonObject["fileName"]); - if (!string.IsNullOrEmpty(documentPath)) - { - jsonResult = System.IO.File.ReadAllText(documentPath); - } - else - { - return this.Content(jsonObject["document"] + " is not found"); - } - } - else - { - string extension = Path.GetExtension(jsonObject["importedData"]); - if (extension != ".xfdf") - { - JsonResult = pdfviewer.ImportAnnotation(jsonObject); - return Content(JsonConvert.SerializeObject(JsonResult)); - } - else - { - string documentPath = GetDocumentPath(jsonObject["importedData"]); - if (!string.IsNullOrEmpty(documentPath)) - { - byte[] bytes = System.IO.File.ReadAllBytes(documentPath); - jsonObject["importedData"] = Convert.ToBase64String(bytes); - JsonResult = pdfviewer.ImportAnnotation(jsonObject); - return Content(JsonConvert.SerializeObject(JsonResult)); - } - else - { - return this.Content(jsonObject["document"] + " is not found"); - } - } - } - return Content(jsonResult); - } - - //Post action for downloading the PDF documents - public IActionResult OnPostDownload([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - return Content(documentBase); - } - - //Post action for printing the PDF documents - public IActionResult OnPostPrintImages([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - object pageImage = pdfviewer.GetPrintImage(jsonObject); - return Content(JsonConvert.SerializeObject(pageImage)); - } - - //Gets the path of the PDF document - private string GetDocumentPath(string document) - { - string documentPath = string.Empty; - if (!System.IO.File.Exists(document)) - { - string basePath = _hostingEnvironment.WebRootPath; - string dataPath = string.Empty; - dataPath = basePath + "/"; - if (System.IO.File.Exists(dataPath + (document))) - documentPath = dataPath + document; - } - else - { - documentPath = document; - } - return documentPath; - } - } - - public class jsonObjects - { - public string document { get; set; } - public string password { get; set; } - public string zoomFactor { get; set; } - public string isFileName { get; set; } - public string xCoordinate { get; set; } - public string yCoordinate { get; set; } - public string pageNumber { get; set; } - public string documentId { get; set; } - public string hashId { get; set; } - public string sizeX { get; set; } - public string sizeY { get; set; } - public string startPage { get; set; } - public string endPage { get; set; } - public string stampAnnotations { get; set; } - public string textMarkupAnnotations { get; set; } - public string stickyNotesAnnotation { get; set; } - public string shapeAnnotations { get; set; } - public string measureShapeAnnotations { get; set; } - public string action { get; set; } - public string pageStartIndex { get; set; } - public string pageEndIndex { get; set; } - public string fileName { get; set; } - public string elementId { get; set; } - public string pdfAnnotation { get; set; } - public string importPageList { get; set; } - public string uniqueId { get; set; } - public string data { get; set; } - public string viewPortWidth { get; set; } - public string viewPortHeight { get; set; } - public string tilecount { get; set; } - public bool isCompletePageSizeNotReceived { get; set; } - public string freeTextAnnotation { get; set; } - public string signatureData { get; set; } - public string fieldsData { get; set; } - public string formDesigner { get; set; } - public string inkSignatureData { get; set; } - public bool hideEmptyDigitalSignatureFields { get; set; } - public bool showDigitalSignatureAppearance { get; set; } - public bool digitalSignaturePresent { get; set; } - public string tileXCount { get; set; } - public string tileYCount { get; set; } - public string digitalSignaturePageList { get; set; } - public string annotationCollection { get; set; } - public string annotationsPageList { get; set; } - public string formFieldsPageList { get; set; } - public bool isAnnotationsExist { get; set; } - public bool isFormFieldAnnotationsExist { get; set; } - public string documentLiveCount { get; set; } - public string annotationDataFormat { get; set; } - public string importedData { get; set; } - } -} -{% endhighlight %} -{% endtabs %} - -In the above code, - -**ejs-pdfviewer** refers to the PDF Viewer control among the EJ components with id as "pdfviewer". - -**serviceUrl** is necessary to communicate with the server which also specifies the path of the controller. Here, PdfViewer is the name of the controller. - -**documentPath** is the property needed to load a PDF file in the PDF Viewer. - -Press Ctrl+F5 (Windows) or +F5 (macOS) to run the app. Then, the Syncfusion® ASP.NET Core PDF Viewer control will be rendered in the default web browser. - -![ASP.NET Core PDF Viewer Control](Core_Images/pdfviewer-control.png) - -N> We have provided the support to dynamically change the `serviceURL`. So, after changing the `serviceURL` dynamically, you need invoke the `pdfViewer.dataBind()` method to update the `serviceURL` quickly. This will effectively change the `serviceURL` dynamically. Ensure that this step is performed after version 23.1.36. - function load() { - var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0]; - pdfViewer.serviceUrl = "/Index"; - pdfViewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; - pdfViewer.dataBind(); - pdfViewer.load(pdfViewer.documentPath, null); - } - -N> [View Sample in GitHub](https://github.com/SyncfusionExamples/ASP-NET-Core-Getting-Started-Examples/tree/main/PDFViewer/ASP.NET%20Core%20Tag%20Helper%20Examples). - -N> When configuring the server-backed PDF viewer, it's essential to understand that there is no need to include the pdfium.js and pdfium.wasm files. Unlike the standalone PDF viewer, which relies on these files for local rendering, the server-backed PDF viewer fetches and renders PDFs directly from the server. Consequently, you can exclude the copy command for deployment process, as they are not required to load and display PDFs in this context. - -N> For hosting the web service on the Linux platform, ensure to include the [SkiaSharp.NativeAssets.Linux](https://nuget.org/packages/SkiaSharp.NativeAssets.Linux/3.116.1). Additionally, for AWS environments, utilize the following packages: - -| **Amazon Web Services (AWS)** |**NuGet package name** | -| --- | --- | -| AWS Lambda|[SkiaSharp.NativeAssets.Linux](https://nuget.org/packages/SkiaSharp.NativeAssets.Linux/3.116.1)| -| AWS Elastic Beanstalk |[SkiaSharp.NativeAssets.Linux.NoDependencies v3.116.1](https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux.NoDependencies/3.116.1)| - -## See also - -* [Getting Started with Syncfusion® ASP.NET Core using Razor Pages](https://ej2.syncfusion.com/aspnetcore/documentation/getting-started/razor-pages/) -* [Getting Started with Syncfusion® ASP.NET Core MVC using Tag Helper](https://ej2.syncfusion.com/aspnetcore/documentation/getting-started/aspnet-core-mvc-taghelper) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/getting-started.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/getting-started.md deleted file mode 100644 index a77230db1d..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/getting-started.md +++ /dev/null @@ -1,194 +0,0 @@ ---- -layout: post -title: Getting Started with EJ2 ASP.NET Core PDF Viewer Control | Syncfusion -description: Learn how to getting started with PDF Viewer control in ASP.NET Core application. You can view and comment on PDFs in ease and also can fill forms. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Getting Started with ASP.NET Core Standalone PDF Viewer control - -The [ASP.NET Core PDF Viewer](https://www.syncfusion.com/aspnet-core-ui-controls/pdf-viewer) control is used to viewing and printing PDF files in any web application. It provides the best viewing experience available with core interactions such as zooming, scrolling, text searching, text selection, and text copying. Thumbnail, bookmark, hyperlink and table of contents support provides easy navigation within and outside the PDF files. - -This section briefly explains about how to integrate ASP.NET Core PDF Viewer control in your ASP.NET Core application using Visual Studio. - -## Prerequisites - -[System requirements for ASP.NET Core controls](https://ej2.syncfusion.com/aspnetcore/documentation/system-requirements) - -## Integrate PDF Viewer into an ASP.NET Core application - -1. Start Visual Studio and select **Create a new project**. -2. In the **Create a new project** dialog, select **ASP.NET Core Web App**. -![select-aspnet-core-web-app](Core_Images/Select-aspnet-core-project.png) -3. In the **Configure your new project** dialog, enter *Project Name* and select Next. -![Set-project-name](Core_Images/Set-project-name.png) -4. In the **Additional information** dialog, select **.NET 6.0 (Long-term Support) and then select Create**. -![Set-framework](Core_Images/additional-info.png) - -## ASP.NET Core PDF Viewer NuGet package installation - -To add ASP.NET Core PDF Viewer control, the following NuGet package need to be installed in your ASP.NET Core application. - -* [Syncfusion.EJ2.AspNet.Core](https://www.nuget.org/packages/Syncfusion.EJ2.AspNet.Core/) - -## Add Syncfusion® ASP.NET Core Tag Helper - -Open `~/Pages/_ViewImports.cshtml` file and import the `Syncfusion.EJ2` TagHelper. - -{% tabs %} -{% highlight c# tabtitle="~/_ViewImports.cshtml" %} - -@addTagHelper *, Syncfusion.EJ2 - -{% endhighlight %} -{% endtabs %} - -## Add style sheet - -The theme is referred using CDN inside the `` of `~/Pages/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - - -{% endhighlight %} -{% endtabs %} - -N> Checkout the [Themes topic](https://ej2.syncfusion.com/aspnetcore/documentation/appearance/theme) to learn different ways ([CDN](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#cdn-reference), [NPM package](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#node-package-manager-npm), and [CRG](https://ej2.syncfusion.com/aspnetcore/documentation/common/custom-resource-generator)) to refer styles in ASP.NET Core application, and to have the expected appearance for Syncfusion® ASP.NET Core controls. - -## Add script reference - -Add the required scripts using CDN inside the `` of `~/Pages/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - - -{% endhighlight %} -{% endtabs %} - -### Steps to Load PDF Viewer with Local script and style - -To use local resources with your PDF Viewer, follow these steps: - -**Step 1:** Place the `ej2.min.js` script and its related styles in `wwwroot` folder of your ASP.NET Core application. - -**Step 2:** Insert the necessary script and style references within the `` section of your _Layout.cshtml file. Make sure these point to your local copies of the files instead of CDN links. - -By following these steps, you will configure your PDF Viewer to load the required script and style locally. See the code snippet below for reference. - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - - - - -{% endhighlight %} -{% endtabs %} - -## Register Syncfusion® Script Manager - -Open `~/Pages/Shared/_Layout.cshtml` page and register the script manager in the ASP.NET Core application as follows. - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - .... - .... - - - - -{% endhighlight %} -{% endtabs %} - -N> Add the script manager `` at the **end of ``**. - -## Add ASP.NET Core PDF Viewer control - -Add the Syncfusion® ASP.NET Core PDF Viewer tag helper in `~/Pages/Index.cshtml` page. You can load a PDF file in the PDF Viewer by specifying the document name in the documentPath property as below. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -In the above code, - -**ejs-pdfviewer** refers to the PDF Viewer control among the EJ components with id as "pdfviewer". - -**documentPath** is the property needed to load a PDF file in the PDF Viewer. - -### How to Configure PDF Viewer to Use Local Resources - -To utilize the `resourceUrl` and `documentPath` locally with your PDF Viewer, follow these instructions: - -**Step 1:** Ensure that your application includes the `ej2-pdfviewer-lib` folder. This folder must contain the `pdfium.js`, `pdfium.wasm` files, and the PDF file that you intend to display. These should reside in the same location as the `ej2.min.js` script and its related styles. - -**Step 2:** Assign local file paths to the `documentPath` and `resourceUrl` properties within the PDF Viewer setup. The `documentPath` should refer to your PDF file, while the `resourceUrl` should point to the directory containing the supporting resources. - -By following these steps, you will configure your PDF Viewer to load the required resources locally. See the code snippet below for reference. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; - var originUrl = $"{Request.Scheme}://{Request.Host}{Request.PathBase}"; - var document = originUrl + "/PDF_Succinctly.pdf"; - var resourceUrl = originUrl + "/ej2-pdfviewer-lib"; -} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -View the sample in GitHub to [load PDF Viewer with local resources](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Refer%20resource%20url%20locally) - -Press Ctrl+F5 (Windows) or +F5 (macOS) to run the app. Then, the Syncfusion® ASP.NET Core PDF Viewer control will be rendered in the default web browser. - -![ASP.NET Core PDF Viewer Control](Core_Images/pdfviewer-control.png) - -N> [View Sample in GitHub](https://github.com/SyncfusionExamples/ASP-NET-Core-Getting-Started-Examples/tree/main/PDFViewer/ASP.NET%20Core%20Tag%20Helper%20Examples%20-%20Standalone%20PDF%20Viewer). - -## See also - -* [Getting Started with Syncfusion® ASP.NET Core using Razor Pages](https://ej2.syncfusion.com/aspnetcore/documentation/getting-started/razor-pages/) -* [Getting Started with Syncfusion® ASP.NET Core MVC using Tag Helper](https://ej2.syncfusion.com/aspnetcore/documentation/getting-started/aspnet-core-mvc-taghelper) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/globalization.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/globalization.md deleted file mode 100644 index 314a2b5643..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/globalization.md +++ /dev/null @@ -1,561 +0,0 @@ ---- -layout: post -title: Globalization in ##Platform_Name## Pdfviewer Component | Syncfusion -description: Learn here all about Globalization in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Globalization -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Localization in ASP.NET Core PDF Viewer control - -The text contents provided in the PDF Viewer can be localized using the collection of localized strings for different cultures. By default, the PDF Viewer is localized in “__en-US__”. - -The following table shows the default text values used in PDF Viewer in 'en-US' culture: - -|Keywords|Values| -|---|---| -|PdfViewer|PDF Viewer| -|Cancel|Cancel| -|Download file|Download file| -|Download|Download| -|Enter Password|This document is password protected. Please enter a password.| -|File Corrupted|File corrupted| -|File Corrupted Content|The file is corrupted and cannot be opened.| -|Fit Page|Fit page| -|Fit Width|Fit width| -|Automatic|Automatic| -|Go To First Page|Show first page| -|Invalid Password|Incorrect password. Please try again.| -|Next Page|Show next page| -|OK|OK| -|Open|Open file| -|Page Number|Current page number| -|Previous Page|Show previous page| -|Go To Last Page|Show last page| -|Zoom|Zoom| -|Zoom In|Zoom in| -|Zoom Out|Zoom out| -|Page Thumbnails|Page thumbnails| -|Bookmarks|Bookmarks| -|Print|Print file| -|Password Protected|Password required| -|Copy|Copy| -|Text Selection|Text selection tool| -|Panning|Pan mode| -|Text Search|Find text| -|Find in document|Find in document| -|Match case|Match case| -|Apply|Apply| -|GoToPage|Go to page| -|No Matches|Viewer has finished searching the document. No more matches were found| -|No Text Found|No Text Found| -|Undo|Undo| -|Redo|Redo| -|Annotation|Add or Edit annotations| -|Highlight|Highlight Text| -|Underline|Underline Text| -|Strikethrough|Strikethrough Text| -|Delete|Delete annotation| -|Opacity|Opacity| -|Color edit|Change Color| -|Opacity edit|Change Opacity| -|Highlight context|Highlight| -|Underline context|Underline| -|Strikethrough context|Strike through| -|Server error|Web-service is not listening. PDF Viewer depends on web-service for all it's features. Please start the web service to continue.| -|Open text|Open| -|First text|First Page| -|Previous text|Previous Page| -|Next text|Next Page| -|Last text|Last Page| -|Zoom in text|Zoom In| -|Zoom out text|Zoom Out| -|Selection text|Selection| -|Pan text|Pan| -|Print text|Print| -|Search text|Search| -|Annotation Edit text|Edit Annotation| -|Line Thickness|Line Thickness| -|Line Properties|Line Properties| -|Start Arrow|Start Arrow | -|End Arrow|End Arrow| -|Line Style|Line Style| -|Fill Color|Fill Color| -|Line Color|Line Color| -|None|None| -|Open Arrow|Open Arrow| -|Closed Arrow|Closed Arrow| -|Round Arrow|Round Arrow| -|Square Arrow|Square Arrow| -|Diamond Arrow|Diamond Arrow| -|Cut|Cut| -|Paste|Paste| -|Delete Context|Delete Context| -|Properties|Properties| -|Add Stamp|Add Stamp| -|Add Shapes|Add Shapes| -|Stroke edit|Stroke Edit| -|Change thickness|Change Thickness| -|Add line|Add Line| -|Add arrow|Add Arrow| -|Add rectangle|Add Rectangle| -|Add circle|Add Circle| -|Add polygon|Add Polygon| -|Add Comments|Add Comments| -|Comments| Comments| -|No Comments Yet|No Comments Yet| -|Accepted| Accepted| -|Completed| Completed| -|Cancelled| Cancelled| -|Rejected| Rejected| -|Leader Length|Leader Length| -|Scale Ratio|Scale Ratio| -|Calibrate| Calibrate| -|Calibrate Distance|Calibrate Distance| -|Calibrate Perimeter|Calibrate Perimeter| -|Calibrate Area|Calibrate Area| -|Calibrate Radius|Calibrate Radius| -|Calibrate Volume|Calibrate Volume| -|Depth|Depth| -|Closed|Closed| -|Round|Round| -|Square|Square| -|Diamond|Diamond| -|Edit|Edit| -|Comment|Comment| -|Comment Panel|Comment Panel| -|Set Status|Set Status| -|Post|Post| -|Page|Page| -|Add a comment|Add a comment| -|Add a reply|Add a reply| -|Import Annotations|Import Annotations| -|Export Annotations|Export Annotations| -|Add|Add| -|Clear|Clear| -|Bold|Bold| -|Italic|Italic| -|Strikethroughs|Strikethroughs| -|Underlines|Underlines| -|Superscript|Superscript| -|Subscript|Subscript| -|Align left|Align Left| -|Align right|Align Right| -|Center|Center| -|Justify|Justify| -|Font color|Font Color| -|Text Align|Text Align| -|Text Properties|Text Properties| -|Draw Signature|Draw Signature| -|Create| Create| -|Font family|Font Family| -|Font size|Font Size| -|Free Text|Free Text| -|Import Failed|Import Failed| -|File not found|File Not Found| -|Export Failed|Export Failed| -|Dynamic|Dynamic| -|Standard Business|Standard Business| -|Sign Here|Sign Here| -|Custom Stamp|Custom Stamp| -|InitialFieldDialogHeaderText|Initial Field Dialog Header Text| -|HandwrittenInitialDialogHeaderText|Handwritten Initial Dialog Header Text| -|SignatureFieldDialogHeaderText|Signature Field Dialog Header Text| -|HandwrittenSignatureDialogHeaderText|Handwritten Signature Dialog Header Text| -|Draw-hand Signature|Draw-hand Signature| -|Type Signature|Type Signature| -|Upload Signature|Upload Signature| -|Browse Signature Image|Browse Signature Image| -|Save Signature|Save Signature| -|Save Initial|Save Initial| -|highlight|highlight| -|underline|underline| -|strikethrough|strikethrough| -|FormDesigner|Form Designer| -|SubmitForm|Submit Form| -|Search text|Search Text| -|Draw Ink|Draw Ink| -|Revised|Revised| -|Reviewed|Reviewed| -|Received|Received| -|Confidential|Confidential| -|Approved|Approved| -|Not Approved|Not Approved| -|Witness|Witness| -|Initial Here|Initial Here| -|Draft|Draft| -|Final|Final| -|For Public Release|For Public Release| -|Not For Public Release|Not For Public Release| -|For Comment|For Comment| -|Void|Void| -|Preliminary Results|Preliminary Results| -|Information Only|Information Only| -|Enter Signature as Name|Enter Signature as Name| -|Textbox|Textbox| -|Password|Password| -|Check Box|Check Box| -|Radio Button|Radio Button| -|Dropdown|Dropdown| -|List Box|List Box| -|Signature|Signature| -|Delete FormField|Delete FormField| -|FormDesigner Edit text|Form Designer Edit Text| -|in|in| -|m|m| -|ft_in|ft_in| -|ft|ft| -|p|p| -|cm|cm| -|mm|mm| -|pt|pt| -|cu|cu| -|sq|sq| -|General|General| -|Appearance|Appearance| -|Options|Options| -|Textbox Properties|Textbox Properties| -|Name|Name| -|Tooltip|Tooltip| -|Value|Value| -|Form Field Visibility|Form Field Visibility| -|Read Only|Read Only| -|Required|Required| -|Checked|Checked| -|Show Printing|Show Printing| -|Formatting|Formatting| -|Fill|Fill| -|Border|Border| -|Border Color|Border Color| -|Thickness|Thickness| -|Max Length|Max Length| -|List Item|List Item| -|Export Value|Export Value| -|Dropdown Item List|Dropdown Item List| -|List Box Item List|List Box Item List| -|Delete Item|Delete Item| -|Up|Up| -|Down|Down| -|Multiline|Multiline| -|Initial|Initial| -|Export XFDF|Export XFDF| -|Import XFDF|Import XFDF| -|Organize Pages|Organize Pages| -|Insert Right|Insert Right| -|Insert Left|Insert Left| -|Total|Total| -|Pages|Pages| -|Rotate Right|Rotate Right| -|Rotate Left|Rotate Left| -|Delete Page|Delete Page| -|Delete Pages|Delete Pages| -|Copy Page|Copy Page| -|Copy Pages|Copy Pages| -|Save|Save| -|Save As|Save As| -|Select All|Select All| -|Import Document|Import Document| -|Match any word|Match any word| -|Client error|Client-side error is found. Please check the custom headers provided in the AjaxRequestSettings property and web action methods in the ServerActionSettings property| -|Cors policy error|Unable to retrieve the document due to an invalid URL or access restrictions. Please check the document URL and try again| -|No More Matches|Viewer has finished searching the document. No more matches were found| -|No Search Matches|No matches found| -|No More Search Matches|No more matches found| -|Exact Matches|EXACT MATCHES| -|Total Matches|TOTAL MATCHES| - -The different locale value for the PDF Viewer can be specified using the locale property. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -You have to map the text content based on locale like following script in sample level., - -```html - -``` diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/hand-written-signature.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/hand-written-signature.md deleted file mode 100644 index 2bdc98cce1..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/hand-written-signature.md +++ /dev/null @@ -1,218 +0,0 @@ ---- -layout: post -title: Hand Written Signature in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Hand Written Signature in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Hand Written Signature -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Handwritten Signature - -The PDF Viewer control supports adding handwritten signatures to a PDF document. The handwritten signature reduces the paper work of reviewing the content and verifies it digitally. - -The following code snippet describes how to enable the handwritten signature in PDF Viewer. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} -
- - -
- -{% endhighlight %} -{% endtabs %} - -## Adding a handwritten signature to the PDF document - -The handwritten signature can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Select the **HandWritten Signature** button in the annotation toolbar. The signature panel will appear. - -![HandWrittenSignature](./images/handwritten_sign.png) - -* Draw the signature in the signature panel. - -![SignaturePanel](./images/signature_panel.png) - -* Then click **Create** button and move the signature using the mouse and place them in the desired location. - -![SignatureAdded](./images/signature_added.png) - -## Adding a Handwritten signature to the PDF document Programmatically - -With the PDF Viewer library, you can programmatically add a handwritten signature to the PDF Viewer control using the **addAnnotation()** method. - -Here is an example of how you can use the **addAnnotation()** method to add the Handwritten signature programmatically - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - -
- - -
- - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Add%20Handwritten%20Signature%20Programmatically) - -## Editing the properties of handwritten signature - -The stroke color, border thickness, and opacity of the handwritten signature can be edited using the edit stroke color tool, edit thickness tool, and edit opacity tool in the annotation toolbar. - -![SignatureProperties](./images/signature_properties.png) - -Refer to the following code snippet to set the default handwritten signature settings. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - -{% endhighlight %} -{% endtabs %} - - -```html - -``` - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/Instantiate-pdfviewer-dynamically.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/Instantiate-pdfviewer-dynamically.md deleted file mode 100644 index f652e62605..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/Instantiate-pdfviewer-dynamically.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: post -title: Instantiate with EJ2 ASP.NET Core PDF Viewer Control | Syncfusion -description: Learn how to dynamically instantiate the PDF Viewer component in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Instantiate the PDF Viewer component dynamically and load PDF documents -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Instantiate the PDF Viewer component dynamically - -To instantiate a PDF Viewer component dynamically and load PDF documents in Syncfusion® PDF Viewer, use the following steps: - -In your HTML file, create a div element that will act as a container for the PDF Viewer component, and use the jQuery $.ajax method to make an AJAX request to your server and retrieve a PDF document. Once the document is retrieved, use the PDF Viewer API to load the document into the PDF Viewer component. - -Use the serviceUrl property of the PDF Viewer instance to set the URL of a PDF document you want to load. - -```html - -
- -
-
- - - -``` - -In your controller, create an action method that returns a PDF document as an action result. - -[View Sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/Common/Instantiate%20PDF%20Viewer%20dynamically). \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/add-annotation-in-text-search.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/add-annotation-in-text-search.md deleted file mode 100644 index a0789405a5..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/add-annotation-in-text-search.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -layout: post -title: Add Annotation in Text Search in ##Platform_Name## | Syncfusion -description: Learn how to add rectangle annotations using search text bounds in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Retrieve Annotation Coordinates -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Add Rectangle Annotations Using Search Text Bounds in PDF Viewer - -## Overview - -This guide demonstrates how to add rectangle annotations based on the bounds of highlighted search text in the PDF Viewer. This technique is useful for emphasizing search results with visual markers in annotation-supported applications. - -## Steps to Add Rectangle Annotations on Search Result Highlight - -**Step 1:** Set Up the PDF Viewer in Your ASP.NET Core Project - -Follow the steps provided in the [Syncfusion PDF Viewer Getting Started Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started) to create a basic PDF Viewer sample. - -**Step 2:** Set Up the PdfViewer Component to add rectangle annotations based on the bounds of highlighted search text in the PDF Viewer. - - -```cs - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} -
- -
- - - -
- - -
- - -``` - -By following this guide, you will enable the PDF Viewer to add rectangle annotations at search result locations, thus increasing the visibility of search results in your application. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/add-save-button.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/add-save-button.md deleted file mode 100644 index d58980dcb7..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/add-save-button.md +++ /dev/null @@ -1,138 +0,0 @@ ---- -layout: post -title: Add Save Button in Built-In Toolbar | Syncfusion -description: Learn here all about adding save button in built-in Toolbar in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Add Save Button in Built-In toolbar - -PDF Viewer allows you to customize(add, show, hide, enable, and disable) existing items in a toolbar. - -* Save button - New `save` button-item can be defined by **CustomToolbarItemModel** and with existing items in [**ToolbarSettings**](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html) property. Save button-item click action can be defined in `toolbarclick`. - -* Show, Hide - `Save` button-item can be shown or hidden using the [`ToolbarSettings`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html) property. Pre-defined toolbar items are available with [`ToolbarItem`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html#Syncfusion_EJ2_PdfViewer_PdfViewerToolbarSettings_ToolbarItems). - -* Enable, Disable - `Save` button-item can be enabled or disable using `enabletoolbaritem`. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -N> Default value of toolbar items is ['OpenOption', 'PageNavigationTool','MagnificationTool', 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'DownloadOption','UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', 'CommentTool', 'SubmitForm'] - -### Align Property - -The align property is used to specify the alignment of a `save` button-item within the toolbar. - -`Left`: Aligns the item to the left side of the toolbar. -`Right`: Aligns the item to the right side of the toolbar. - -### Tooltip Property - -The tooltip property is used to set the tooltip text for a `save` button-item. Tooltip provides additional information when a user hovers over the item. - -### CssClass Property - -The cssClass property is used to apply custom CSS classes to a `save` button-item. It allows custom styling of the save button-item. - -### Prefix Property - -The prefix property is used to set the CSS class or icon that should be added as a prefix to the existing content of the toolbar item. - -### ID Property - -The id property within a CustomToolbarItemModel is a compulsory attribute that plays a vital role in toolbar customization. It serves as a unique identifier for each toolbar item, facilitating distinct references and interactions. - -When defining or customizing toolbar items, it is mandatory to assign a specific and descriptive id to each item. -These properties are commonly used when defining custom toolbar items with the `CustomToolbarItemModel`` in the context of Syncfusion® PDF Viewer. When configuring the toolbar using the `ToolbarSettings`` property, you can include these properties to customize the appearance and behavior of each toolbar item. - -N> When customizing `save` button-item, you have the flexibility to include either icons or text based on your design preference. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/authorization-token.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/authorization-token.md deleted file mode 100644 index f0f22c48eb..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/authorization-token.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -layout: post -title: Authorization Token in ##Platform_Name## Pdfviewer Component -description: Learn here all about Authorization Token in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Authorization Token -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Include the Authorization token - -The PDF Viewer library allows you to include the authorization token in the PDF viewer AJAX request using the properties of the ajaxRequest header available in `AjaxRequestSettings`, and it will be included in every AJAX request send from PDF Viewer. - -The following steps are used to include the authorization token to the PDF viewer control. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample in React. - -**Step 2:** Add the following code snippet to include the authorization token. - -```html - -``` - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Include%20the%20Authorization%20token) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/capture-page-number.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/capture-page-number.md deleted file mode 100644 index 71c525e638..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/capture-page-number.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -layout: post -title: Capture Page Number in ##Platform_Name## Pdfviewer Component -description: Learn here all about Capture Page Number in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Capture Page Number -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Capture the current page number being viewed - -The PDF Viewer server library allows you to capture the page number that is currently being viewed in the load PDF document. Use the [**currentPageNumber**](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/#currentpagenumber) property to get the page number which is currently in view. - -The following steps are used to capture the current page number. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to Capture the current page number being viewed. - - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Capture%20the%20current%20page%20number) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/configure-annotation-selector-setting.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/configure-annotation-selector-setting.md deleted file mode 100644 index 0cc231dbcd..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/configure-annotation-selector-setting.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -layout: post -title: AnnotationSelector Setting in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Configuring AnnotationSelector setting in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# How to Configure Annotation Selector Settings - -### Annotation Selector Settings - -The [**annotationSelectorSettings**](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerAnnotationSelectorSettings.html) property allows you to customize the appearance and behavior of the annotation selector in the UI. The AnnotationSelectorSettings defines the settings for the annotation selector, including border colors, sizes, and shapes. It provides fine-grained control over how annotations are displayed and interacted with. - -### How to Configure Annotation Selector Settings - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample. - -**Step 2:** Set Up PDF Viewer in Your View: Add the following code snippet to your view (e.g., Index.cshtml) - -``` -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
-``` - -**Step 3:** Add JavaScript for Annotation Selector Settings: Below the PDF Viewer in your view, include the following script to configure the annotationSelectorSettings - -``` - -``` -#### Key properties include: - -* **selectionBorderColor**: Sets the color for the border around selected annotations. - -* **resizerBorderColor**: Sets the color for the border of the resizer handles. - -* **resizerFillColor**: Defines the fill color for the resizer handles. - -* **resizerSize**: Determines the size of the resizer handles. - -* **selectionBorderThickness**: Specifies how thick the selection border should be. - -* **resizerShape**: Allows you to choose the shape of the resizer handles (e.g., Circle or Square). - -* **selectorLineDashArray**: Specifies the dash pattern for the selector line to enhance visual cues. - -* **resizerLocation**: Determines where the resizer appear in relation to the annotation (e.g., Corners or Edges). - -* **resizerCursorType**: Sets the cursor style when hovering over the resizer, improving user interaction. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/control-annotation-visibility.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/control-annotation-visibility.md deleted file mode 100644 index 0ed50c0f6c..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/control-annotation-visibility.md +++ /dev/null @@ -1,114 +0,0 @@ ---- -layout: post -title: Annotations Visibility in EJ2 ASP.NET Core PdfViewer | Syncfusion -description: Learn here how to Control PDF Annotations Visibility ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Control PDF Annotations Visibility in PDF Viewer - -### Overview - -This guide demonstrates how to control the visibility of PDF annotations in documents loaded and saved using the Syncfusion PDF Viewer. This process allows the annotations to be visible only in the Syncfusion PDF Viewer. - -### How to Control Annotation Visibility - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Set Up Your ASP.NET Core Component - -Create an ASP.NET Core component and update the template to include a button that triggers the download operation. Additionally, create a function to save the document with the PDF annotation flag set to `noView`. - - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -By following these steps, the annotations in a PDF document can be set to be visible in the Syncfusion PDF Viewer, providing control over annotation visibility based on different platforms. - -[View Sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md deleted file mode 100644 index a827db7371..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -layout: post -title: Converting Library Bounds in EJ2 ASP.NET Core PdfViewer | Syncfusion -description: Learn how to convert Library bounds into Viewer bounds in ASP.NET Core Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Converting PDF Library Bounds to PDF Viewer Bounds - -### Overview - -When exporting annotations from the PDF Library, you may need to convert the bounds values into the PDF Viewer format. This guide will help you achieve that using the Syncfusion PDF Viewer component. - -### How to Convert Bounds Values - -**Step 1:** Initialize the PdfViewer Instance - -Create an instance of the PdfViewer and configure it with the required services. - -**Step 2:** Handle Export Success - -Convert the exported blob URL to an object and then extract and convert the annotation bounds. - -**Step 3:** Create a Function to Convert Blob URL to Object - -This function fetches the blob data and converts it into a JSON object. - -{% tabs %} -{% highlight cshtml tabtitle="Server-Backed" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -### Conclusion - -By following these steps, you can successfully convert PDF Library bounds values into PDF Viewer bounds values when exporting annotations as JSON. This will help maintain accuracy in the annotation placement and ensure a seamless user experience. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/custom-context-menu.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/custom-context-menu.md deleted file mode 100644 index 8b85d16d98..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/custom-context-menu.md +++ /dev/null @@ -1,375 +0,0 @@ ---- -layout: post -title: Customize context menu with EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn here all about Customize context menu in ASP.NET Core Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Customize context menu in ASP.NET Core PDF Viewer control - -PDF Viewer allows you to add custom option in context menu. It can be achieved by using the `addCustomMenu()` method and custom action is defined using the `customContextMenuSelect()`method. - -### Add Custom Option - -The following code shows how to add custom option in context menu. -``` - -``` - -### Customize custom option in context menu - -The PDF Viewer feature enables customization of custom options and the ability to toggle the display of the default context menu. When the addCustomMenu parameter is set to `true`, the default menu is hidden; conversely, when it is set to `false`, the default menu items are displayed. - -``` - -``` - -#### Customize added context menu items - -The following code shows how to hide/show added custom option in context menu using the `customContextMenuBeforeOpen()` method. - -``` - -``` - -The following is the output of custom context menu with customization. - -``` - - - -``` - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Custom%20Context%20Menu/PDFViewerSample) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/custom-font-signature-field.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/custom-font-signature-field.md deleted file mode 100644 index d7fd80081e..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/custom-font-signature-field.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -layout: post -title: How to change the font family in Syncfusion ASP .NETCORE. -description: Learn how to change the font family in Form Field's Type Signature in Syncfusion ASP .NETCORE Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# To Change the Font Family -Change the Font Family in Type Signature of the Syncfusion® PDF Viewer by adding a custom css stylesheet to the document , and then apply the desired font family to the type signature element. Include the Google font link in the HTML head section to apply the Google Font. - -### Signature Field property -The Syncfusion® PDF Viewer provides the ability to change the font family for Signature and Initial Field using `typeSignatureFonts` and `typeInitialFonts` property. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Insert the following code snippet to implement the functionality for using custom fonts in Signature field. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html - - - - -``` - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -### Initial Field property -Insert the following code snippet to implement the functionality for using custom fonts in Initial field. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} -```html - - - - -``` - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -By implementing this , you can use custom fonts in form field's signature in both `signature` and `initial` field \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/custom-fonts.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/custom-fonts.md deleted file mode 100644 index 61b0a695ea..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/custom-fonts.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: post -title: Add custom fonts to the PDF Viewer using the PDF document | Syncfusion -description: Learn here all about how to add custom fonts using the PDF document in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# How to add custom fonts to the PDF viewer used in the PDF document - -To use custom fonts in the Syncfusion® PDF Viewer within your PDF document, you need to add the custom TTF font files to the resource URL directory and configure the viewer to load these fonts. You can specify the custom font names using the -**customFonts** property, which accepts an array of font names. - -The following steps are used to customize the selection border. - -**Step 1:** Add the custom TTF font files to the resource URL path referenced in your application. For example, place the custom TTF files in the ej2-pdfviewer-lib folder, which will serve as the resource URL path. - -**Step 2:** The following code snippet are how you can add custom fonts to the PDF viewer. - -```html - -
- -
-
- - - -``` - -By following these steps, you can successfully integrate and use custom fonts in your PDF documents displayed in the EJ2 PDF Viewer. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/delete-a-specific-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/delete-a-specific-annotation.md deleted file mode 100644 index 80f8433789..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/delete-a-specific-annotation.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -layout: post -title: Delete A Specific Annotation in ##Platform_Name## Pdfviewer Component -description: Learn here all about Delete A Specific Annotation in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Delete A Specific Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Delete a specific annotation using deleteAnnotationById - -The PDF Viewer server library allows you to delete a specific annotation from PDF document. Deleting a specific annotation can be done using the **deleteAnnotationById()** method. This method is used to delete a specific annotation using its id. - -The following steps are used to delete a specific annotation from PDF Document. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to delete a specific annotation using deleteAnnotationById() method. - - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Delete%20a%20specific%20annotation%20using%20deleteAnnotationById) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/display-document-without-downloading.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/display-document-without-downloading.md deleted file mode 100644 index 35e9cb7f82..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/display-document-without-downloading.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -layout: post -title: Display Document Without Downloading in ##Platform_Name## Pdfviewer Component -description: Learn here all about Display Document Without Downloading in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Display Document Without Downloading -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Display document without downloading - -The PDF Viewer server library allows you to display the downloaded PDF document in the PDF Viewer control without downloading a document in the local machine using the **load** method. - -The following steps are used to display the downloaded without downloading in the local machine. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to Display document without downloading. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Display%20document%20without%20downloading) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/download-start-event.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/download-start-event.md deleted file mode 100644 index cd53da616b..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/download-start-event.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -layout: post -title: Controlling File Downloads in EJ2 ASP.NET Core PDF Viewer| Syncfusion -description: Learn here how to Controlling File Downloads in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Controlling File Downloads in Syncfusion® PDF Viewer - -In the Syncfusion® PDF Viewer, we've introduced a new feature that enables you to manage file downloads more effectively. This feature allows you to intercept and potentially skip the download process of a PDF document, providing enhanced control over user interactions within your application. - -### Using the downloadStart Event - -The key to this functionality lies in the downloadStart event, which offers a mechanism to intercept the initiation of the download process. Within the event handler, you can set the cancel argument to true to programmatically prevent the download action from proceeding. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -By default, the cancel argument is set to `false`, indicating that the download action will proceed unless explicitly canceled by your custom logic. - -### Enhanced Flexibility - -By leveraging the `downloadStart` event and its cancel argument, you gain the ability to implement custom logic to control and potentially prevent download actions based on your application's specific requirements. This enhancement provides greater flexibility in managing user interactions with PDF documents, empowering you to tailor the experience according to your needs. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/enable-local-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/enable-local-storage.md deleted file mode 100644 index 788984c84d..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/enable-local-storage.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -layout: post -title: Managing Local Storage in ASP.NET Core PDF Viewer Control | Syncfusion -description: Learn how to manage local storage in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-angular -control: PDF Viewer -documentation: ug -domainurl: ##DomainURL## ---- - -# Managing Local Storage in Syncfusion PDF Viewer - -The Syncfusion PDF Viewer provides the `enableLocalStorage` property, which allows you to control how session-specific data is stored. You can choose to store this data in an internal collection or rely on the default session storage. - -### Using the enableLocalStorage Property - -Set the `enableLocalStorage` property to manage whether the PDF Viewer uses session storage (default) or an internal collection. When set to `true`, session-specific data is kept in memory. Otherwise, session storage is used. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -### Impact and Considerations - -- **Increased Memory Usage**: Setting `enableLocalStorage` to `true` can increase memory usage, particularly with larger documents or those containing many interactive elements, such as form fields and annotations. -- **Avoiding Memory Leaks**: It is crucial to properly dispose of the PDF Viewer instance when it's no longer needed to prevent memory leaks, especially when using in-memory storage. -- **Default Behavior**: By default, this property is set to `false`, meaning the session storage mechanism is utilized unless explicitly changed. - -### Enhanced Control - -Leveraging the `enableLocalStorage` property provides greater flexibility in managing how data is stored during a session, allowing you to optimize performance and storage based on your application’s specific requirements. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/enable-text-selection.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/enable-text-selection.md deleted file mode 100644 index 12b4e9e4f5..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/enable-text-selection.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -layout: post -title: Enable or Disable Text Selection in ASP.NET Core PDF Viewer | Syncfusion -description: Learn how to enable text selection in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -documentation: ug -domainurl: ##DomainURL## ---- - -# Enable or Disable Text Selection in Syncfusion PDF Viewer - -The Syncfusion PDF Viewer provides the `enableTextSelection` property, which allows you to control whether users can select text within the displayed PDF document. This feature can be toggled programmatically during runtime. - -## Configure Text Selection on Initialization - -You can set the initial text selection behavior when initializing the PDF Viewer control by configuring the `enableTextSelection` property. By default, text selection is enabled, but you can disable it as shown in the following example: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## Toggle Text Selection Dynamically - -You can change the text selection behavior at runtime using buttons, menu options, or other UI elements. The following example demonstrates how to toggle text selection with button clicks: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - - - -
- - - -{% endhighlight %} -{% endtabs %} - -## Use Cases and Considerations - -- **Document Protection**: Disabling text selection helps prevent unauthorized copying of sensitive content. -- **Read-only Documents**: In scenarios where documents are meant for viewing only, disabling text selection can provide a cleaner user experience. -- **Interactive Applications**: Toggle text selection based on user roles or document states in complex applications. -- **Controlled Access**: Implement conditional text selection depending on user permissions or document sections. - -## Default Behavior - -By default, text selection is enabled in the PDF Viewer. Set the `enableTextSelection` property to `false` explicitly if you want to disable this functionality. - -N> When text selection is disabled, users will not be able to select or copy text from the document, which can be useful for protecting document content in certain scenarios. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/export-as-image-standalone.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/export-as-image-standalone.md deleted file mode 100644 index cf0096a1fc..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/export-as-image-standalone.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -layout: post -title: Export As Image in EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn here all about Export As Image in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Export As Image from PDF document - -The PDF Viewer library allows you to export specified pages as a Base64-encoded image string using the **exportAsImage()** method and exporting a range of pages as Base64-encoded image strings using the **exportAsImages()** method. - -The following steps are used to exportAsImage. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** The following code snippet to implement the functionality for exporting a specified page as a Base64-encoded image string or exporting a range of pages as Base64-encoded image strings. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -Similarly, to code snippet for exports the specified page as a Base64-encoded image string, allowing for custom image size: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -Similarly, to code snippet for exports the range of pages as Base64-encoded image strings: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -Similarly, to code snippet for exports the range of pages as Base64-encoded image strings, allowing for custom image size: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -By following these steps, you can successfully integrate and use the export as image API in the EJ2 PDF Viewer. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/export-as-image.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/export-as-image.md deleted file mode 100644 index 5a90cd9a23..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/export-as-image.md +++ /dev/null @@ -1,191 +0,0 @@ ---- -layout: post -title: Export As Image with EJ2 ASP.NET Core PDF Viewer Control | Syncfusion -description: Learn here all about Export As Image in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Export As Image -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Export as Image in ASP.NET Core PDF Viewer control - -The PDF Viewer server library allows the PDF document pages to be exported as raster images. Exporting can be done using the ExportAsImage() method. This option helps to convert a PDF into an image. The APIs available to export the PDF document pages as images are listed as follows: - -## ExportAsImage(int pageindex) - -Exports the specified page as image using the Pdfium rendering engine. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory\..\..\..\..\Data\HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap bitmapimage = pdfExportImage.ExportAsImage(0); -//Save the exported image in disk -bitmapimage.Save(@"currentDirectory\..\..\..\..\Images\" + "bitmapImage" + i.ToString() + ".png"); - -``` - -## ExportAsImage(int pageIndex, float dpiX, float dpiY) - -Exports the specified page as image with respect to the specified DPI values. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory\..\..\..\..\Data\HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap bitmapimage = pdfExportImage.ExportAsImage(0, 200, 200); -//Save the exported image in disk -bitmapimage.Save(@"currentDirectory\..\..\..\..\Images\" + "bitmapImage" + i.ToString() + ".png"); - -``` - -## ExportAsImage(int pageIndex, SizeF customSize, bool keepAspectRatio) - -Exports the specified page as image with respect to the specified custom size. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory\..\..\..\..\Data\HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap bitmapimage = pdfExportImage.ExportAsImage(0, new SizeF(200, 300), true); -//Save the exported image in disk -bitmapimage.Save(@"currentDirectory\..\..\..\..\Images\" + "bitmapImage" + i.ToString() + ".png"); - -``` - -## ExportAsImage(int pageIndex, SizeF customSize, float dpiX, float dpiY, bool keepAspectRatio) - -Exports the specified page as image with respect to the custom size and the specified DPI values. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory\..\..\..\..\Data\HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap bitmapimage = pdfExportImage.ExportAsImage(0, new SizeF(200, 300),200,200, true); -//Save the exported image in disk -bitmapimage.Save(@"currentDirectory\..\..\..\..\Images\" + "bitmapImage" + i.ToString() + ".png"); - -``` - -## ExportAsImage(int startIndex, int endIndex) - -Exports the specified pages as images using the Pdfium rendering engine. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory\..\..\..\..\Data\HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap[] bitmapimage = pdfExportImage.ExportAsImage(0, pdfExportImage.PageCount-1); -for (int i = 0; i < pdfExportImage.PageCount; i++) -{ - // Save the exported image in disk - bitmapimage[i].Save(@"currentDirectory\..\..\..\..\Images\" + "bitmapImage" + i.ToString() + ".png"); -} - -``` - -## ExportAsImage(int startIndex, int endIndex, float dpiX, float dpiY) - -Exports the specified pages as images with respect to the specified DPI values. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory\..\..\..\..\Data\HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap[] bitmapimage = pdfExportImage.ExportAsImage(0, pdfExportImage.PageCount-1, 200, 200); -for (int i = 0; i < pdfExportImage.PageCount; i++) -{ - //Save the exported image in disk - bitmapimage[i].Save(@"currentDirectory\..\..\..\..\Images\" + "bitmapImage" + i.ToString() + ".png"); -} - -``` - -## ExportAsImage(int startIndex, int endIndex, SizeF customSize, bool keepAspectRatio) - -Exports the specified pages as images with respect to the specified custom size. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory\..\..\..\..\Data\HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap[] bitmapimage = pdfExportImage.ExportAsImage(0, pdfExportImage.PageCount-1, new SizeF(200, 300), false); -for (int i = 0; i < pdfExportImage.PageCount; i++) -{ - //Save the exported image in disk - bitmapimage[i].Save(@"currentDirectory\..\..\..\..\Images\" + "bitmapImage" + i.ToString() + ".png"); -} - -``` - -## ExportAsImage(int startIndex, int endIndex, SizeF customSize, float dpiX, float dpiY, bool keepAspectRatio) - -Exports the specified pages as images with respect to the custom size and the specified DPI values. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory\..\..\..\..\Data\HTTP Succinctly.pdf"); -//Exports the PDF document pages into images -Bitmap[] bitmapimage = pdfExportImage.ExportAsImage(0, pdfExportImage.PageCount-1, new SizeF(200, 300),200,200,false); -for (int i = 0; i < pdfExportImage.PageCount; i++) -{ - //Save the exported image in disk - bitmapimage[i].Save(@"currentDirectory\..\..\..\..\Images\" + "bitmapImage" + i.ToString() + ".png"); -} - -``` -## Export as Image in ASP.NET Core 6.0 - -To export a PDF to image in ASP.NET Core 6.0 using Syncfusion® PDF Viewer and Skia Bitmap, you can follow these steps: - -Create an instance of PdfRenderer in the controller, and create an instance of SKBitmap to get the bitmap representation of the page. Exporting can be done using the `ExportAsImage()` method. This method helps to convert a PDF into an image. Use the SKImage class to save the SKBitmap object as a PNG image, and use the `SaveTo` method of the SKBitmap to save the image to a file. Return the image file in the response. - -Here is a sample that shows how to export as image in ASP.NET Core 6.0 : - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExportImage = new PdfRenderer(); -//Loads the PDF document -pdfExportImage.Load(@"currentDirectory\..\..\..\..\Data\hive_succinctly.pdf"); -//Exports the PDF document pages into images -SKBitmap bitmapimage = pdfExportImage.ExportAsImage(0); -SKImage image = SKImage.FromBitmap(bitmapimage); -using (var stream = new FileStream(Path.Combine(@"currentDirectory\..\..\..\..\Data\Page1.png"), FileMode.Create)) - {//Save the exported image in disk - var imageData = image.Encode(SKEncodedImageFormat.Png, 100); - imageData.SaveTo(stream); - } - var imageFileStream = System.IO.File.OpenRead(Path.Combine(@"currentDirectory\..\..\..\..\Data\Page1.png")); - return File(imageFileStream, "image/png"); - -``` - -[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) - -N> Ensure the provided document path and output image saved locations in your application level. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text-completed.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text-completed.md deleted file mode 100644 index 16fbf47cc9..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text-completed.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -layout: post -title: extractTextCompleted Event in Syncfusion ##Platform_Name## Pdfviewer Component -description: Learn here all about extractTextCompleted Event in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Extract Text Completed -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Extract text using extractTextCompleted Event - -The PDF Viewer library allows you to extract the text from a page along with the bounds. Text extraction can be done using the **isExtractText** property and [**extractTextCompleted**](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_ExtractTextCompleted) event. `extractTextCompleted` event Triggers when an text extraction is completed in the PDF Viewer. - -Here is an example of how you can use the extractTextCompleted event: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text-option.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text-option.md deleted file mode 100644 index ccde319baf..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text-option.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -layout: post -title: Extract text Option in ASP.NET Core PDF Viewer Control | Syncfusion -description: Learn here all about Extract text Option in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -documentation: ug -domainurl: ##DomainURL## ---- - -# Extract Text Option in Syncfusion PDF Viewer - -The `extractTextOption` property in the Syncfusion PdfViewer control allows you to optimize memory usage by controlling the level of text extraction. This setting influences the data returned in the `extractTextCompleted` event. You can select one of the following options to determine the kind of text extraction and layout information to retrieve. - -### Available Options: - -**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. - -**TextOnly:** Extracts only the plain text from the document. This option excludes any layout or positional information. - -**BoundsOnly:** Extracts layout information, such as bounds or coordinates, without including the plain text data. - -**TextAndBounds:** Extracts both the plain text and the layout (bounds) information, which is the default behavior. - -The following example demonstrates how to configure the `extractTextOption` property to control the level of text extraction: - - - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -### Description of Each Option -**extractTextOption.TextAndBounds (default):** This option returns both plain text and its positional data (bounds). Use this option when you need to access both the content of the PDF and its layout for further processing or analysis. - -**extractTextOption.TextOnly:** This option returns only the plain text from the PDF. No positional or layout data is included. Note that when using this option, text search functionality will be disabled. In such cases, it is recommended to use findTextAsync for text searching. - -**extractTextOption.BoundsOnly:** This option returns only the layout information (bounds) of the text, excluding the actual content. It is useful when the focus is on the position of text elements rather than the text itself. - -**extractTextOption.None:** This option does not extract or return any text or layout information. It is used to optimize memory usage when no text extraction is necessary. This setting is only relevant for the `extractTextCompleted` event and cannot be used with the `ExtractText` method. - -N> Text Search: When using the `extractTextOption.TextOnly` and `extractTextOption.None` option, the findText method will not work. Instead, you should use the findTextAsync method to perform text searches asynchronously. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text-using-text-collections.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text-using-text-collections.md deleted file mode 100644 index 802040e388..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text-using-text-collections.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -layout: post -title: Extract Text in Syncfusion ##Platform_Name## Pdfviewer Component -description: Learn here all about Extract Text Using Text Collections in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Extract Text Using Text Collections -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Extract Text using TextLineCollection - -The PDF Viewer server library allows you to extract the text from a page along with the bounds using TextLineCollection. Text extracting can be done using the **ExtractText()** method. - -Add the following dependency to your application using the `NuGet Package Manager`. -* Syncfusion.EJ2.PdfViewer.AspNet.Core - -N>From Volume 2 2019 release Syncfusion.Pdf.Net.Core and Syncfusion.Compression.Net.Core packages are added as dependency for PDF Viewer control. Ensure the dependency packages are referred in your application properly. - -The following code snippet explains how to extract the text from a page using TextLineCollection. - -```cs - -var path = @"currentDirectory\..\..\..\..\Data\Simple.pdf"; -var fileInfo = new FileInfo(path); -var docStream = new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read); -// Load the PDF document. -PdfLoadedDocument document = new PdfLoadedDocument(docStream); -// Loading page collections -PdfPageBase page = document.Pages[0] as PdfLoadedPage; -//Extract text from the page. -var text = page.ExtractText(out TextLineCollection textLineCollection); - -``` - -Find the sample [How to extract text using TextLineCollection](https://www.syncfusion.com/downloads/support/directtrac/general/ze/EXTRAC~21056703041) - -N>Ensure the provided document path and output text saved locations in your application level. diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text.md deleted file mode 100644 index aa12fefd13..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/extract-text.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -layout: post -title: Extract Text in Syncfusion ##Platform_Name## Pdfviewer Component -description: Learn here all about Extract Text in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Extract Text -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Extract Text from PDF document -## Extract Text in server backed mode. - -The PDF Viewer server library allows you to extract the text from a page along with the bounds. Text extracting can be done using the ExtractText() method. Add the following dependency to your application using the `NuGet Package Manager`. -* Syncfusion.EJ2.PdfViewer.AspNet.Core - -N>From Volume 2 2019 release Syncfusion.Pdf.Net.Core and Syncfusion.Compression.Net.Core packages are added as dependency for PDF Viewer control. Ensure the dependency packages are referred in your application properly. - -The following code snippet explains how to extract the text from a page. - -```cs - -//Uses the Syncfusion.EJ2.PdfViewer assembly -PdfRenderer pdfExtractText = new PdfRenderer(); -pdfExtractText.Load(@"currentDirectory\..\..\..\..\Data\HTTP Succinctly.pdf"); -//Returns the bounds of the text -List textCollection = new List(); -//Extracts the text from the first page of the PDF document along with its bounds -string text = pdfExtractText.ExtractText(0, out textCollection); -System.IO.File.WriteAllText(@"currentDirectory\..\..\..\..\Data\data.txt", text); - -``` - -Sample: -[http://www.syncfusion.com/downloads/support/directtrac/general/ze/ExtractText-1972118166](http://www.syncfusion.com/downloads/support/directtrac/general/ze/ExtractText-1972118166) - -N>Ensure the provided document path and output text saved locations in your application level. - -## Extract Text Method in standalone mode - -The `extractText` method of the Syncfusion PdfViewer control enables text extraction from one or more pages in a PDF document. This method is useful for retrieving the text content along with its associated data, such as the bounds of each text element. - -### extractText Method -The extractText method retrieves text data from the specified page(s) of a PDF document. It can extract text from one page, a range of pages, or even provide detailed text data, depending on the options specified. - -#### Parameters: -**startIndex:** The starting page index for text extraction (0-based index). - -**endIndex Or isOptions:** This can either be the ending page index for the text extraction (for extracting from multiple pages) or an option specifying text extraction criteria for a single page. - -**options (optional):** Specifies additional options, such as extracting plain text `TextOnly` or more detailed text data `TextAndBounds`. You can specify various options for text extraction. These options determine whether you want to extract plain text, text with bounds, or detailed text data. - -***TextOnly:*** Extracts only the plain text content without bounds or additional information. - -***TextAndBounds:*** Extracts text content along with its bounds (coordinates) within the PDF. - -#### Returns: -The method returns a Promise that resolves to an object containing two properties: - -**textData:** An array of TextDataSettingsModel objects, each representing the details of the extracted text (including bounds, page text, etc.). - -**pageText:** A concatenated string of plain text extracted from the specified page(s). - -### Usage of extractText in Syncfusion PdfViewer Control -Here is an example that demonstrates how to use the extractText method: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - - - -
- - - -{% endhighlight %} -{% endtabs %} - -#### Explanation: -**Single Page Extraction:** The first `extractText` call extracts text from page 1 (`startIndex = 1`), using the 'TextOnly' option for plain text extraction. - -**Multiple Pages Extraction:** The second extractText call extracts text from pages 0 through 2 (`startIndex = 0, endIndex = 2`), using the `TextOnly` option for plain text extraction. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/find-text-async.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/find-text-async.md deleted file mode 100644 index f018ba2962..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/find-text-async.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -layout: post -title: Find Text Async in EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn about the `findTextAsync` in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Find Text using findTextAsync Method in Syncfusion PdfViewer - -The findTextAsync method in the Syncfusion PdfViewer control allows you to search for specific text or an array of strings asynchronously within a PDF document. The method returns the bounding rectangles for each occurrence of the search term, allowing you to find and work with text positions in the document. - -Here is an example of how you can use the **findTextAsync** method: - - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - - - -
- - - -{% endhighlight %} -{% endtabs %} - - -### Description: - -The `findTextAsync` method is designed for performing an asynchronous text search within a PDF document. You can use it to search for a single string or multiple strings, with the ability to control case sensitivity. By default, the search is applied to all pages of the document. However, you can adjust this behavior by specifying the page number (pageIndex), which allows you to search only a specific page if needed. - -### Parameters: - -**text (string | string[]):** - -The text or an array of texts you want to search for in the document. - -**matchCase (boolean):** - -Indicates whether the search should be case-sensitive. -When set to true, the search will match the exact case. -When set to false, the search will ignore case differences. - -**pageIndex (optional, number):** - -Specifies the page number (zero-based index) to search within the document. -If not provided, the search will be performed across all pages in the document. -For example, passing 0 would search only the first page of the document. - -### Example Workflow: - -**findTextAsync('pdf', false):** -This will search for the term "pdf" in a case-insensitive manner across all pages of the document. - -**findTextAsync(['pdf', 'the'], false):** -This will search for the terms "pdf" and "the" in a case-insensitive manner across all pages of the document. - -**findTextAsync('pdf', false, 0):** -This will search for the term "pdf" in a case-insensitive manner only on the first page (page 0). - -**findTextAsync(['pdf', 'the'], false, 1):** -This will search for the terms "pdf" and "the" in a case-insensitive manner only on the second page (page 1). - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/get-base64.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/get-base64.md deleted file mode 100644 index a3fcdcff5a..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/get-base64.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -layout: post -title: Retrieving Base64 Value in EJ2 ASP.NET CORE PdfViewer | Syncfusion -description: Learn how to retrieve the Base64 value in the Syncfusion ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Retrieving Base64 Value from a PDF in PDF Viewer -### Overview - -This guide demonstrates how to fetch the base64-encoded value of a PDF document loaded in the Syncfusion PDF Viewer using ASP.NET CORE. This feature is beneficial for transferring the PDF data as a Base64 string or performing client-side processing. - -### How to Retrieve Base64 Value - -**Step 1:** Set Up the PdfViewer in Your ASP.NET MVC Project - - Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Add Button and Function for Fetching Base64 Value - -Incorporate a button in your view to enable users to start the process of converting the loaded PDF document into a Base64 string. - -```html -
- - - - -
- - - -``` -### Conclusion - -By following these steps, you can easily convert and retrieve a PDF document's Base64 string. This conversion is particularly useful for transmitting PDF data or integrating with systems that require Base64 encoding. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/get-page-info.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/get-page-info.md deleted file mode 100644 index 031e305fcf..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/get-page-info.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -layout: post -title: Get Page Info with EJ2 ASP.NET Core PDF Viewer Control | Syncfusion -description: Learn here all about Get Page Info in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Get Page Info in ASP.NET Core PDF Viewer control - -The PDF Viewer library allows you to retrieves the information of a specified page in the viewer using the **getPageInfo()** method.This provides essential information such as the height, width and rotation. - -The following steps are used to getPageInfo. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** The following code snippet to implement the functionality for retrieving height, width and rotation of a specified page in the viewer. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - - -
- - - -{% endhighlight %} -{% endtabs %} - -By following these steps, you can successfully integrate and use the get page info API in the EJ2 PDF Viewer. - -[View Sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/import-export-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/import-export-annotation.md deleted file mode 100644 index 99c9ec1624..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/import-export-annotation.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -layout: post -title: Import Export Annotation in ##Platform_Name## Pdfviewer Component | Syncfusion -description: Learn here all about Import Export Annotation Object in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Import Export Annotation Object -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Import and Export annotation - -The PDF Viewer library allows you to import annotations from objects or streams instead of loading it as a file. To import such annotation objects, the PDF Viewer control must export the PDF annotations as objects using the [**ExportAnnotationsAsObject()**](https://ej2.syncfusion.com/documentation/api/pdfviewer/#exportannotationsasobject) method. Only the annotations objects that are exported from the PDF Viewer can be imported. - -The following steps are used to import and export annotations in various formats such as objects, JSON, and XFDF. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to perform import and export annotation. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - - - - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - - - - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Import%20and%20Export%20annotation%20as%20object) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/install-packages.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/install-packages.md deleted file mode 100644 index a777962b84..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/install-packages.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -layout: post -title: Install Packages in Syncfusion ##Platform_Name## Pdfviewer Component -description: Learn here all about Install Packages in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Install Packages -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Install EJ2 PDF Viewer packages automatically - -You can install the EJ2 PDF Viewer packages automatically based by adding the PDF Viewer NuGet packages in your csproj file. When building the project, the required NuGet will be installed. - -```cs - -``` diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/load-documents.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/load-documents.md deleted file mode 100644 index 52b8a71454..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/load-documents.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -layout: post -title: Load Documents in ##Platform_Name## Pdfviewer Component -description: Learn here all about Load Documents in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Load Documents -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Load PDF documents dynamically - -The PDF Viewer server library allows to switch or load the PDF documents dynamically after the initial load operation. To achieve this, load the PDF document as a base64 string or file name in PDF Viewer control using the **Load()** method dynamically. - -The following steps are used to load the PDF document dynamically. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to load PDF document using base64 string. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -**Step 3:** Use the following code snippet to load PDF document using document name. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cs tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Load%20PDF%20documents%20dynamically) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/load-n-number-page.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/load-n-number-page.md deleted file mode 100644 index aff40ac82f..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/load-n-number-page.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -layout: post -title: Load N number of pages on initial loading in ##Platform_Name## Pdfviewer Component -description: Learn here all about Load N number of pages on initial loading in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Load N number of pages on initial loading -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Load N number of pages on initial loading - -The initial rendering in a PDF viewer allows users to control the number of pages displayed when opening a PDF document. This improves the user experience by providing flexibility in loading a specific number of pages initially, while additional pages are dynamically rendered as the user scrolls through the document. This approach enhances the responsiveness of the PDF viewer and minimizes delays as users can access specific pages without waiting for the entire document to load. - -To utilize this capability in Syncfusion® PDF Viewer, use the [initialRenderPages](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html?_ga=2.144520115.723518961.1687236178-1796867613.1686804317#:~:text=value%20is%20null-,InitialRenderPages,-Initially%20renders%20the) property. You can achieve the desired outcome by setting this property to the desired number of pages you want to load initially. However, it's important to exercise caution when setting a high value for the initialRenderPages in large documents with numerous pages. Rendering a large number of pages simultaneously can increase memory usage and slow down loading times, impacting the performance of the PDF viewer. - -Using the `initialRenderPages` property judiciously is advisable, especially when dealing with larger documents. It is more suitable for scenarios where a smaller range of pages, such as 10-20, can be loaded to provide a quick initial view of the document. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@{ - ViewData["Title"] = "Home page"; - double InitialRenderPages = 5; -} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -@{ - ViewData["Title"] = "Home page"; - double InitialRenderPages = 5; -} - -
- - -
-{% endhighlight %} -{% endtabs %} - - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Load%20N%20no%20of%20pages) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/min-max-zoom.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/min-max-zoom.md deleted file mode 100644 index f832ac0df7..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/min-max-zoom.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -layout: post -title: Minimum and Maximum Zoom in EJ2 ASP.NET Core PDF Viewer| Syncfusion -description: Learn here all about Minimum and Maximum Zoom in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Minimum and Maximum Zoom Properties - -The Syncfusion® PDF Viewer provides the ability to control zoom levels for viewing PDF documents. The `minZoom` and `maxZoom` properties enable developers to set the minimum and maximum zoom levels, ensuring a consistent and controlled viewing experience. - -### minZoom - -The `minZoom` property specifies the minimum zoom percentage allowed in the PDF Viewer. This ensures that users cannot zoom out beyond a certain limit, which helps maintain readability and performance. Developers can set the `minZoom` property programmatically, defining the minimum zoom level based on the application's requirements. This is particularly useful for preventing users from zooming out too much, which could make the content difficult to read. - -### maxZoom - -The `maxZoom` property defines the maximum zoom percentage allowed in the PDF Viewer. By setting this property, developers can prevent users from zooming in too much, helping to avoid performance issues and maintain a smooth viewing experience. The `maxZoom` property can be set programmatically to control the upper limit of the zoom level. This is useful for applications where extremely high zoom levels might degrade performance or user experience. - -```html - -@{ - ViewData["Title"] = "Home page"; - double MaxZoom = 10; - double MinZoom = 5; -} - - -
- - -
- - -#### Restrict Zoom Percentage on Mobile Devices - -You can easily restrict the zoom percentage on mobile devices using the `minZoom` and `maxZoom` properties. This feature allows you to set specific limits for zooming, ensuring smoother scrolling performance and efficient document loading on mobile devices. By controlling the zoom levels, you can provide a better user experience across different devices. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -By implementing this, you ensure that the maximum zoom percentage on mobile devices is limited to 200% and the minimum zoom percentage is set to 10%. This prevents performance issues that may arise from excessive zooming on mobile platforms. diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/open-bookmark.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/open-bookmark.md deleted file mode 100644 index 77e1a6cf03..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/open-bookmark.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -layout: post -title: Open and Close Bookmark in EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn here all about Open and Close Bookmark in ASP.NET Core Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open and Close Bookmark pane programmatically - -The PDF Viewer library allows you to open the Bookmark pane programmatically using the **openBookmarkPane()** method. - -The following steps are used to open the Bookmark. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Insert the following code snippet to implement the functionality for opening the Bookmark pane: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -Similarly, to close the Bookmark pane programmatically, employ the following code snippet: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Open%20and%20Close%20bookmark%20pane/PDFViewerSample) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/open-thumbnail.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/open-thumbnail.md deleted file mode 100644 index 566da682f5..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/open-thumbnail.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -layout: post -title: Open Thumbnail in ##Platform_Name## Pdfviewer Component -description: Learn here all about Open Thumbnail in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Open Thumbnail -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open Thumbnail pane programmatically - -The PDF Viewer library allows you to open the thumbnail pane programmatically using the [**openThumbnailPane()**](https://ej2.syncfusion.com/documentation/api/pdfviewer/thumbnailView/#openthumbnailpane) method. - -The following steps are used to open the thumbnail. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to open thumbnail. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Open%20Thumbnail%20pane%20programmatically) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/pagerenderstarted-pagerendercompleted.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/pagerenderstarted-pagerendercompleted.md deleted file mode 100644 index 7390a5851d..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/pagerenderstarted-pagerendercompleted.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -layout: post -title: Rendering event in EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn here all about Rendering event in ASP.NET Core Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# PageRenderInitiate and pageRenderComplete event - -In Syncfusion® PDF Viewer, `pageRenderInitiate` and `pageRenderComplete` actions are events that occur during the rendering process of PDF documents. - -**pageRenderInitiate** - -The `pageRenderInitiate` event is triggered when the rendering of a page in the PDF document begins. This event provides developers with an opportunity to perform any necessary initialization or setup before the rendering of the page content commences. It can be utilized to prepare resources, set up rendering parameters, or execute any other actions required before the page rendering process starts. - -**pageRenderComplete** - -The `pageRenderComplete` event is triggered when the rendering of a page in the PDF document is completed. This event allows developers to perform cleanup tasks or finalize rendering-related processes after the rendering of the page content finishes. It can be used to release resources, finalize rendering settings, or handle any post-rendering tasks necessary for the application. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -The provided code demonstrates how to subscribe to the `pageRenderInitiate` and `pageRenderComplete` events in the Syncfusion® PDF Viewer component. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/resolve-Unable-to-find-an-entry-point-error.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/resolve-Unable-to-find-an-entry-point-error.md deleted file mode 100644 index 485df5a86b..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/resolve-Unable-to-find-an-entry-point-error.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -layout: post -title: Resolve unable to find an entry point error in ASP.NET CORE PDF Viewer component | Syncfusion -description: Learn here how to resolve unable to find an entry point named error in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -control: Resolve unable to find an entry point error -platform: ej2-asp-core-mvc -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - -# Resolve "Unable to find an entry point named FPDFText_GetCharAngle" error - -From the release of version **21.1.0.35 (2023 Volume 1)** of Essential Studio®, the Pdfium package has been upgraded to improve various functionalities like text search, text selection, rendering, and even performance. If you are updating your project to this version of the Syncfusion® PDF Viewer, you may encounter the **"Web-Service is not listening"** error. The Network tab can help you identify the root cause of the issue, which is typically caused by an old version of pdfium assembly being referenced in the local web service project. Below are the assemblies to be referred to in the respective operating systems. - -* Windows – pdfium.dll -* Linux – libpdfium.so -* OSX – libpdfium.dylib - -![Error information in the Network tab](../../pdfviewer/images/ErrorinformationuintheNetworkTab.png) - -## To solve this issue, you should follow the below steps: - -1. Clear the bin and object files of the web-service project. -2. Re-publish the web-service project. - -N> **Note:** If you are hosting your application in Azure, AWS, or in Linux environments, delete the older published files and republish the application. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/resolve-pdfium-issue.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/resolve-pdfium-issue.md deleted file mode 100644 index 1e4fb66578..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/resolve-pdfium-issue.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -layout: post -title: Resolve Pdfium Issue in ##Platform_Name## Pdfviewer Control | Syncfusion -description: Learn here all about Resolve Pdfium Issue in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Resolve Pdfium Issue -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Resolve the Pdfium issue - -The issue, “The type initializer for 'Syncfusion.EJ2.PdfViewer.PdfiumNative' threw an exception” is due to the write access permission denied in the environment. The pdfium.dll will be created based on the operating system at the runtime. Due to the denial of permission, the pdfium.dll file couldn't have been created. So, copy the below x64 and x86 folders and paste them inside the folder into your project to resolve the issue or enable the write permission for that folder. - -Pdfium dll: [pdfium.dll](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Pdfium1334927507.zip) - -N> Use both the client and server-side of the same version in your project. -
Ensure whether the pdfium.dll file is created in your project during runtime. Else, place the pdfium assemblies in any of the production environment locations and refer to the path by using the ReferencePath API. - -For example, if the Pdfium assembly is available in this path C:\Pdfium\x64 or D:\Pdfium\x86, the reference path should be PdfRenderer.ReferencePath = "C:/"; - -The parent folder has to be provided as the path in the ReferencePath API. - -N> Provide this path in the Load method of the PDFViewerController.cs - -N> PdfRenderer PdfRenderer = new PdfRenderer(); -
PdfRenderer.ReferencePath = @"C:/"; - -## Steps to refer the PDFium.dll - -1. Extract the given file (Pdfium folder) and copy it in the sample’s root directory (parallel to Controllers folder) - -2. Right-click on the pdfium.dll (both the X64 and X86 folder) and then choose the “Copy to Output Directory” property from the property window and set its value to “copy always”. This setting will ship the pdfium.dll assembly to the published location. -![Pdfium.dll settings](../../pdfviewer/images/pdfium_dll_settings.png) - -3. Provide this path in the Load method of the PDFViewerController.cs -N> You need to refer the ParentFolder up to the x64/x86 folder. -*PdfRenderer.ReferencePath = _hostingEnvironment.ContentRootPath + \\Pdfium\\;* - -4. Build and publish the application. - -Also, install the below package, then build and run the project. This will work on Windows, Linux, and OSX operating systems. - -* Syncfusion.EJ2.PdfViewer.AspNet.Core - -Following these steps should resolve the issue. - -## Steps to resolve the PDFium issue in Linux environment - -* The issue, “The type initializer for ‘Syncfusion.EJ2.PdfViewer.PdfiumNative’ threw an exception” occurs due to the missing of pdfium dependency in the Linux environment. To resolve this, Execute the following commands one by one to install the pdfium dependency package in the Linux machine. - -``` - sudo cp -u /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so - sudo apt-get update - sudo apt install libgdiplus -``` - -## Steps to resolve the PDFium issue in docker environment - -* The issue, “The type initializer for ‘Syncfusion.EJ2.PdfViewer.PdfiumNative’ threw an exception” occurs due to the missing of pdfium dependency in the docker environment. Please follow the steps below to resolve this issue on docker environment. - - -If you are using the PDF Viewer with Docker in .NET 6.0 framework, please incorporate the following commands into your Dockerfile to install the pdfium dependency: - -``` - RUN ln -s /lib/x86_64-linux-gnu/libdl-2.24.so /lib/x86_64-linux-gnu/libdl.so - # install System.Drawing native dependencies - RUN apt-get update && apt-get install -y --allow-unauthenticated libgdiplus libc6-dev libx11-dev - RUN ln -s libgdiplus.so gdiplus.dll -``` - -Dockerfile 6.0: [dockerfile](https://github.com/SyncfusionExamples/PdfViewer-Server/blob/master/Dockerfile) - -If you are using the PDF Viewer with Docker in .NET 8.0 framework, please incorporate the following commands into your Dockerfile to install the pdfium dependency: - -``` - RUN ln -s /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so - # install System.Drawing native dependencies - RUN apt-get update && apt-get install -y --allow-unauthenticated libgdiplus libc6-dev libx11-dev - RUN ln -s libgdiplus.so gdiplus.dll -``` - -Dockerfile 8.0: [dockerfile](https://github.com/SyncfusionExamples/PdfViewer-Server/blob/master/Dockerfile_NET80) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/restricting-zoom-in-mobile-mode.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/restricting-zoom-in-mobile-mode.md deleted file mode 100644 index eda3e4a59a..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/restricting-zoom-in-mobile-mode.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -layout: post -title: Restrict Zoom Percentage in ##Platform_Name## PDF Viewer Component| Syncfusion -description: Learn here all about how to restrict zoom percentage in Syncfusion ##Platform_Name## PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# How to Restrict Zoom Percentage on Mobile Devices - -In Syncfusion® PDF Viewer, you can easily restrict the zoom percentage on mobile devices using the **maxZoom** and **minZoom** property. This feature allows you to set specific limits for zooming, ensuring smoother scrolling performance and efficient document loading, on mobile devices. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -By implementing this, you ensure that the maximum zoom percentage on mobile devices is limited to 200% and the minimum zoom percentage is set to 10%. This prevents performance issues that may arise from excessive zooming on mobile platforms. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Restrict%20Zoom%20Percentage%20on%20Mobile%20Devices) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/retry-timeout.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/retry-timeout.md deleted file mode 100644 index eeacddb687..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/retry-timeout.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -layout: post -title: Retry Timeout in ##Platform_Name## Pdfviewer Component -description: Learn here all about Retry Timeout in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Retry Timeout -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Retry Timeout - -The **[Retry Timeout](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html?_ga=2.144520115.723518961.1687236178-1796867613.1686804317)** feature allows you to specify a duration for the PDF Viewer to retry failed AJAX requests before considering them permanent failures. It helps in handling temporary failures due to network issues or server unavailability. - -The retryTimeout allows developers to specify a duration after which the AJAX request should retry failed requests automatically. Developers can ensure a more resilient and fault-tolerant PDF viewing experience by configuring an appropriate retry timeout value. - -By default, when an AJAX request fails, the Retry Timeout property is set to `0`, indicating that no timeout is set. In this case, the PDF Viewer will wait indefinitely for a response, potentially leading to a hanging request. However, you can set the Retry Timeout property to a positive number, specifying the maximum number of seconds the PDF Viewer should wait for a response. If the response is not received within the specified time, the request will be aborted, triggering an appropriate error or timeout property. - -To set the retry timeout, use the [retryTimeout](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryTimeout) property in the PDF Viewer configuration. This property takes a value in seconds. - -```html - -@{ - ViewData["Title"] = "Home page"; - double RetryTimeout = 10; - double RetryCount = 5; -} - - -
- - -
- -``` - -In the given example, the [retryTimeout](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryTimeout) is set to 10 seconds, and the `retryCount` is set to 5. This means that if a request made by the PDF Viewer takes longer than 10 seconds to receive a response, it will be considered a timeout. In such cases, The PDF Viewer will resend the same request based on the retryCount. Here, this process will repeat up to maximum of 5 retries. - -When an exception occurs during the AJAX request in the context of the PDF Viewer, the request will wait for the specified [retryTimeout](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryTimeout) duration. If the timeout duration is exceeded, the PDF Viewer will decrement the [retryCount](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryCount) and attempt to load the document again. This retry process continues until the document is successfully loaded or the retryCount limit is reached. - -The [retryCount](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html?_ga=2.144520115.723518961.1687236178-1796867613.1686804317#:~:text=value%20is%20false-,RetryCount,-Specifies%20the%20retry) property of the PDF Viewer allows you to set the number of retries for a specific request. This feature is particularly useful for handling temporary errors such as network timeouts or server issues. By initiating new requests according to the retry count, ensure a smoother user experience and efficiently handle network or server problems. - -If the timeout duration specified by [retryTimeout](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_RetryTimeout) is exceeded during the AJAX request, the PDF Viewer will decrement the `retryCount` and initiate a new request. This process will continue until the document is successfully loaded or the retry count limit is reached. This functionality helps improve the handling of temporary errors and ensures a more efficient and user-friendly experience. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/RetryTimeout) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/save-original-document-at-the-server-side.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/save-original-document-at-the-server-side.md deleted file mode 100644 index 2bd580940d..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/save-original-document-at-the-server-side.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -layout: post -title: Save Original Document At The Server Side in ##Platform_Name## Pdfviewer Component -description: Learn here all about Save Original Document At The Server Side in Syncfusion ##Platform_Name## Pdfviewer component of syncfusion and more. -platform: ej2-asp-core-mvc -control: Save Original Document At The Server Side -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Save original document at the server side - -The PDF Viewer server library allows to save original PDF document pages at the server side. The following steps are used to save original PDF document at the server side using button click event. - -The following steps are used to save original document at the server side. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to create a button click event in PDF Viewer Control. - -```html - - - - -``` - -**Step 3:** Add the following code snippet in PDFViewerController.cs to save original PDF document at the server side. - -```cs - -public ActionResult SaveDocument([FromBody] Dictionary jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - string base64String = documentBase.Split(new string[] { "data:application/pdf;base64," }, StringSplitOptions.None)[1]; - if (base64String != null || base64String != string.Empty) - { - byte[] byteArray = Convert.FromBase64String(base64String); - - MemoryStream ms = new MemoryStream(byteArray); - var path = _hostingEnvironment.ContentRootPath; - System.IO.File.WriteAllBytes(path + "/ouptut.pdf", byteArray); - } - return Content(string.Empty); -} - -``` - -Download the sample [how to save original document at the server side](https://www.syncfusion.com/downloads/support/directtrac/general/ze/EJ2PDF~11039397667) - -N>Ensure the provided document path and output saved locations in your application level. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/show-bookmark.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/show-bookmark.md deleted file mode 100644 index 079a115b73..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/show-bookmark.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: post -title: Show Bookmark in ##Platform_Name## Pdfviewer Component -description: Learn here all about Show Bookmark in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Show Bookmark -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Show Bookmark - -The PDF Viewer server library allows you to show the bookmark programmatically by setting the [**enableBookmark**](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/#enablebookmark) property to `true`. We can also disable the bookmark by setting the property to `false`. - -N>Default value of `enableBookmark` property is true. - -The following steps are used to show the bookmark. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to Show the Bookmark. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Show%20Bookmark) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/show-custom-stamp-item.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/show-custom-stamp-item.md deleted file mode 100644 index d449da052c..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/show-custom-stamp-item.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -layout: post -title: Display Custom stamp Item in EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn how to display custom stamp items in the custom stamp in the Syncfusion ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Displaying Custom Items in Custom Stamp Dropdown - -### Overview - -This guide explains how to add and display custom items in the custom stamp dropdown menu of Syncfusion's PDF Viewer using ASP.NET CORE. This feature allows users to easily access and apply custom stamps to their PDF documents. - -### Steps to Show Custom Items in Custom Stamp Dropdown - -**Step 1:** Set Up the PdfViewer in Your ASP.NET CORE Project - - Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Configure Custom Stamp Settings - -Within the PDF Viewer setup, utilize `PdfViewerCustomStampSettings` to specify the custom stamps that should appear in the dropdown menu. - -```cs -@page "{handler?}" -@using Syncfusion.EJ2.PdfViewer; -@model IndexModel -@{ - ViewData["Title"] = "Home page"; - - List customStamp = new List(); - - customStamp.Add(new - { - customStampName = "Image1", - customStampImageSource ="data:image/png;base64,...' // Provide a valid base64 or URL for the image" - }); - customStamp.Add(new - { - customStampName = "Image2", - customStampImageSource ="data:image/png;base64,...' // Provide a valid base64 or URL for the image" - }); - PdfViewerCustomStampSettings CustomStampsSettings = new PdfViewerCustomStampSettings() - { - IsAddToMenu = true, - CustomStamps = customStamp, - EnableCustomStamp = true, - Opacity = 1, - }; - } - -
-
- - -``` - -By following these instructions, you can successfully configure to display custom stamp items in the custom stamp dropdown, allowing users to easily apply personalized stamps to their documents. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/show-hide-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/show-hide-annotation.md deleted file mode 100644 index 71acf70da3..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/show-hide-annotation.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -layout: post -title: Show and Hide Annotations in EJ2 ASP.NET CORE PdfViewer | Syncfusion -description: Learn how to show and hide annotations in the Syncfusion ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Show and Hide Annotations in PDF Viewer - -### Overview - -This guide demonstrates how to dynamically show and hide annotations in the Syncfusion PDF Viewer component in an ASP.NET Core application. This functionality is useful when you want to provide users with the ability to toggle the visibility of annotations within PDF documents. - -### How to Show and Hide Annotations - -**Step 1:** Set up the PDF Viewer in your ASP.NET Core project - -First, create a basic PDF Viewer implementation in your ASP.NET Core application. - -**Step 2:** Add a toggle button and implement the show/hide functionality - -Add a button that allows users to toggle the visibility of annotations within the PDF document. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@page "{handler?}" -@using ShowHideAnnotations.Pages -@model IndexModel -@{ -ViewData["Title"] = "Home page"; -} -
- - - - -
- - -{% endhighlight %} -{% endtabs %} - -This implementation provides a clean, efficient way to toggle the visibility of annotations in your PDF documents. It's particularly useful for presentation scenarios or when you need to focus on the document content without the distraction of annotations. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/ShowHideAnnotations) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/signatureselect-signatureunselect.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/signatureselect-signatureunselect.md deleted file mode 100644 index 8d098003e8..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/signatureselect-signatureunselect.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -layout: post -title: Signature selection events in EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn here all about selection event in ASP.NET Core Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# SignatureSelect and SignatureUnselect event - -The Syncfusion® PDF Viewer provides event-handling capabilities for various actions, including selecting and unselecting handwritten signatures. The `signatureSelect` and `signatureUnselect` events enable developers to programmatically manage the selection state of signatures within the PDF Viewer component. - -**signatureSelect** - -The `signatureSelect` event triggers when a handwritten signature annotation is selected. This event allows developers to capture the signature selection and handle it programmatically, such as updating the UI or storing the selection data for further processing. - -**signatureUnselect** - -The `signatureUnselect` event triggers when a handwritten signature annotation is unselected. This event enables developers to manage the unselection programmatically, which can be useful for tasks like cleanup operations or updating the application's state to reflect that a signature is no longer selected. - -The code snippet demonstrates how to subscribe to the `signatureSelect` and `signatureUnselect` events in the Syncfusion® PDF Viewer component. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -The `signatureSelect` and `signatureUnselect` events in Syncfusion® PDF Viewer offer robust options for managing the state of handwritten signatures within your application. By handling these events, developers can create a more interactive and dynamic user experience, responding programmatically to signature selection and unselection. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/unload-document.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/unload-document.md deleted file mode 100644 index 260c16a771..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/unload-document.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -layout: post -title: Unload Document in ##Platform_Name## Pdfviewer Component -description: Learn here all about Unload Document in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Unload Document -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Unload the PDF document programmatically - -The PDF Viewer library allows you to unload the PDF document being displayed in the PDF Viewer control programmatically using the [**unload()**](https://ej2.syncfusion.com/documentation/api/pdfviewer/#unload) method. - -The following steps are used to unload the PDF document programmatically. - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/) to create a simple PDF Viewer sample. - -**Step 2:** Add the following code snippet to perform the unload operation. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Unload%20the%20PDF%20document%20programmatically) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/webservice-not-listening.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/webservice-not-listening.md deleted file mode 100644 index b8f35e00f6..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/how-to/webservice-not-listening.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -layout: post -title: Web-service is not listening to error in ##Platform_Name## Pdfviewer Component -description: Learn how to clear Web-service is not listening to error in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: How to clear Web-service is not listening to error -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# How to clear the "Web-service is not listening" to error - -![Alt text](../../pdfviewer/images/webservice.png) - -If you are facing a **Web-service is not listening** to error in the Syncfusion® PDF Viewer, there could be several reasons for this. To troubleshoot the issue, you can use the Network tab in your browser's developer tools to gather more information. Here are the steps you can follow: - -**Step 1:** Open the browser's developer tools by right-clicking on the page and selecting `Inspect` from the dropdown menu. Then Navigate to the `Network` tab. This will show you all of the requests that are being made by the page. - -![Alt text](../../pdfviewer/images/networktab.png) - -**Step 2:** Try to request the web service. If the service is not listening, the request will fail, and you should see an error message in the Network tab. Click on the failing request to see the details of the error, such as the error message or stack trace. This can help you identify the root cause of the issue. Check the server logs for any errors or warnings that may indicate the cause of the issue and help you to troubleshoot the problem. - -**Step 3:** Check the request URL and parameters to see if they are correct. If there is a type or an incorrect parameter, the web service may be unable to process the request. - -By following these steps and using the Network tab in your browser's developer tools, you can gather more information about the issue and troubleshoot the problem more effectively. - -N> Make sure you are connected to the internet and that your connection is stable. You can try accessing other websites or services to see if they are working, and make sure the URL you are using to access the web service is correct and properly formatted. - -## Here are some common exceptions - -* File not found. -* Document cache not found. -* Document pointer does not exist in the cache. - -## File not found - -If you are encountering an error message stating that the web service is not listening due to a file not being found in the Syncfusion® PDF viewer, you can try the following steps to resolve the issue: - -### Check the file path - -Ensure that the file path you use to access the PDF file is correct and that the file exists in that location. You will need to update the file path if the file does not exist. - -## Document cache not found - -The `Document cache not found` exception in Syncfusion® PDF Viewer typically occurs when the cache used to store the rendered pages of a PDF document is not found or has been deleted. This can happen if the cache directory is changed or deleted or if the application is running in a different environment than it was previously. - -### Check for multiple instances - -It's possible that you have multiple instances of the Syncfusion® PDF Viewer running simultaneously, which can cause issues with the document cache. To check for this, open the Task Manager on your computer and look for any instances of the Syncfusion® PDF Viewer running. If you find multiple instances, try closing them all and reopening the viewer. - -We can use Redis cache and distributive cache for this issue. - -### Check your network connection - -Ensure that your network connection is stable and strong enough to support the web service you are trying to use. Sometimes, simply restarting the web service can resolve the issue. Try stopping and starting the service again to see if it resolves the problem. - -## The document pointer does not exist in the cache. - -The `Document pointer does not exist in the cache` exception in the Syncfusion® PDF Viewer usually occurs when there is an issue with loading or caching the PDF document. This error can be caused by a variety of reasons, including: - -To clear this error in the Syncfusion® PDF Viewer, you can try the following steps: - -**Step 1:** Clearing the cache may help resolve the issue. To clear the cache, navigate to the cache location, which can be found in the Syncfusion® PDF Viewer's settings or configuration files. Once you locate the cache folder, delete its contents. - -**Step 2:** Try reloading the document to ensure it is loaded correctly. You can do this by calling the controller's Load() method. Ensure the document is not already loaded before attempting to load it again. - -**Step 3:** Restart the application. If clearing the cache does not work, you can try restarting the PDF Viewer application. This will reload all the necessary components and may resolve the error. - -## Internal server error - -Server-side exceptions happen for various use cases. We can't just define them if they are document-specific, provide the document, or you may need to contact Syncfusion® support for further assistance. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/interaction-mode.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/interaction-mode.md deleted file mode 100644 index 7dfcd72066..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/interaction-mode.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -layout: post -title: Interaction_mode in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Interaction_mode in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Interaction_mode -publishingplatform: ej2-asp-core-mvc -documentation: ug ---- - - -# Interaction Mode in PDF Viewer component - -The PDF Viewer provides interaction mode for easy interaction with the loaded PDF document. Selection mode and panning mode are the two interactions modes. - -## Selection mode - -In this mode, the text selection can be performed in the PDF document loaded in PDF Viewer. The panning and scrolling of the pages by touch cannot be performed in this mode. It allows users to select and copy text from the PDF files. This is helpful for copying and sharing text content. You can enable/disable the text selection using the following code snippet. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/selection.png) - -## Panning Mode - -In this mode, the panning and scrolling of the pages by touch can be performed in the PDF document loaded in the PDF Viewer, but the text selection cannot be performed. - -![Alt text](./images/pan.png) - -You can switch the interaction mode of PDF Viewer by using the following code snippet., - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/magnification.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/magnification.md deleted file mode 100644 index aa77ea201a..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/magnification.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -layout: post -title: Magnification in ##Platform_Name## Pdfviewer Component -description: Learn here all about Magnification in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Magnification -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Magnification - -The magnification tools of the PDF Viewer contains ZoomIn, ZoomOut, Zoom, FitPage, and FitWidth tools in the default toolbar. The PDF Viewer also has an option to show or hide the magnification tools in the default toolbar. - -The following code snippet describes how to enable the magnification in PDF Viewer. - - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -The following magnification options are available in the default toolbar of PDF Viewer, - -* **ZoomIn**:- Zoom in from the current zoom value of PDF pages. -* **ZoomOut**:- Zoom out from the current zoom value of PDF pages. -* **Zoom**:- Zoom to specific zoom value of PDF pages. -* **FitPage**:- Fits the page width with in the available view port size. -* **FitWidth**:- Fits the view port width based on the page content size. -* **Auto**:- Fits the page content with-in the viewport on resizing action. - -![Alt text ](./images/zoom.png) - -N>PDF Viewer can support the zoom value ranges from 10 to 400. - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/mobile-toolbar.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/mobile-toolbar.md deleted file mode 100644 index 3b6c98d5ef..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/mobile-toolbar.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -layout: post -title: Mobile Toolbar Interface in ##Platform_Name## Pdfviewer Component| Syncfusion -description: Learn All About the Mobile Toolbar Interface in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Mobile Toolbar Interface -documentation: ug -domainurl: ##DomainURL## ---- -# Mobile Toolbar Interface in ASP.NET Core PDF Viewer control - -The Mobile PDF Viewer offers a variety of features for viewing, searching, annotating, and managing PDF documents on mobile devices. It includes essential tools like search, download, bookmarking, annotation, and page organization. Users also have the option to enable desktop toolbar features in mobile mode, providing a more extensive set of actions. - -## Mobile Mode Toolbar Configuration -In mobile mode, the toolbar is optimized for ease of use on small screens, presenting users with the most common actions for interacting with a PDF document. Below are the key features available in mobile mode: - -![Mobile toolbar with primary PDF interaction options](./images/mobileToolbar.png) - -### Main Toolbar Options: - -**OpenOption:** Tap to load a PDF document. - -**SearchOption:** Access the search bar to find text within the document. - -![Search bar displayed for finding text within a PDF](./images/searchOption.png) - -**UndoRedoTool:** Quickly undo or redo any annotations made. - -**OrganizePagesTool:** Enable or disable page organization features to modify document pages. - -![Page organization interface for modifying PDF pages](./images/organizePages.png) - -**AnnotationEditTool:** Activate or deactivate annotation editing to add or modify annotations. - -![Annotation editing toolbar allowing users to add, edit, or delete annotations on a PDF](./images/editAnnotation.png) - - -N> In mobile mode, the annotation toolbar is conveniently displayed at the bottom of the viewer. - -### More Options Menu: - -When you open the "more options" menu, you will see additional actions such as: - -**DownloadOption:** Tap to download the currently opened PDF document. - -**BookmarkOption:** Allows you to view bookmarks within the document. - -![More options menu showing additional actions like download and bookmark](./images/more-options.png) - -## Enabling Desktop Mode in Mobile - -The desktop version of the toolbar can be enabled on mobile devices by using the `enableDesktopMode` API. This API allows you to bring desktop-like features to the mobile PDF viewer, providing access to additional toolbar actions that are typically available on desktop platforms. - -### Steps to Enable Desktop Mode: - -**Step 1:** Set `enableDesktopMode` to true in the API configuration. - -**Step 2:** This will replace the mobile toolbar with the desktop toolbar layout, allowing access to more actions and controls. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} -
- - -
-{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} -
- - -
-{% endhighlight %} -{% endtabs %} - -## Enable Scrolling in Desktop Mode with Touch Gestures - -To ensure smooth scrolling of PDF documents on a mobile device in desktop mode, it is important to enable touch gesture scrolling. You can achieve this by setting the `enableTextSelection` option to **false**. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} -
- - -
-{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} -
- - -
-{% endhighlight %} -{% endtabs %} - -## Print Option Not Available - -The Print option is not available in mobile mode by default. However, if you need to use the print functionality on mobile devices, we recommend enabling the desktop toolbar on mobile using the `enableDesktopMode` API. - -### How to Use Print on Mobile: - -**Enable Desktop Mode:** Set `enableDesktopMode` to true to load the desktop version of the toolbar on your mobile device. - -**Print Option:** Once desktop mode is enabled, the print option will be available, allowing you to print the document directly from your mobile device. - -N> In mobile mode, the print functionality will not be available unless desktop mode is enabled. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/navigation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/navigation.md deleted file mode 100644 index 327cf009fb..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/navigation.md +++ /dev/null @@ -1,194 +0,0 @@ ---- -layout: post -title: Navigation in ##Platform_Name## Pdfviewer Component -description: Learn here all about Navigation in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Navigation -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Navigation - -The ASP.NET Core PDF Viewer supports different internal and external navigations. - -## Toolbar page navigation option - -The default toolbar of PDF Viewer contains the following navigation options - -* **Go to page**:- Navigates to the specific page of a PDF document. -* **Show next page**:- Navigates to the next page of PDF a document. -* **Show previous page**:- Navigates to the previous page of a PDF document. -* **Show first page**:- Navigates to the first page of a PDF document. -* **Show last page**:- Navigates to the last page of a PDF document. - -You can enable/disable page navigation option in PDF Viewer using the following code snippet., - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - - -![Alt text](./images/navigation.png) - -## Bookmark navigation - -The Bookmarks saved in PDF files are loaded and made ready for easy navigation. -You can enable/disable bookmark navigation by using the following code snippet., - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/bookmark.png) - -## Thumbnail navigation - -Thumbnails is the miniature representation of actual pages in PDF files. This feature displays thumbnails of the pages and allows navigation. -You can enable/disable thumbnail navigation by using the following code snippet., - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/thumbnail.png) - -## Hyperlink navigation - -Hyperlink navigation features enables navigation to the URLs (website links) in a PDF file. - -![Alt text](./images/link.png) - -## Table of content navigation - -Table of contents navigation allows users to navigate to different parts of a PDF file that are listed in the table of contents section. - -You can enable/disable link navigation by using the following code snippet., - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -You can change the open state of the hyperlink in the PDF Viewer by using the following code snippet, - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/toc.png) - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file.md deleted file mode 100644 index 0608316130..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -layout: post -title: Open PDF files in EJ2 ASP.NET CORE PDF Viewer | Syncfusion -description: Learn here all about Opening PDF in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Opening a PDF from Base64 data in PDF Viewer -### Overview - -This guide demonstrates how to load a PDF document from a Base64 string into the Syncfusion PDF Viewer using ASP.NET CORE. This feature is useful for loading PDF data received from a client, database, or other sources where the document is encoded in Base64. - -### Opening PDF from Base64 data - -**Step 1:** Set Up the PdfViewer in Your ASP.NET CORE Project - -Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample. - -**Step 2:** Use the following code snippet to load PDF document using base64 string. - - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - - -
- - - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to) diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-amazon-s3.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-amazon-s3.md deleted file mode 100644 index 494ca5ca5e..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-amazon-s3.md +++ /dev/null @@ -1,215 +0,0 @@ ---- -layout: post -title: AWS S3 in ##Platform_Name## Syncfusion PDF Viewer Component -description: Learn here all about how to Open PDF files from AWS S3 in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF file from AWS S3 - -PDF Viewer allows to load PDF file from AWS S3 using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to open a PDF from AWS S3. - -## Using Standalone PDF Viewer - -To load a PDF file from AWS S3 in a PDF Viewer, you can follow the steps below - -**Step 1:** Create AWS S3 account - - Set up an AWS S3 account by following the instructions on the official AWS site: [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). Create an S3 bucket and generate access keys while ensuring secure storage of credentials. - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `~/Pages/Shared/_Layout.cshtml` File in the Project - -1. Add the required scripts using CDN inside the `` of `~/Pages/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - -{% endhighlight %} -{% endtabs %} - -**Step 4:** Modify the `~/Pages/Index.cshtml` File in the Project - -1. Configures AWS SDK with the region, access key, and secret access key. This configuration allows the application to interact with AWS services like S3. - -N> Replace **Your Region** with the actual Region of your AWS S3 account and **Your Access Key** with the actual Access Key of your AWS S3 account and **Your Security Access Key** with the actual Security Access Key of your AWS S3 account. - -```csharp -AWS.config.update({ - region: '**Your Region**', // Update this your region - accessKeyId: '*Your Access Key*', // Update this with your access key id - secretAccessKey: '*Your Security Access Key*', // Update this with your secret access key -}); -``` - -2. Sets the parameters for fetching the PDF document from S3, including the bucket name and file key. Then Uses the getObject method of the S3 instance to retrieve the document. Converts the document data to a Base64 string and loads it into the Syncfusion® PDF Viewer then load Base64 string generated into the viewer.load method. - -N> Replace **Your Bucket Name** with the actual Bucket name of your AWS S3 account and **Your Key** with the actual File Key of your AWS S3 account. - -```csharp -loadDocument() { - const s3 = new AWS.S3(); - const getObjectParams = { - Bucket: '**Your Bucket Name**', - Key: '**Your Key**', - }; - this.s3.getObject(getObjectParams, (err, data) => { - if (err) { - console.error('Error fetching document:', err); - } else { - if (data && data.Body) { - const bytes = new Uint8Array(data.Body as ArrayBuffer); - let binary = ''; - bytes.forEach((byte) => (binary += String.fromCharCode(byte))); - const base64String = window.btoa(binary); - console.log('Document data as Base64:', base64String); - var viewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - setTimeout(() => { - viewer.load("data:application/pdf;base64,"+base64String); - }, 2000); - } - } - }); -} -``` - -N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). - -## Using Server-Backed PDF Viewer - -To load a PDF file from AWS S3 in a PDF Viewer, you can follow the steps below - -**Step 1:** Create AWS S3 account - - Set up an AWS S3 account by following the instructions on the official AWS site: [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). Create an S3 bucket and generate access keys while ensuring secure storage of credentials. - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Amazon; -using Amazon.S3; -using Amazon.S3.Model; -``` - -2. Add the following private fields and constructor parameters to the `Index.cshtml.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp - -private IConfiguration _configuration; -public readonly string _accessKey; -public readonly string _secretKey; -public readonly string _bucketName; - -public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessKey = _configuration.GetValue("AccessKey"); - _secretKey = _configuration.GetValue("SecretKey"); - _bucketName = _configuration.GetValue("BucketName"); -} -``` - -3. Modify the `OnPostLoad()` method to load the PDF files from AWS S3 - -```csharp - -public async Task OnPostLoadAsync([FromBody] jsonObjects responseData) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - var jsonObject = JsonConverterstring(responseData); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - RegionEndpoint bucketRegion = RegionEndpoint.USEast1; - - // Configure the AWS SDK with your access credentials and other settings - var s3Client = new AmazonS3Client(_accessKey, _secretKey, bucketRegion); - - string document = jsonObject["document"]; - - // Specify the document name or retrieve it from a different source - var response = await s3Client.GetObjectAsync(_bucketName, document); - - Stream responseStream = response.ResponseStream; - responseStream.CopyTo(stream); - stream.Seek(0, SeekOrigin.Begin); - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} - - -``` - -4. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessKey": "Your Access Key from AWS S3", - "SecretKey": "Your Secret Key from AWS S3", - "BucketName": "Your Bucket name from AWS S3" -} -``` - -N> Replace **Your Access Key from AWS S3**, **Your Secret Key from AWS S3**, and **Your Bucket name from AWS S3** with your actual AWS access key, secret key and bucket name - -**Step 4:** Set the PDF Viewer Properties in ASP.NET Core PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from AWS S3. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -``` - -N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Server-Backend) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-azure-active-directory.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-azure-active-directory.md deleted file mode 100644 index 793c6a033b..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-azure-active-directory.md +++ /dev/null @@ -1,215 +0,0 @@ ---- -layout: post -title: Open PDF from AAD in EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn here all about How to Open Pdf From AAD in ASP.NET Core Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF From Azure Active Directory in Viewer - -### **Overview** - -The Syncfusion PDF Viewer allows you to load and save PDF files directly from Azure Active Directory (AAD). Below are the steps to securely load and store PDF documents from and to AAD using the PDF Viewer. - -### **Steps to Open the PDF File from Azure Active Directory** - ---- - -### **Step 1: Register an Application in Azure Active Directory (AAD)** - -1. **Go to the Azure Portal**: - - Navigate to [Azure Portal](https://portal.azure.com). - -2. **Register your Application**: - - In the Azure portal, go to **Azure Active Directory** > **App registrations** > **New registration**. - - Register your application and note down the **Application (client) ID** and **Directory (tenant) ID**. - - ![app-registration](../../images/app-registration.png) - -3. **Create a Client Secret**: - - In the registered application, go to **Certificates & secrets**. - - Click **New client secret**. - - Provide a description and set an expiration period. - - Click **Add**. - - Copy the client secret value immediately, as it will be hidden later. Store it securely. - - ![client-secret](../../images/client-secret.png) - ---- - -### **Step 2: Create the Azure Storage Account** - -1. **Create a Storage Account**: - - In the Azure portal, use the search bar to search for **Storage accounts**. - - Create a new storage account by filling in the required details (e.g., name, location, resource group, etc.). - - ![storage-account](../../images/storage-account.png) - ---- - -### **Step 3: Assign Role to the Application** - -1. **Go to your Storage Account**: - - Navigate to **Access control (IAM)** > **Add role assignment** in your Azure Storage Account. - -2. **Assign Role**: - - Assign the **Storage Blob Data Contributor** role to your registered application. - - In the **Assign access to** dropdown, select **User, group, or service principal**. - - Click on **Select members** and search for your registered application by name or client ID. - - Select your application and click **Select**. - - Click **Review + assign** to finalize the role assignment. - - ![add-role](../../images/add-role.png) ---- - -### **Step 4: Upload the PDF Document to the Azure Storage Account** - -1. **Navigate to Data Storage**: - - In the Azure portal, go to **Data storage** > **Containers**. - -2. **Upload the PDF File**: - - Create a new container and upload the PDF document you want to access in the PDF Viewer. - - ![upload-pdf](../../images/upload-pdf.png) ---- - -### **Step 5: ASP.NET Core PDF Viewer Control Configuration** -1. Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample. - -2. Add the following code snippet in `Index.cshtml.cs`. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml.cs" %} - -using Azure.Identity; -using Azure.Storage.Blobs; - -string tenantId = "YOUR_TENANT_ID"; -string clientId = "YOUR_CLIENT_ID"; -string clientSecret = "YOUR_CLIENT_SECRET"; -string blobServiceEndpoint = "https://your-storage-account.blob.core.windows.net"; -string containerName = "your-container-name"; - - public async Task OnGetLoadFromAAD(string fileName) - { - var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret); - var blobServiceClient = new BlobServiceClient(new Uri(blobServiceEndpoint), clientSecretCredential); - var containerClient = blobServiceClient.GetBlobContainerClient(containerName); - var blobClient = containerClient.GetBlobClient(fileName); - - // Download the PDF file to a local stream - using MemoryStream pdfStream = new MemoryStream(); - await blobClient.DownloadToAsync(pdfStream); - var base64 = Convert.ToBase64String(pdfStream.ToArray()); - return Content("data:application/pdf;base64," + base64); - } - - public async Task OnPostSaveToAAD([FromBody]jsonObjects responseData) - { - var jsonObject = JsonConverterstring(responseData); - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var fileName = jsonObject.ContainsKey("documentId") ? jsonObject["documentId"] : "Test.pdf"; - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - string convertedBase = documentBase.Substring(documentBase.LastIndexOf(',') + 1); - // Decode the Base64 string to a byte array - byte[] byteArray = Convert.FromBase64String(convertedBase); - // Create a MemoryStream from the byte array - MemoryStream stream = new MemoryStream(byteArray); - // Create a new BlobServiceClient using the DefaultAzureCredential - var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret); - var blobServiceClient = new BlobServiceClient(new Uri(blobServiceEndpoint), clientSecretCredential); - // Get a reference to the container - var containerClient = blobServiceClient.GetBlobContainerClient(containerName); - // Get a reference to the blob - var blobClient = containerClient.GetBlobClient(fileName); - //FileStream uploadFileStream = new FileStream(); - await blobClient.UploadAsync(stream, true); - stream.Close(); - return Content(string.Empty); - } - -{% endhighlight %} -{% endtabs %} - -3. Configure Server-Side Code: - - Open the server-side application (e.g., ASP.NET Core) and configure the following details in the `PdfViewerController` file: - - `tenantId` (your Azure AD tenant ID), - - `clientId` (your registered application client ID), - - `clientSecret` (your registered application client secret), - - `blobServiceEndpoint` (your storage account blob service URL), - - `containerName` (your container name in Azure Blob Storage). - -4. Add the following code snippet in `Index.cshtml`. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- - -
- - - -
- - - - -{% endhighlight %} -{% endtabs %} - -5. Run the Application - - Build and run your Core application. The PDF Viewer will be displayed with Load from AAD and Save to AAD buttons. - -6. Load PDF from AAD - - Click the Load from AAD button. - - The server fetches the PDF from Azure Blob Storage and loads it into the Syncfusion PDF Viewer. - -7. Save PDF to AAD - - Click the Save to AAD button. - - The server uploads the modified PDF back to Azure Blob Storage. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aad). \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-azure-blob-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-azure-blob-storage.md deleted file mode 100644 index 224adb9b24..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-azure-blob-storage.md +++ /dev/null @@ -1,211 +0,0 @@ ---- -layout: post -title: Open PDF from Azure Blob Storage in ##Platform_Name## PdfViewer | Syncfusion -description: Learn here all about how to Open PDF files from Azure Blob Storage in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF file from Azure Blob Storage - -PDF Viewer allows to load PDF file from Azure Blob Storage using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to open a PDF from Azure Blob Storage. - -## Using Standalone PDF Viewer - -To load a PDF file from Azure Blob Storage in a PDF Viewer, you can follow the steps below - -**Step 1:** Create the Azure Blob Storage account - -Log in to the Azure Portal. Create a new Storage Account with preferred settings. Note access keys during the setup. Within the Storage Account, create a Blob Container following the steps in this [link](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal). - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Views/Home/index.cshtml` File in the Project - -1. Add the following properties to the `Views/Home/index.cshtml`, and assign the values from the configuration to the corresponding properties - -N> Replace **Your account name in Azure** with the actual account name for your Azure Blob Storage account and **Your container name in Azure** with the actual container name and **Your Blob name in Azure** with the actual container name. - -```csharp -var accountName = "*Your account name in Azure*"; -var containerName = "*Your container name in Azure*"; -var blobName = "*Your Blob name in Azure*"; -``` - -2. Constructs the URL to the PDF in Azure Blob Storage. Calls fetchAndConvertToBase64 to fetch the PDF and convert it to a base64 string. Then Loads the base64 string into the PDF Viewer. - -```csharp -function loadDocument() { - var url = 'https://' + accountName + '.blob.core.windows.net/' + containerName + '/' + blobName; - fetchAndConvertToBase64(url).then(function(base64String) { - if (base64String) { - setTimeout(function() { - viewer.load("data:application/pdf;base64," + base64String); - }, 2000); - } else { - console.error('Failed to fetch and convert file to base64.'); - } - }).catch(function(error) { - console.error('Error:', error); - }); -} -``` - -3. Then it retrieves the PDF file from the given URL and converts the fetched Blob to a base64 string using blobToBase64. - -```csharp -function fetchAndConvertToBase64(url) { - return new Promise(function(resolve, reject) { - fetch(url).then(function(response) { - if (!response.ok) { - throw new Error('HTTP error! Status: ' + response.status); - } - return response.blob(); - }).then(function(blob) { - blobToBase64(blob).then(function(base64String) { - resolve(base64String); - }); - }).catch(function(error) { - console.error('Error fetching file:', error); - reject(null); - }); - }); -} -``` - -4. Uses FileReader to convert a Blob to a base64 string. Resolves the promise with the base64 string or rejects it in case of an error. - -```csharp -function blobToBase64(blob) { - return new Promise(function(resolve, reject) { - var reader = new FileReader(); - reader.onload = function() { - var base64String = reader.result ? reader.result.toString().split(',')[1] : ''; - resolve(base64String); - }; - reader.onerror = function(error) { - reject(error); - }; - reader.readAsDataURL(blob); - }); -} -``` - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). - -## Using Server-Backed PDF Viewer - -To load a PDF file from Azure Blob Storage in a PDF Viewer, you can follow the steps below - -**Step 1:** Create the Azure Blob Storage account - -Log in to the Azure Portal. Create a new Storage Account with preferred settings. Note access keys during the setup. Within the Storage Account, create a Blob Container following the steps in this [link](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal). - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; -``` - -2. Add the following private fields and constructor parameters to the `Index.cshtml.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp - -private IConfiguration _configuration; -private readonly string _storageConnectionString; -private readonly string _storageContainerName; - -public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _storageConnectionString = configuration.GetValue("connectionString"); - _storageContainerName = configuration.GetValue("containerName"); -} -``` - -3. Modify the `OnPostLoad()` method to load the PDF files from Azure Blob Storage - -```csharp - -public IActionResult OnPostLoad([FromBody] jsonObjects responseData) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - var jsonObject = JsonConverterstring(responseData); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - BlobServiceClient blobServiceClient = new BlobServiceClient(_storageConnectionString); - string fileName = jsonObject["document"]; - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(_storageContainerName); - BlockBlobClient blockBlobClient = containerClient.GetBlockBlobClient(fileName); - blockBlobClient.DownloadTo(stream); - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} - -``` - -4. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "connectionString": "*Your Connection string from Azure*", - "containerName": "*Your container name in Azure*" -} -``` - -N> Replace **Your Connection string from Azure** with the actual connection string for your Azure Blob Storage account and **Your container name in Azure** with the actual container name - -**Step 4:** Set the PDF Viewer Properties in ASP.NET Core PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Azure Blob Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -``` - -N> The **Azure.Storage.Blobs** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Server-Backend). \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-box-cloud-file-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-box-cloud-file-storage.md deleted file mode 100644 index 80ea7bd181..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-box-cloud-file-storage.md +++ /dev/null @@ -1,145 +0,0 @@ ---- -layout: post -title: Box cloud file storage in ##Platform_Name## PDF Viewer Component -description: Learn here all about how to Open PDF files from Box cloud file storage in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF file from Box cloud file storage - -To load a PDF file from Box cloud file storage in a PDF Viewer, you can follow the steps below - -**Step 1** Set up a Box developer account and create a Box application - -To access Box storage programmatically, you'll need a developer account with Box. Go to the [Box Developer Console](https://developer.box.com/), sign in or create a new account, and then create a new Box application. This application will provide you with the necessary credentials Client ID and Client Secret to authenticate and access Box APIs. Before accessing files, you need to authenticate your application to access your Box account. Box API supports `OAuth 2.0 authentication` for this purpose. - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project - -1. Import the required namespaces at the top of the file: - -```csharp -using Box.V2; -using Box.V2.Auth; -using Box.V2.Config; -using Box.V2.Models; -``` - -2. Add the following private fields and constructor parameters to the `Index.cshtml.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private IConfiguration _configuration; -public readonly string _accessToken; -public readonly string _clientID; -public readonly string _clientSecret; -public readonly string _folderID; - -public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessToken = _configuration.GetValue("AccessToken"); - _clientID = _configuration.GetValue("ClientID"); - _clientSecret = _configuration.GetValue("ClientSecret"); - _folderID = _configuration.GetValue("FolderID"); -} - -``` - -3. Modify the `OnPostLoad()` method to load the PDF files from Box cloud file storage. - -```csharp - -public async Task OnPostLoadAsync([FromBody] jsonObjects responseData) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - var jsonObject = JsonConverterstring(responseData); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - string objectName = jsonObject["document"]; - // Initialize the Box API client with your authentication credentials - var auth = new OAuthSession(_accessToken, "YOUR_REFRESH_TOKEN", 3600, "bearer"); - var config = new BoxConfigBuilder(_clientID, _clientSecret, new Uri("http://boxsdk")).Build(); - var client = new BoxClient(config, auth); - - // Download the file from Box storage - var items = await client.FoldersManager.GetFolderItemsAsync(_folderID, 1000, autoPaginate: true); - var files = items.Entries.Where(i => i.Type == "file"); - - // Filter the files based on the objectName - var matchingFile = files.FirstOrDefault(file => file.Name == objectName); - - // Fetch the file from Box storage by its name - var fileStream = await client.FilesManager.DownloadAsync(matchingFile.Id); - stream = new MemoryStream(); - await fileStream.CopyToAsync(stream); - - // Reset the position to the beginning of the stream - stream.Position = 0; - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} - -``` - -4. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessToken": "Your_Box_Storage_Access_Token", - "FolderID": "Your_Folder_ID", - "ClientID": "Your_Box_Storage_ClientID", - "ClientSecret": "Your_Box_Storage_ClientSecret" -} -``` - -N> replace **Your_Box_Storage_Access_Token** with your actual box access token, and **Your_Folder_ID** with the ID of the folder in your box storage where you want to perform specific operations. Remember to use your valid box API credentials, as **Your_Box_Storage_ClientID** and **Your_Box_Storage_ClientSecret"** are placeholders for your application's API key and secret. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET Core PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Azure Blob Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -``` -N> The **Box.V2.Core** NuGet package must be installed in your application to use the previous code example. - -N> Replace `PDF_Succinctly.pdf` with the actual document name that you want to load from Box cloud file storage. Make sure to pass the document name from the box folder to the `documentPath` property of the PDF viewer component - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-box-cloud-file-storage) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-google-cloud-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-google-cloud-storage.md deleted file mode 100644 index 41106a6923..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-google-cloud-storage.md +++ /dev/null @@ -1,136 +0,0 @@ ---- -layout: post -title: Google Cloud Storage in ##Platform_Name## PDF Viewer Component -description: Learn here all about how to Open PDF files from Google Cloud Storage in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF file from Google Cloud Storage - -To load a PDF file from Google Cloud Storage in a PDF Viewer, you can follow the steps below - -**Step 1** Create a Service Account - -Open the Google Cloud Console. Navigate to `IAM & Admin` > `Service accounts`. Click `Create Service Account`.` Enter a name, assign roles (e.g., Storage Object Admin), and create a key in JSON format. Download the key file securely. Utilize the downloaded key file in your applications or services for authentication and access to the Google Cloud Storage bucket. For additional details, refer to the [official documentation](https://cloud.google.com/iam/docs/service-accounts-create). - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Google.Cloud.Storage.V1; -using Google.Apis.Auth.OAuth2; - -``` - -2. Add the following private fields and constructor parameters to the `Index.cshtml.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp - - // Private readonly object _storageClient - private readonly StorageClient _storageClient; - - private IConfiguration _configuration; - - public readonly string _bucketName; - - public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) - { - _hostingEnvironment = hostingEnvironment; - _cache = cache; - // The key file is used to authenticate with Google Cloud Storage. - string keyFilePath = @"path/to/service-account-key.json"; - - // Load the service account credentials from the key file. - var credentials = GoogleCredential.FromFile(keyFilePath); - - // Create a storage client with Application Default Credentials - _storageClient = StorageClient.Create(credentials); - - _configuration = configuration; - - _bucketName = _configuration.GetValue("BucketName"); - } -``` - -3. Modify the `OnPostLoad()` method to load the PDF files from Google Cloud Storage. - -```csharp - -public IActionResult OnPostLoad([FromBody] jsonObjects responseData) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - var jsonObject = JsonConverterstring(responseData); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - string bucketName = _bucketName; - string objectName = jsonObject["document"]; - _storageClient.DownloadObject(bucketName, objectName, stream); - stream.Position = 0; - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} - - -``` - -4. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "BucketName": "Your Bucket name from Google Cloud Storage" -} -``` - -N> Replace **Your Bucket name from Google Cloud Storage** with the actual name of your Google Cloud Storage bucket - -N> Replace **path/to/service-account-key.json** with the actual file path to your service account key JSON file. Make sure to provide the correct path and filename. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET Core PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Azure Blob Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -``` - -N> The **Google.Cloud.Storage.V1** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-google-cloud-storage) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-google-drive.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-google-drive.md deleted file mode 100644 index 1783bd263c..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/open-pdf-file/from-google-drive.md +++ /dev/null @@ -1,169 +0,0 @@ ---- -layout: post -title: Google Drive in ##Platform_Name## PDF Viewer Component -description: Learn here all about how to Open PDF files from Google Drive in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Open PDF file from Google Drive - -To load a PDF file from Google Drive in a PDF Viewer, you can follow the steps below - -**Step 1** Set up Google Drive API - -You must set up a project in the Google Developers Console and enable the Google Drive API. Obtain the necessary credentials to access the API. For more information, view the official [link](https://developers.google.com/drive/api/guides/enable-sdk). - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Google.Apis.Drive.v3; -using Google.Apis.Auth.OAuth2; -using Google.Apis.Services; -using Google.Apis.Util.Store; -``` - -2. Add the following private fields and constructor parameters to the `Index.cshtml.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp - -string[] Scopes = { DriveService.Scope.Drive }; -private IConfiguration _configuration; -public readonly string folderId; -private readonly string applicationName; -public readonly string credentialPath; - -public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - folderId = _configuration.GetValue("FolderId"); - credentialPath = _configuration.GetValue("CredentialPath"); - applicationName = _configuration.GetValue("ApplicationName"); -} - -``` -3. Modify the `OnPostLoad()` method to load the PDF files from Google drive. - -```csharp -public async Task OnPostLoadAsync([FromBody] jsonObjects responseData) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - var jsonObject = JsonConverterstring(responseData); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - string objectName = jsonObject["document"]; - - UserCredential credential; - - using (var memStream = new FileStream(credentialPath, FileMode.Open, FileAccess.Read)) - { - string credPath = "token.json"; - credential = await GoogleWebAuthorizationBroker.AuthorizeAsync( - GoogleClientSecrets.Load(memStream).Secrets, - Scopes, - "user", - CancellationToken.None, - new FileDataStore(credPath, true)); - } - - // Create Google Drive API service. - var service = new DriveService(new BaseClientService.Initializer() - { - HttpClientInitializer = credential, - ApplicationName = applicationName, - }); - - //This object is used to construct a request to list files from Google Drive. - FilesResource.ListRequest listRequest = service.Files.List(); - listRequest.Q = "mimeType='application/pdf' and '" + folderId + "' in parents and trashed=false"; - listRequest.Fields = "files(id, name)"; - var files = await listRequest.ExecuteAsync(); - - // Process the list of files (you can use 'files' to retrieve the list of files) - string fileIdToDownload = null; - foreach (var file in files.Files) - { - string fileId = file.Id; - string fileName = file.Name; - if (fileName == objectName) - { - // Save the matching fileId - fileIdToDownload = fileId; - break; - } - } - string fileIds = fileIdToDownload; - var request = service.Files.Get(fileIds); - await request.DownloadAsync(stream); - stream.Position = 0; - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} - -``` - -4. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "FolderId": "Your Google Drive Folder ID", - "CredentialPath": "Your Path to the OAuth 2.0 Client IDs json file", - "ApplicationName": "Your Application name" -} -``` - -N> Replace **Your Google Drive Folder ID**, **Your Application name**, and **Your Path to the OAuth 2.0 Client IDs json file** with your actual Google drive folder ID , Your name for your application and the path for the JSON file. - -N> The **FolderId** part is the unique identifier for the folder. For example, if your folder URL is: `https://drive.google.com/drive/folders/abc123xyz456`, then the folder ID is `abc123xyz456`. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET Core PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Azure Blob Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -``` - -N> The **Google.Apis.Drive.v3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-google-drive) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/organize-pdf.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/organize-pdf.md deleted file mode 100644 index 2c4895ac4f..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/organize-pdf.md +++ /dev/null @@ -1,311 +0,0 @@ ---- -layout: post -title: Organize Pages with EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn here all about Organize Pages in ASP.NET Core Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Organize Pages in PDF Viewer component - -The PDF Viewer allows you to manage your PDF documents efficiently by organizing pages seamlessly. Whether you need to add new pages, remove unnecessary ones, rotate pages, move pages within the document, and copy or duplicate pages, the PDF Viewer facilitate these tasks effortlessly. - -## Getting started - -To access the organize pages feature, simply open the PDF document in the PDF Viewer and navigate to the left vertical toolbar. Look for the `Organize Pages` option to begin utilizing these capabilities. - -![Alt text](./images/organize-page.png) - -The page organization support enables you to perform various actions such as rotating, rearranging, inserting, copying, and deleting pages within a PDF document using organize pages dialog. - -### Rotating PDF pages - -You can adjust the orientation of PDF pages to ensure proper alignment. The rotate icon offers the following options: - -* `Rotate clockwise`: Rotate the selected pages 90 degrees clockwise. -* `Rotate counter-clockwise`: Rotate the selected pages 90 degrees counter-clockwise. - -### Rearranging PDF pages - -You can easily change the sequence of pages within your document using the drag and drop method: - -* `Drag and drop`: Click and drag a page thumbnail to the desired position within the document, then release it to rearrange the page order. - -![Alt text](./images/rotate-rearrange.gif) - -### Inserting new pages - -Effortlessly add new pages to your document with the following options: - -* `Insert blank page left`: Insert a blank page to the left of the selected page using the respective icon. -* `Insert blank page right`: Insert a blank page to the right of the selected page using the corresponding icon. - -### Deleting PDF pages - -Removing unwanted pages from your document is straight forward: - -* `Select pages to delete`: Click on the page thumbnails you wish to remove. You can select multiple pages at once. -* `Delete selected pages`: Use the delete option in the organize pages pane to remove the selected pages from the document. - -### Copying PDF pages - -Duplicate the pages within your PDF document effortlessly: - -* `Select pages to copy`: Click on the page thumbnails you wish to duplicate. Use the copy option to create duplicates. When a page is copied, the duplicate is automatically added to the right of the selected page. Multiple copies can be made using the toolbar action. - -![Alt text](./images/insert-delete-copy.gif) - -### Importing a PDF Document - -Seamlessly import a PDF document into your existing document: - -* `Import PDF document`: Click the **Import Document** button to import a PDF. If a page is selected, the imported document’s thumbnail will be inserted to the right of the selected page. If multiple or no pages are selected, the thumbnail will be added as the first page. When **Save** or **Save As** is clicked, the imported PDF will be merged with the current document. You can insert a blank page to the left or right of the imported thumbnail, delete it, or drag and drop it to reposition as needed. - -![Alt text](./images/import.gif) - -### Selecting all pages - -Make comprehensive adjustments by selecting all pages simultaneously. This facilitates efficient editing and formatting across the entire document. - -![Alt text](./images/selectall.png) - -### Zooming Page Thumbnails - -Adjust the size of page thumbnails within the organizer panel for better visibility and precision when editing. The zoom functionality allows you to: - -* Increase or decrease the size of page thumbnails using the zoom slider -* See more details on pages when zoomed in -* View more pages simultaneously when zoomed out - -This feature is especially useful when working with documents containing complex layouts or small details that need careful examination during organization. - -![Alt text](./images/zoomOrganize.png) - -### Real-time updates - -Witness instant changes in page organization reflected within the PDF Viewer. Simply click the **Save** button to preserve your modifications. - -### SaveAs functionality - -Safeguard your edits by utilizing the **Save As** feature. This enables you to download the modified version of the PDF document for future reference, ensuring that your changes are securely stored. - -## API's supported - -**enablePageOrganizer:** This API enables or disables the page organizer feature in the PDF Viewer. By default, it is set to `true`, indicating that the page organizer is enabled. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} -
- - -
-{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} -
- - -
-{% endhighlight %} -{% endtabs %} - -**isPageOrganizerOpen:** This API determines whether the page organizer dialog will be displayed automatically when a document is loaded into the PDF Viewer. By default, it is set to `false`, meaning the dialog is not displayed initially. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} -
- - -
-{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} -
- - -
-{% endhighlight %} -{% endtabs %} - -**pageOrganizerSettings:** This API allows control over various page management functionalities within the PDF Viewer. It includes options to enable or disable actions such as deleting, inserting, rotating, copying, importing and rearranging pages, as well as configuring thumbnail zoom settings. By default, all these actions are enabled and standard zoom settings are applied. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} -
- - -
-{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} -
- - -
-{% endhighlight %} -{% endtabs %} - -**openPageOrganizer:** This API opens the page organizer dialog within the PDF Viewer, providing access to manage PDF pages. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - -
- @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render() -
- - - -{% endhighlight %} -{% endtabs %} - -**closePageOrganizer:** This API closes the currently open page organizer dialog within the PDF Viewer, if it is present. It allows users to dismiss the dialog when done with page organization tasks. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -## Keyboard shortcuts - -The following keyboard shortcuts are available at the organize pages dialog. - -* **Ctrl+Z** : Undo the last action performed. -* **Ctrl+Y** : Redo the action that was undone -* **Ctrl+Scroll** : Zoom in and zoom out page thumbnails for better visibility. - -![Alt text](./images/undo-redo.png) - -#### Conclusion - -With the Organize Pages feature in the PDF Viewer, managing your PDF documents has never been easier. Whether you are adding new content, adjusting page orientation, moving the pages, duplicating the pages, or removing unnecessary pages, this feature provides the tools you need to streamline your document management workflow. Explore these capabilities today and take control of your PDF documents with ease! - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Organize%20pdf) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/print.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/print.md deleted file mode 100644 index fc4ea7c38c..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/print.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -layout: post -title: Print in ##Platform_Name## Pdfviewer Component -description: Learn here all about Print in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Print -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Print - -The PDF Viewer supports printing the loaded PDF file. You can enable/disable the print using the following code snippet. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/print.png) - -You can invoke print action using the following code snippet., - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -## Customization of Print Quality using printScaleFactor API. - -The PDF Viewer allows you to adjust the print quality using the [PrintScaleFactor](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.pdfviewer.pdfviewer.html#PrintScaleFactor) API. The quality of the print improves as the print quality value increases from 0.5 to 5. - -When the value is less than 0.5, the PDF is printed at a standard quality. When the value exceeds 5, the PDF is still printed at the standard quality. In standard quality, printScaleFactor value is set to 1 as default value. -The effective range for print quality is between 0.5 and 5. Higher values within this range will result in better print quality, but also increase the print time. - -By default, the printScaleFactor is set to 1. - -* **The following code snippet demonstrates how to customize print quality using the PrintScaleFactor API in the PDF Viewer.** - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-amazon-s3.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-amazon-s3.md deleted file mode 100644 index 4de1819815..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-amazon-s3.md +++ /dev/null @@ -1,238 +0,0 @@ ---- -layout: post -title: AWS S3 in ##Platform_Name## Syncfusion PDF Viewer Component -description: Save PDF files to AWS S3 in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF file to AWS S3 - -PDF Viewer allows to save PDF file to AWS S3 using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to save PDF to AWS S3. - -## Using Standalone PDF Viewer - -To save a PDF file to AWS S3, you can follow the steps below - -**Step 1:** Create AWS S3 account - - Set up an AWS S3 account by following the instructions on the official AWS site: [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). Create an S3 bucket and generate access keys while ensuring secure storage of credentials. - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `~/Pages/Shared/_Layout.cshtml` File in the Project - -1. Add the required scripts using CDN inside the `` of `~/Pages/Shared/_Layout.cshtml` file as follows, - -{% tabs %} -{% highlight c# tabtitle="~/_Layout.cshtml" %} - - - ... - - - -{% endhighlight %} -{% endtabs %} - -**Step 4:** Modify the `~/Pages/Index.cshtml` File in the Project - -1. Configures AWS SDK with the region, access key, and secret access key. This configuration allows the application to interact with AWS services like S3. - -N> Replace **Your Region** with the actual Region of your AWS S3 account and **Your Access Key** with the actual Access Key of your AWS S3 account and **Your Security Access Key** with the actual Security Access Key of your AWS S3 account. - -```csharp -AWS.config.update({ - region: '**Your Region**', // Update this your region - accessKeyId: '*Your Access Key*', // Update this with your access key id - secretAccessKey: '*Your Security Access Key*', // Update this with your secret access key -}); -``` - -2. Configure a custom toolbar item for the download function to save a PDF file in Azure Blob Storage. - -```csharp -
- - -
- - -``` - -3. Retrieve the PDF viewer instance and save the current PDF as a Blob. Then, read the Blob using a FileReader to convert it into an ArrayBuffer, and upload the ArrayBuffer to AWS S3 using the putObject method of the S3 instance. - -N> Replace **Your Bucket Name** with the actual Bucket name of your AWS S3 account and **Your Key** with the actual File Key of your AWS S3 account. - -```csharp -function saveDocument() { - const s3 = new AWS.S3(); - var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0]; - pdfViewer.saveAsBlob().then(function (value) { - var reader = new FileReader(); - reader.onload = () => { - const uint8Array = new Uint8Array(reader.result); - const putObjectParams = { - Bucket: '**Your Bucket Name**', - Key: '**Your Key**', - Body: uint8Array, - ContentType: 'application/pdf', - }; - s3.putObject(putObjectParams, (err, data) => { - if (err) { - console.error('Error uploading document:', err); - } else { - console.log('Document uploaded successfully:', data); - } - }); - }; - reader.readAsArrayBuffer(value); - }); -} -``` - -N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). - -## Using Server-Backed PDF Viewer - -To save a PDF file to AWS S3, you can follow the steps below - -**Step 1:** Create AWS S3 account - - Set up an AWS S3 account by following the instructions on the official AWS site: [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). Create an S3 bucket and generate access keys while ensuring secure storage of credentials. - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Amazon; -using Amazon.S3; -using Amazon.S3.Model; -``` - -2. Add the following private fields and constructor parameters to the `Index.cshtml.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp - -private IConfiguration _configuration; -public readonly string _accessKey; -public readonly string _secretKey; -public readonly string _bucketName; - -public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessKey = _configuration.GetValue("AccessKey"); - _secretKey = _configuration.GetValue("SecretKey"); - _bucketName = _configuration.GetValue("BucketName"); -} -``` -3. Modify the `OnPostDownload()` method to save the downloaded PDF files to AWS S3 bucket - -```csharp - - public IActionResult OnPostDownload([FromBody] jsonObjects responseData) - { - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - RegionEndpoint bucketRegion = RegionEndpoint.USEast1; - - // Configure the AWS SDK with your access credentials and other settings - var s3Client = new AmazonS3Client(_accessKey, _secretKey, bucketRegion); - string bucketName = _bucketName; - string documentName = jsonObject["documentId"]; - string result = Path.GetFileNameWithoutExtension(documentName); - byte[] bytes = Convert.FromBase64String(documentBase.Split(",")[1]); - using (MemoryStream stream = new MemoryStream(bytes)) - { - var request = new PutObjectRequest - { - BucketName = bucketName, - Key = result + "_downloaded.pdf", - InputStream = stream, - }; - // Upload the PDF document to AWS S3 - var response = s3Client.PutObjectAsync(request).Result; - } - return Content(documentBase); - } - -``` - - -4. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessKey": "Your Access Key from AWS S3", - "SecretKey": "Your Secret Key from AWS S3", - "BucketName": "Your Bucket name from AWS S3" -} -``` - -N> Replace **Your Access Key from AWS S3**, **Your Secret Key from AWS S3**, and **Your Bucket name from AWS S3** with your actual AWS access key, secret key and bucket name - -**Step 4:** Set the PDF Viewer Properties in ASP.NET Core PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from AWS S3. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -``` - -N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Server-Backend) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-azure-active-directory.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-azure-active-directory.md deleted file mode 100644 index 4f94069412..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-azure-active-directory.md +++ /dev/null @@ -1,215 +0,0 @@ ---- -layout: post -title: Save PDF To AAD in EJ2 ASP.NET Core PDF Viewer | Syncfusion -description: Learn here all about How to Save Pdf To AAD in ASP.NET Core Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF To Azure Active Directory in Viewer - -### **Overview** - -The Syncfusion PDF Viewer allows you to load and save PDF files directly from Azure Active Directory (AAD). Below are the steps to securely load and store PDF documents from and to AAD using the PDF Viewer. - -### **Steps to Open the PDF File from Azure Active Directory** - ---- - -### **Step 1: Register an Application in Azure Active Directory (AAD)** - -1. **Go to the Azure Portal**: - - Navigate to [Azure Portal](https://portal.azure.com). - -2. **Register your Application**: - - In the Azure portal, go to **Azure Active Directory** > **App registrations** > **New registration**. - - Register your application and note down the **Application (client) ID** and **Directory (tenant) ID**. - - ![app-registration](../../images/app-registration.png) - -3. **Create a Client Secret**: - - In the registered application, go to **Certificates & secrets**. - - Click **New client secret**. - - Provide a description and set an expiration period. - - Click **Add**. - - Copy the client secret value immediately, as it will be hidden later. Store it securely. - - ![client-secret](../../images/client-secret.png) - ---- - -### **Step 2: Create the Azure Storage Account** - -1. **Create a Storage Account**: - - In the Azure portal, use the search bar to search for **Storage accounts**. - - Create a new storage account by filling in the required details (e.g., name, location, resource group, etc.). - - ![storage-account](../../images/storage-account.png) - ---- - -### **Step 3: Assign Role to the Application** - -1. **Go to your Storage Account**: - - Navigate to **Access control (IAM)** > **Add role assignment** in your Azure Storage Account. - -2. **Assign Role**: - - Assign the **Storage Blob Data Contributor** role to your registered application. - - In the **Assign access to** dropdown, select **User, group, or service principal**. - - Click on **Select members** and search for your registered application by name or client ID. - - Select your application and click **Select**. - - Click **Review + assign** to finalize the role assignment. - - ![add-role](../../images/add-role.png) ---- - -### **Step 4: Upload the PDF Document to the Azure Storage Account** - -1. **Navigate to Data Storage**: - - In the Azure portal, go to **Data storage** > **Containers**. - -2. **Upload the PDF File**: - - Create a new container and upload the PDF document you want to access in the PDF Viewer. - - ![upload-pdf](../../images/upload-pdf.png) ---- - -### **Step 5: ASP.NET Core PDF Viewer Control Configuration** -1. Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample. - -2. Add the following code snippet in `Index.cshtml.cs`. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml.cs" %} - -using Azure.Identity; -using Azure.Storage.Blobs; - -string tenantId = "YOUR_TENANT_ID"; -string clientId = "YOUR_CLIENT_ID"; -string clientSecret = "YOUR_CLIENT_SECRET"; -string blobServiceEndpoint = "https://your-storage-account.blob.core.windows.net"; -string containerName = "your-container-name"; - - public async Task OnGetLoadFromAAD(string fileName) - { - var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret); - var blobServiceClient = new BlobServiceClient(new Uri(blobServiceEndpoint), clientSecretCredential); - var containerClient = blobServiceClient.GetBlobContainerClient(containerName); - var blobClient = containerClient.GetBlobClient(fileName); - - // Download the PDF file to a local stream - using MemoryStream pdfStream = new MemoryStream(); - await blobClient.DownloadToAsync(pdfStream); - var base64 = Convert.ToBase64String(pdfStream.ToArray()); - return Content("data:application/pdf;base64," + base64); - } - - public async Task OnPostSaveToAAD([FromBody]jsonObjects responseData) - { - var jsonObject = JsonConverterstring(responseData); - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var fileName = jsonObject.ContainsKey("documentId") ? jsonObject["documentId"] : "Test.pdf"; - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - string convertedBase = documentBase.Substring(documentBase.LastIndexOf(',') + 1); - // Decode the Base64 string to a byte array - byte[] byteArray = Convert.FromBase64String(convertedBase); - // Create a MemoryStream from the byte array - MemoryStream stream = new MemoryStream(byteArray); - // Create a new BlobServiceClient using the DefaultAzureCredential - var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret); - var blobServiceClient = new BlobServiceClient(new Uri(blobServiceEndpoint), clientSecretCredential); - // Get a reference to the container - var containerClient = blobServiceClient.GetBlobContainerClient(containerName); - // Get a reference to the blob - var blobClient = containerClient.GetBlobClient(fileName); - //FileStream uploadFileStream = new FileStream(); - await blobClient.UploadAsync(stream, true); - stream.Close(); - return Content(string.Empty); - } - -{% endhighlight %} -{% endtabs %} - -3. Configure Server-Side Code: - - Open the server-side application (e.g., ASP.NET Core) and configure the following details in the `PdfViewerController` file: - - `tenantId` (your Azure AD tenant ID), - - `clientId` (your registered application client ID), - - `clientSecret` (your registered application client secret), - - `blobServiceEndpoint` (your storage account blob service URL), - - `containerName` (your container name in Azure Blob Storage). - -4. Add the following code snippet in `Index.cshtml`. - -{% tabs %} -{% highlight c# tabtitle="~/Index.cshtml" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- - -
- - - -
- - - - -{% endhighlight %} -{% endtabs %} - -5. Run the Application - - Build and run your Core application. The PDF Viewer will be displayed with Load from AAD and Save to AAD buttons. - -6. Load PDF from AAD - - Click the Load from AAD button. - - The server fetches the PDF from Azure Blob Storage and loads it into the Syncfusion PDF Viewer. - -7. Save PDF to AAD - - Click the Save to AAD button. - - The server uploads the modified PDF back to Azure Blob Storage. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aad). \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-azure-blob-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-azure-blob-storage.md deleted file mode 100644 index d7d2b262fd..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-azure-blob-storage.md +++ /dev/null @@ -1,259 +0,0 @@ ---- -layout: post -title: Save PDF to Azure Blob Storage in ##Platform_Name## PdfViewer | Syncfusion -description: Save PDF files to Azure Blob Storage in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF file to Azure Blob Storage - -PDF Viewer allows to save PDF file to Azure Blob Storage using either the Standalone or Server-backed PDF Viewer. Below are the steps and a sample to demonstrate how to save PDF to Azure Blob Storage. - -## Using Standalone PDF Viewer - -To save a PDF file to Azure Blob Storage, you can follow the steps below. - -**Step 1:** Create the Azure Blob Storage account. - -Log in to the Azure Portal. Create a new Storage Account with preferred settings. Note access keys during the setup. Within the Storage Account, create a Blob Container following the steps in this [link](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal). - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project. - -1. Import the required namespaces at the top of the file. - -```csharp -using Azure.Storage.Blobs; -``` - -2. Add the following private fields to the `Index.cshtml.cs` class, and assign the values to the corresponding fields. Add `Upload()` method to save the downloaded PDF files to Azure Blob Storage container. - -```csharp -private readonly string ConnectionString = "Your Connection string from Azure"; -private readonly string blobContainerName = "Your container name in Azure"; - -public async Task OnPostUploadAsync([FromBody] UploadFileRequest request) -{ - if (request == null || string.IsNullOrEmpty(request.FileName) || string.IsNullOrEmpty(request.FileContent)) - { - return new JsonResult(new { error = "Invalid file or file name." }) { StatusCode = 400 }; - } - try - { - byte[] fileBytes = Convert.FromBase64String(request.FileContent); - BlobServiceClient blobServiceClient = new BlobServiceClient(ConnectionString); - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(blobContainerName); - BlobClient blobClient = containerClient.GetBlobClient(request.FileName); - - using (var stream = new MemoryStream(fileBytes)) - { - await blobClient.UploadAsync(stream, true); - } - - var fileUrl = blobClient.Uri.ToString(); - return new JsonResult(fileUrl); - } - catch (Exception ex) - { - return new JsonResult(new { error = ex.Message }) { StatusCode = 500 }; - } -} -``` - -N> Replace **Your Connection string from Azure** with the actual connection string for your Azure Blob Storage account and **Your container name in Azure** with the actual container name. - -1. Configure a custom toolbar item for the download function to save a PDF file in Azure Blob Storage. - -```csharp -
- - -
- - -``` - -2. Retrieve the PDF viewer instance and save the current PDF as a Blob. Next, read the Blob as an ArrayBuffer and convert it to a Base64 string using arrayBufferToBase64 method. Finally, upload the Base64 string to Azure Blob Storage using the `Index.cshtml.cs`. - -```csharp -function saveDocument() { - var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0]; - var fileName = pdfViewer.fileName; - pdfViewer.saveAsBlob().then(function (value) { - var reader = new FileReader(); - reader.onload = async () => { - if (reader.result) { - const arrayBuffer = reader.result; - var base64String = arrayBufferToBase64(arrayBuffer); - var data = { - fileName: fileName, - fileContent: base64String - }; - - fetch('/Index?handler=Upload', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(data) - }).then(response => response.json()) - .then(data => { - if (data.uri) { - alert('File uploaded successfully! Blob URI: ' + data.uri); - } else { - alert('Error occurred..' + data.error); - } - }).catch(error => { - alert('Error occurred..' + data.error); - }); - } - }; - reader.readAsArrayBuffer(value); - }); -} -``` - -N> The **Azure.Storage.Blobs** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). - -## Using Server-Backed PDF Viewer - -To save a PDF file to Azure Blob Storage, you can follow the steps below. - -**Step 1:** Create the Azure Blob Storage account - -Log in to the Azure Portal. Create a new Storage Account with preferred settings. Note access keys during the setup. Within the Storage Account, create a Blob Container following the steps in this [link](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal). - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; -``` - -2. Add the following private fields and constructor parameters to the `Index.cshtml.cs` class, In the constructor, assign the values from the configuration to the corresponding fields. - -```csharp - -private readonly string _storageConnectionString; -private readonly string _storageContainerName; -private readonly ILogger _logger; - -public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration, ILogger logger) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _storageConnectionString = configuration.GetValue("connectionString"); - _storageContainerName = configuration.GetValue("containerName"); - _logger = logger; -} -``` - -3. Modify the `OnPostDownload()` method to save the downloaded PDF files to Azure Blob Storage container - -```csharp - -public IActionResult OnPostDownload([FromBody] jsonObjects responseData) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - string document = jsonObject["documentId"]; - - // Create a BlobServiceClient object - BlobServiceClient blobServiceClient = new BlobServiceClient(_storageConnectionString); - - // Get a reference to the blob container - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(_storageContainerName); - - string result = Path.GetFileNameWithoutExtension(document); - // Get a reference to the blob - BlobClient blobClient = containerClient.GetBlobClient(result + "_download.pdf"); - - // Convert the document base64 string to bytes - byte[] bytes = Convert.FromBase64String(documentBase.Split(",")[1]); - - // Upload the document to Azure Blob Storage - using (MemoryStream stream = new MemoryStream(bytes)) - { - blobClient.Upload(stream, true); - } - return Content(documentBase); -} - -``` - -4. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "connectionString": "*Your Connection string from Azure*", - "containerName": "*Your container name in Azure*" -} -``` - -N> Replace **Your Connection string from Azure** with the actual connection string for your Azure Blob Storage account and **Your container name in Azure** with the actual container name - -**Step 4:** Set the PDF Viewer Properties in ASP.NET Core PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Azure Blob Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -``` - -N> The **Azure.Storage.Blobs** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Server-Backend). \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-box-cloud-file-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-box-cloud-file-storage.md deleted file mode 100644 index 3f9bd888bd..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-box-cloud-file-storage.md +++ /dev/null @@ -1,133 +0,0 @@ ---- -layout: post -title: Box cloud file storage in ##Platform_Name## PDF Viewer Component -description: Save PDF files to Box cloud file storage in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF file to Box cloud file storage - -To save a PDF file to Box cloud file storage, you can follow the steps below - -**Step 1** Set up a Box developer account and create a Box application - -To access Box storage programmatically, you'll need a developer account with Box. Go to the [Box Developer Console](https://developer.box.com/), sign in or create a new account, and then create a new Box application. This application will provide you with the necessary credentials Client ID and Client Secret to authenticate and access Box APIs. Before accessing files, you need to authenticate your application to access your Box account. Box API supports `OAuth 2.0 authentication` for this purpose. - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project - -1. Import the required namespaces at the top of the file: - -```csharp -using Box.V2; -using Box.V2.Auth; -using Box.V2.Config; -using Box.V2.Models; -``` - -2. Add the following private fields and constructor parameters to the `Index.cshtml.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private IConfiguration _configuration; -public readonly string _accessToken; -public readonly string _clientID; -public readonly string _clientSecret; -public readonly string _folderID; - -public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessToken = _configuration.GetValue("AccessToken"); - _clientID = _configuration.GetValue("ClientID"); - _clientSecret = _configuration.GetValue("ClientSecret"); - _folderID = _configuration.GetValue("FolderID"); -} - -``` - -3. Modify the `OnPostDownload()` method to save the downloaded PDF files to Box cloud file storage folder. -```csharp - -public async Task OnPostDownload([FromBody] jsonObjects responseData) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - - byte[] documentBytes = Convert.FromBase64String(documentBase.Split(",")[1]); - - string documentId = jsonObject["documentId"]; - string result = Path.GetFileNameWithoutExtension(documentId); - string fileName = result + "_downloaded.pdf"; - - // Initialize the Box API client with your authentication credentials - var auth = new OAuthSession(_accessToken, "YOUR_REFRESH_TOKEN", 3600, "bearer"); - var config = new BoxConfigBuilder(_clientID, _clientSecret, new Uri("http://boxsdk")).Build(); - var client = new BoxClient(config, auth); - - var fileRequest = new BoxFileRequest - { - Name = fileName, - Parent = new BoxFolderRequest { Id = _folderID }, - }; - - using (var stream = new MemoryStream(documentBytes)) - { - var boxFile = await client.FilesManager.UploadAsync(fileRequest, stream); - } - return Content(documentBase); -} - -``` - -4. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessToken": "Your_Box_Storage_Access_Token", - "FolderID": "Your_Folder_ID", - "ClientID": "Your_Box_Storage_ClientID", - "ClientSecret": "Your_Box_Storage_ClientSecret" -} -``` - -N> replace **Your_Box_Storage_Access_Token** with your actual box access token, and **Your_Folder_ID** with the ID of the folder in your box storage where you want to perform specific operations. Remember to use your valid box API credentials, as **Your_Box_Storage_ClientID** and **Your_Box_Storage_ClientSecret"** are placeholders for your application's API key and secret. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET Core PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Box cloud file storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -``` -N> The **Box.V2.Core** NuGet package must be installed in your application to use the previous code example. - -N> Replace `PDF_Succinctly.pdf` with the actual document name that you want to load from Box cloud file storage. Make sure to pass the document name from the box folder to the `documentPath` property of the PDF viewer component - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-box-cloud-file-storage) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-google-cloud-storage.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-google-cloud-storage.md deleted file mode 100644 index e04cac81bc..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-google-cloud-storage.md +++ /dev/null @@ -1,128 +0,0 @@ ---- -layout: post -title: Google Cloud Storage in ##Platform_Name## PDF Viewer Component -description: Save PDF files to Google Cloud Storage in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF file to Google Cloud Storage - -To save a PDF file to Google Cloud Storage, you can follow the steps below - -**Step 1** Create a Service Account - -Open the Google Cloud Console. Navigate to `IAM & Admin` > `Service accounts`. Click `Create Service Account`.` Enter a name, assign roles (e.g., Storage Object Admin), and create a key in JSON format. Download the key file securely. Utilize the downloaded key file in your applications or services for authentication and access to the Google Cloud Storage bucket. For additional details, refer to the [official documentation](https://cloud.google.com/iam/docs/service-accounts-create). - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Google.Cloud.Storage.V1; -using Google.Apis.Auth.OAuth2; -``` - -2. Add the following private fields and constructor parameters to the `Index.cshtml.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp - - // Private readonly object _storageClient - private readonly StorageClient _storageClient; - - private IConfiguration _configuration; - - public readonly string _bucketName; - - public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) - { - _hostingEnvironment = hostingEnvironment; - _cache = cache; - // The key file is used to authenticate with Google Cloud Storage. - string keyFilePath = @"path/to/service-account-key.json"; - - // Load the service account credentials from the key file. - var credentials = GoogleCredential.FromFile(keyFilePath); - - // Create a storage client with Application Default Credentials - _storageClient = StorageClient.Create(credentials); - - _configuration = configuration; - - _bucketName = _configuration.GetValue("BucketName"); - } - -``` -3. Modify the `OnPostDownloadAsync()` method to save the downloaded PDF files to Google Cloud Storage bucket - -```csharp -public IActionResult OnPostDownload([FromBody] jsonObjects responseData) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - string bucketName = _bucketName; - string fileName = jsonObject["documentId"]; - - // Convert the base64 string back to bytes - string result = Path.GetFileNameWithoutExtension(fileName); - byte[] documentBytes = Convert.FromBase64String(documentBase.Split(",")[1]); - - // Upload the document to Google Cloud Storage - using (var memoryStream = new MemoryStream(documentBytes)) - { - _storageClient.UploadObject(bucketName, result + "_downloaded.pdf", null, memoryStream); - } - return Content(documentBase); -} - -``` - -4. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "BucketName": "Your Bucket name from Google Cloud Storage" -} -``` - -N> Replace **Your Bucket name from Google Cloud Storage** with the actual name of your Google Cloud Storage bucket - -N> Replace **path/to/service-account-key.json** with the actual file path to your service account key JSON file. Make sure to provide the correct path and filename. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET Core PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Azure Blob Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -``` - -N> The **Google.Cloud.Storage.V1** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-google-cloud-storage) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-google-drive.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-google-drive.md deleted file mode 100644 index af73e4fdaa..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/save-pdf-file/to-google-drive.md +++ /dev/null @@ -1,145 +0,0 @@ ---- -layout: post -title: Google Drive in ##Platform_Name## PDF Viewer Component -description: Save PDF files to Google Drive in ASP.NET CORE PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Save PDF file to Google Drive - -To save a PDF file to Google Drive, you can follow the steps below - -**Step 1** Set up Google Drive API - -You must set up a project in the Google Developers Console and enable the Google Drive API. Obtain the necessary credentials to access the API. For more information, view the official [link](https://developers.google.com/drive/api/guides/enable-sdk). - -**Step 2:** Create PDF Viewer Sample in ASP.NET Core - -Follow instructions provided in the Syncfusion® PDF Viewer Getting Started [Guide](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started-with-server-backed) to create a simple PDF Viewer sample in ASP.NET Core. - -**Step 3:** Modify the `Index.cshtml.cs` File in the Project - -1. Import the required namespaces at the top of the file. - -```csharp -using System.IO; -using Google.Apis.Drive.v3; -using Google.Apis.Util.Store; -``` - -2. Add the following private fields and constructor parameters to the `Index.cshtml.cs` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp - -string[] Scopes = { DriveService.Scope.Drive }; -private IConfiguration _configuration; -public readonly string folderId; -private readonly string applicationName; -public readonly string credentialPath; - -public IndexModel(Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - folderId = _configuration.GetValue("FolderId"); - credentialPath = _configuration.GetValue("CredentialPath"); - applicationName = _configuration.GetValue("ApplicationName"); -} - -``` -3. Modify the `OnPostDownloadAsync()` method to save the downloaded PDF files to Google Drive bucket - -```csharp -public async Task OnPostDownloadAsync([FromBody] jsonObjects responseData) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonObject = JsonConverterstring(responseData); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - byte[] documentBytes = Convert.FromBase64String(documentBase.Split(",")[1]); - string documentId = jsonObject["documentId"]; - string result = Path.GetFileNameWithoutExtension(documentId); - string fileName = result + "_downloaded.pdf"; - - UserCredential credential; - - using (var memStream = new FileStream(credentialPath, FileMode.Open, FileAccess.Read)) - { - string credPath = "token.json"; - credential = await GoogleWebAuthorizationBroker.AuthorizeAsync( - GoogleClientSecrets.Load(memStream).Secrets, - Scopes, - "user", - CancellationToken.None, - new FileDataStore(credPath, true)); - } - - // Create the Drive API service. - var service = new DriveService(new BaseClientService.Initializer() - { - HttpClientInitializer = credential, - ApplicationName = applicationName, - }); - var fileMetadata = new Google.Apis.Drive.v3.Data.File() - { - Name = fileName, - Parents = new List { folderId } - }; - FilesResource.CreateMediaUpload request; - using (var stream = new MemoryStream(documentBytes)) - { - request = service.Files.Create(fileMetadata, stream, "application/pdf"); - request.Fields = "id"; - object value = await request.UploadAsync(); - } - return Content(documentBase); -} - -``` - -4. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "FolderId": "Your Google Drive Folder ID", - "CredentialPath": "Your Path to the OAuth 2.0 Client IDs json file", - "ApplicationName": "Your Application name" -} -``` - -N> Replace **Your Google Drive Folder ID**, **Your Application name**, and **Your Path to the OAuth 2.0 Client IDs json file** with your actual Google drive folder ID , Your name for your application and the path for the JSON file. - -N> The **FolderId** part is the unique identifier for the folder. For example, if your folder URL is: `https://drive.google.com/drive/folders/abc123xyz456`, then the folder ID is `abc123xyz456`. - -**Step 4:** Set the PDF Viewer Properties in ASP.NET Core PDF viewer component - -Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Azure Blob Storage. Ensure that you correctly pass the document name from the files available in your azure container to the documentPath property. - -```csharp - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- -``` - -N> The **Google.Apis.Drive.v3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-google-drive) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/server-actions.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/server-actions.md deleted file mode 100644 index 7bf8ff9540..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/server-actions.md +++ /dev/null @@ -1,348 +0,0 @@ ---- -layout: post -title: Server Actions in ##Platform_Name## Pdfviewer Component -description: Learn here all about Server Actions in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Server Actions -publishingplatform: ##Platform_Name## -documentation: ug ---- - - -# Server Actions - -Syncfusion® PDF Viewer control is client-server oriented. It processes the PDF document on the server-side and sends the processed PDF data to the client to render the PDF document and for further operations in the PDF Viewer. - -The server actions or server methods in the Core PDF Viewer controller are: - -* Load -* RenderPdfPages -* RenderThumbnailImages -* Bookmarks -* RenderAnnotationComments -* Unload -* ExportAnnotations -* ImportAnnotations -* ImportFormFields -* ExportFormFields -* Download -* PrintImages - -## Load action - -N> public IActionResult Load([FromBody] Dictionary jsonObject) - -The [Load](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_Load_System_String_) action will be triggered initially on loading a PDF file. Syncfusion® PDF Viewer control will store the document in the cache based on the hashid during the initial loading of the pdf file. Initially, the request will be sent for 100 pages only and another request will be sent for the remaining pages. So the Load action will get triggered twice when loading a PDF file with pages more than 100, which is called virtual loading. - -This action on its first trigger calls the GetDocumentPath method in the PdfViewerController.cs with which the path of the document is determined. The PDF file to be loaded must be located in the folder structure as specified in the GetDocumentPath method. - -The Load action calls the [Load](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_Load_System_IO_Stream_System_Collections_Generic_Dictionary_System_String_System_String__) method to load the PDF file in the PDF Viewer. - -```cs -public IActionResult Load([FromBody] Dictionary jsonObject) -{ - Console.WriteLine("Load called"); - //Initialize the PDF viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - string documentPath = GetDocumentPath(jsonObject["document"]); - if (!string.IsNullOrEmpty(documentPath)) - { - byte[] bytes = System.IO.File.ReadAllBytes(documentPath); - stream = new MemoryStream(bytes); - } - else - { - return this.Content(jsonObject["document"] + " is not found"); - } - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## RenderPdfPages - -N> public IActionResult RenderPdfPages([FromBody] Dictionary jsonObject) - -Whenever a new page is loaded, [RenderPdfPages](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_RenderPages_System_String_) action will be called. When a PDF file is loaded with PDF Viewer, only two pages will be loaded initially by hitting this action for loading each page. Further pages will be loaded on demand by hitting this action. - -The RenderPdfPages action calls the [GetPage](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetPage_System_Collections_Generic_Dictionary_System_String_System_String__) method to render each PDF pages. - -```cs -public IActionResult RenderPdfPages([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - object jsonResult = pdfviewer.GetPage(jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## RenderThumbnailImages action - -N> public IActionResult RenderThumbnailImages([FromBody] Dictionary jsonObject) - -The [RenderThumbnailImages](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_RenderThumbnail_System_String_) action will be triggered initially on loading a PDF file. It renders the thumbnails images of all the pages in the PDF file. When a thumbnail image is clicked, the RenderPdfPages action will be triggered to load the selected page. - -This action calls the [GetThumbnailImages](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetThumbnailImages_System_Collections_Generic_Dictionary_System_String_System_String__) method. - -```cs -public IActionResult RenderThumbnailImages([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - object result = pdfviewer.GetThumbnailImages(jsonObject); - return Content(JsonConvert.SerializeObject(result)); -} -``` - -## Bookmarks - -N> public IActionResult Bookmarks([FromBody] Dictionary jsonObject) - -The Bookmarks action will be triggered initially on loading a PDF file. All the headings in the PDF file will get added to the Bookmarks collection in the bookmarks panel with the help of this action. When a bookmark is selected, the page containing the selected heading will be rendered or opened. - -This action calls the [GetBookmarks](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetBookmarks_System_Collections_Generic_Dictionary_System_String_System_String__) method. - -```cs -public IActionResult Bookmarks([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - var jsonResult = pdfviewer.GetBookmarks(jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## RenderAnnotationComments - -N> public IActionResult RenderAnnotationComments([FromBody] Dictionary jsonObject) - -The [RenderAnnotationComments](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_RenderComments_System_String_) action will be triggered initially on loading a PDF file. - -It calls the [GetAnnotationComments](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetAnnotationComments_System_Collections_Generic_Dictionary_System_String_System_String__) method to retrieve the annotation comments in the PDF file. - -```cs -public IActionResult RenderAnnotationComments([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - object jsonResult = pdfviewer.GetAnnotationComments(jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## Unload action - -N> public IActionResult Unload([FromBody] Dictionary jsonObject) - -The [Unload](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_Unload_System_String_) action will be triggered on unloading a PDF file by closing or refreshing the browser. - -This action calls the [ClearCache](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_ClearCache_System_Collections_Generic_Dictionary_System_String_System_String__) method to clear the cache objects while closing the PDF Viewer. - -```cs -public IActionResult Unload([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - pdfviewer.ClearCache(jsonObject); - return this.Content("Document cache is cleared"); -} -``` - -## ExportAnnotations action - -N> public IActionResult ExportAnnotations([FromBody] Dictionary jsonObject) - -The [ExportAnnotations](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_ExportAnnotations_System_String_) action will be triggered by clicking either the “Export annotation to JSON file” option or the “Export annotation to XFDF file” option in the annotation toolbar. - -This action calls the [ExportAnnotation](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_ExportAnnotation_System_Collections_Generic_Dictionary_System_String_System_String__) method to export the annotations in the PDF Viewer to a JSON file or an XFDF file. - -```cs -public IActionResult ExportAnnotations([FromBody] Dictionary jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - string jsonResult = pdfviewer.ExportAnnotation(jsonObject); - return Content(jsonResult); -} -``` - -## ImportAnnotations - -N> public IActionResult ImportAnnotations([FromBody] Dictionary jsonObject) - -The [ImportAnnotations](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_ImportAnnotations_System_String_) action will be triggered by clicking the “Import annotation from XFDF file” option in the annotation toolbar. - -This action calls the [ImportAnnotation](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_ImportAnnotation_System_Collections_Generic_Dictionary_System_String_System_String__) method to import the annotations from an XFDF file. - -```cs -public IActionResult ImportAnnotations([FromBody] Dictionary jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - string jsonResult = string.Empty; - object JsonResult; - if (jsonObject != null && jsonObject.ContainsKey("fileName")) - { - string documentPath = GetDocumentPath(jsonObject["fileName"]); - if (!string.IsNullOrEmpty(documentPath)) - { - jsonResult = System.IO.File.ReadAllText(documentPath); - } - else - { - return this.Content(jsonObject["document"] + " is not found"); - } - } - else - { - string extension = Path.GetExtension(jsonObject["importedData"]); - if (extension != ".xfdf") - { - JsonResult = pdfviewer.ImportAnnotation(jsonObject); - return Content(JsonConvert.SerializeObject(JsonResult)); - } - else - { - string documentPath = GetDocumentPath(jsonObject["importedData"]); - if (!string.IsNullOrEmpty(documentPath)) - { - byte[] bytes = System.IO.File.ReadAllBytes(documentPath); - jsonObject["importedData"] = Convert.ToBase64String(bytes); - JsonResult = pdfviewer.ImportAnnotation(jsonObject); - return Content(JsonConvert.SerializeObject(JsonResult)); - } - else - { - return this.Content(jsonObject["document"] + " is not found"); - } - } - } - return Content(jsonResult); -} -``` - -## ImportFormFields action - -N> public IActionResult ImportFormFields([FromBody] Dictionary jsonObject) - -The [ImportFormFields](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_ImportFormFields_System_String_) action will be triggered by calling it from the UI code. - -This action calls the [ImportFormFields](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_ImportFormFields_System_Collections_Generic_Dictionary_System_String_System_String__) method to import the form fields into the PDF Viewer from a JSON object or file. - -```cs -public IActionResult ImportFormFields([FromBody] Dictionary jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - jsonObject["data"] = GetDocumentPath(jsonObject["data"]); - object jsonResult = pdfviewer.ImportFormFields(jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -## ExportFormFields action - -N> public IActionResult ExportFormFields([FromBody] Dictionary jsonObject) - -The [ExportFormFields](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_ExportFormFields_System_String_) action will be triggered by clicking the Submit Form option in the PDF Viewer toolbar. The Submit Form option is enabled only when there are form fields. It exports the form fields into a JSON file. - -This action calls the [ExportFormFields](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_ExportFormFields_System_Collections_Generic_Dictionary_System_String_System_String__) method to export the form fields into a JSON string. - -```cs -public IActionResult ExportFormFields([FromBody] Dictionary jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - string jsonResult = pdfviewer.ExportFormFields(jsonObject); - return Content(jsonResult); -} -``` - -## Download action - -N> public IActionResult Download([FromBody] Dictionary jsonObject) - -The [Download](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_Download_System_String_) action will be triggered by clicking the Download option in the PDF Viewer toolbar to download the PDF file. - -This action calls the [GetDocumentAsBase64](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetDocumentAsBase64_System_Collections_Generic_Dictionary_System_String_System_String__) method to get the PDF file as a base64 string. - -```cs -public IActionResult Download([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - return Content(documentBase); -} -``` - -## PrintImages - -N> public IActionResult PrintImages([FromBody] Dictionary jsonObject) - -The [PrintImages](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerServerActionSettingsBuilder.html#Syncfusion_EJ2_PdfViewer_PdfViewerServerActionSettingsBuilder_Print_System_String_) action will be triggered by clicking the Print option in the PDF Viewer toolbar. - -It calls the [GetPrintImage](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfRenderer.html#Syncfusion_EJ2_PdfViewer_PdfRenderer_GetPrintImage_System_Collections_Generic_Dictionary_System_String_System_String__) method multiple times to get each page in the PDF file as images to print the entire file. - -```cs -public IActionResult PrintImages([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - object pageImage = pdfviewer.GetPrintImage(jsonObject); - return Content(JsonConvert.SerializeObject(pageImage)); -} -``` - -## GetDocumentPath method - -N> private string GetDocumentPath(string document) - -The GetDocumentPath method will be called inside the Load method to get the path of the document to be loaded. - -```cs -private string GetDocumentPath(string document) -{ - string documentPath = string.Empty; - if (!System.IO.File.Exists(document)) - { - var path = _hostingEnvironment.ContentRootPath; - if (System.IO.File.Exists(path + "/Data/" + document)) - documentPath = path + "/Data/" + document; - } - else - { - documentPath = document; - } - Console.WriteLine(documentPath); - return documentPath; -} -``` - -## PdfViewerController constructor - -N> public PdfViewerController(IHostingEnvironment hostingEnvironment, IMemoryCache cache) - -The IMemoryCache is required for rendering the PDF pages in the PDF Viewer control by storing the document in the cache. So, it has been initialized in the PdfViewerController and has to be used in all the controller methods. - -```cs -private IHostingEnvironment _hostingEnvironment; -//Initialize the memory cache object -public IMemoryCache _cache; -public PdfViewerController(IHostingEnvironment hostingEnvironment, IMemoryCache cache) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - Console.WriteLine("PdfViewerController initialized"); -} -``` \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/text-markup-annotation.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/text-markup-annotation.md deleted file mode 100644 index 6175345676..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/text-markup-annotation.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: post -title: Text Markup Annotation in ##Platform_Name## Pdfviewer Component -description: Learn here all about Text Markup Annotation in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Text Markup Annotation -publishingplatform: ##Platform_Name## -documentation: ug ---- - -aspcore/documentation/pdfviewer/annotation/text-markup-annotation/ \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/text-search.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/text-search.md deleted file mode 100644 index 9f004d1657..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/text-search.md +++ /dev/null @@ -1,262 +0,0 @@ ---- -layout: post -title: Text_search in ##Platform_Name## Pdfviewer Component | Syncfusion -description: Learn here all about Text_search in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Text_search -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Text Search in PDF Viewer component - -The Text Search option in PDF Viewer is used to find and highlight the text content from the document. You can enable/disable the text search using the following code snippet. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -![Alt text](./images/search.png) - -## Test search Features - -### Real time search suggestion while typing -Entering text into the search input dynamically displays search suggestions based on the provided input. The suggestions are updated in real-time as text is typed, offering relevant matches from the available content. This feature enhances the search experience by allowing quick access to potential results while typing. - -![Alt text](./images/SingleSearchPopup.png) - -### Selecting Search Suggestions from the Popup -Entering text into the search input triggers a popup displaying relevant suggestions based on the input. Selecting a suggestion from the popup enables direct navigation to its occurrences in the document. - -![Alt text](./images/SearchResultFromPopup.png) - -### Search Text with enabling 'Match Case' checkbox -By enabling the 'Match Case' option and entering text into the search input, only the exact case-sensitive matches in the document are highlighted. This feature allows navigation through each occurrence of the exact text match within the document. - -![Alt text](./images/SearchNavigationMatchCase.png) - -### Search Text without enabling 'Match Case' checkbox -When text is entered into the search input without enabling the 'Match Case' option, all instances of the text, regardless of case, are highlighted in the document. This allows easy navigation through every occurrence of the search term. - -![Alt text](./images/SearchNavigationNoMatchCase.png) - -### Search list of text by enabling 'Match Any Word' checkbox -When the 'Match Any Word' option is enabled, the entered text in the search input is split into individual words based on spaces. As the text is typed, the popup dynamically displays search suggestions for each word in real time, highlighting potential matches within the document. - -![Alt text](./images/MultiSearchPopup.png) - -## Find text method -Searches for the specified text or an array of strings within the document and returns the bounding rectangles for each occurrence. The search can be case-sensitive based on the provided parameters. If a specific page index is provided, it returns the bounding rectangles for these search strings on that page; otherwise, it returns the bounding rectangles for all pages in the document where the strings were found. - -### Find and get the bounds of a text -Searches for the specified text within the document and returns the bounding rectangles of the matched text. The search can be case-sensitive based on the provided parameter. It returns the bounding rectangles for all pages in the document where the text was found. The below code snippet shows how to get the bounds of the given text: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -### Find and get the bounds of a text on the desired page -Searches for the specified text within the document and returns the bounding rectangles of the matched text. The search can be case-sensitive based on the provided parameter. It returns the bounding rectangles for that page in the document where the text was found. The below code snippet shows how to get the bounds of the given text from the desired page: - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -### Find and get the bounds of the list of text -Searches for an array of strings within the document and returns the bounding rectangles for each occurrence. The search can be case-sensitive based on the provided parameters. It returns the bounding rectangles for all pages in the document where the strings were found. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -### Find and get the bounds of the list of text on desired page -Searches for an array of strings within the document and returns the bounding rectangles for each occurrence. The search can be case-sensitive based on the provided parameters. It returns the bounding rectangles for these search strings on that particular page where the strings were found. - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - - - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-backed" %} - - - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/TextSearch) - -## See also - -* [Toolbar items](./toolbar) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/toolbar.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/toolbar.md deleted file mode 100644 index cd668398d2..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/toolbar.md +++ /dev/null @@ -1,770 +0,0 @@ ---- -layout: post -title: Toolbar in ##Platform_Name## Pdfviewer Component|Syncfusion -description: Learn here all about Toolbar in Syncfusion ##Platform_Name## Pdfviewer component of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: Toolbar -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Built-in toolbar in ASP.NET Core PDF Viewer control - -The PDF Viewer comes with a powerful built-in toolbar to execute important actions such as page navigation, text search,view mode,download,print,bookmark, and thumbnails. - -The following table shows built-in toolbar items and its actions:- - -| Option | Description | -|---|---| -| OpenOption | This option provides an action to load the PDF documents to the PDF Viewer.| -| PageNavigationTool |This option provides an action to navigate the pages in the PDF Viewer. It contains GoToFirstPage,GoToLastPage,GotoPage,GoToNext, and GoToLast tools.| -| MagnificationTool | This option provides an action to magnify the pages either with predefined or user defined zoom factors in the PDF Viewer. Contains ZoomIn, ZoomOut, Zoom, FitPage and FitWidth tools| -| PanTool | This option provides an action for panning the pages in the PDF Viewer.| -| SelectionTool |This option provides an action to enable/disable the text selection in the PDF Viewer.| -| SearchOption |This option provides an action to search a word in the PDF documents.| -| PrintOption |This option provides an action to print the PDF document being loaded in the PDF Viewer.| -| DownloadOption |This Download option provides an action to download the PDF document that has been loaded in the PDF Viewer.| -| UndoRedoTool | This tool provides options to undo and redo the annotation actions performed in the PDF Viewer.| -| AnnotationEditTool | This tool provides options to enable or disable the edit mode of annotation in the PDF Viewer.| - -## Show/Hide the built-in toolbar - -The PDF Viewer has an option to show or hide the complete built-in toolbar. You can achieve this by using following two ways., - -* **Show/Hide toolbar using enableToolbar API as in the following code snippet** - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -* **Show/Hide toolbar using showToolbar as in the following code snippet** - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -## Show/Hide the built-in toolbaritem - -The PDF Viewer has an option to show or hide these grouped items in the built-in toolbar. - -* **Show/Hide toolbaritem using toolbarSettings as in the following code snippet.** - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- -{% endhighlight %} -{% endtabs %} - -* **Show/Hide toolbaritem using showToolbaritem as in the following code snippet** - -{% tabs %} -{% highlight cshtml tabtitle="Standalone" %} - -
- - -
- - - -{% endhighlight %} -{% highlight cshtml tabtitle="Server-Backed" %} - -
- - -
- - - -{% endhighlight %} -{% endtabs %} - -## Customize Built-In Toolbar - -PDF Viewer allows you to customize(add, show, hide, enable, and disable) existing items in a toolbar. - -* Add - New items can defined by **CustomToolbarItemModel** and with existing items in [**ToolbarSettings**](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html) property. Newly added item click action can be defined in `toolbarclick`. - -* Show, Hide - Existing items can be shown or hidden using the [`ToolbarSettings`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html) property. Pre-defined toolbar items are available with [`ToolbarItem`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.PdfViewer.PdfViewerToolbarSettings.html#Syncfusion_EJ2_PdfViewer_PdfViewerToolbarSettings_ToolbarItems). - -* Enable, Disable - Toolbar items can be enabled or disable using `enabletoolbaritem`. - -{% tabs %} -{% highlight html tabtitle="Standalone" %} - -@page "{handler?}" -@model IndexModel -@{ - ViewData["Title"] = "Home page"; -} - -
- - -
- - - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -@page "{handler?}" -@model IndexModel -@using Syncfusion.EJ2.PdfViewer -@using Newtonsoft.Json -@{ - ViewData["Title"] = "Home page"; - CustomToolbarItems customToolbarItems = new CustomToolbarItems(); - var toolItem1 = new { id = "submit_form", text = "Submit Form", tooltipText = "Custom toolbar item", align = "Center", cssClass = "custom_button" }; - customToolbarItems.ToolbarItems = new List { toolItem1, "OpenOption", "PageNavigationTool", "MagnificationTool", "PanTool", "SelectionTool", "SearchOption", "PrintOption", "DownloadOption", "UndoRedoTool", "AnnotationEditTool", "FormDesignerEditTool", "CommentTool" }; - PdfViewerToolbarSettings toolbarSettings = new PdfViewerToolbarSettings() - { - ShowTooltip = true, - ToolbarItems = customToolbarItems.ToolbarItems - }; -} - -
- - -
- - - - - - -{% endhighlight %} -{% endtabs %} - -N> Default value of toolbar items is ['OpenOption', 'PageNavigationTool','MagnificationTool', 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'DownloadOption','UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', 'CommentTool', 'SubmitForm'] - -### Align Property - -The align property is used to specify the alignment of a toolbar item within the toolbar. - -`Left`: Aligns the item to the left side of the toolbar. -`Right`: Aligns the item to the right side of the toolbar. - -### Tooltip Property - -The tooltip property is used to set the tooltip text for a toolbar item. Tooltip provides additional information when a user hovers over the item. - -### CssClass Property - -The cssClass property is used to apply custom CSS classes to a toolbar item. It allows custom styling of the toolbar item. - -### Prefix Property - -The prefix property is used to set the CSS class or icon that should be added as a prefix to the existing content of the toolbar item. - -### ID Property - -The id property within a CustomToolbarItemModel is a compulsory attribute that plays a vital role in toolbar customization. It serves as a unique identifier for each toolbar item, facilitating distinct references and interactions. - -When defining or customizing toolbar items, it is mandatory to assign a specific and descriptive id to each item. -These properties are commonly used when defining custom toolbar items with the `CustomToolbarItemModel`` in the context of Syncfusion® PDF Viewer. When configuring the toolbar using the `ToolbarSettings`` property, you can include these properties to customize the appearance and behavior of each toolbar item. - -N> When customizing toolbar items, you have the flexibility to include either icons or text based on your design preference. - -[View sample in GitHub](https://github.com/SyncfusionExamples/asp-core-pdf-viewer-examples/tree/master/How%20to/Customize%20existing%20toolbar) - -## Custom Toolbar - -The PDF Viewer provides API for user interactions options provided in its built-in toolbar. Using this, you can create your own User Interface for toolbar actions in application level by hiding the built-in toolbar. The following steps are used to create the custom toolbar for PDF Viewer:- - -**Step 1:** Follow the steps provided in the [link](https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started) to create simple PDF Viewer sample. - -**Step 2:** Add EJ2 toolbar for performing primary actions like Open,Previous page,Next page,Go to page,Print and Download using the following code snippet., - -```html -@{ - var template = "
of 0
"; - var inputtemplate = "
"; -} - - - - - - - - - - - - - - - -``` - -**Step 3:** Add EJ2 toolbar for performing magnification actions in PDF Viewer using the following code snippet., - -```html -
- - - - - - - -
- -``` - -**Step 4:** Add the following style to achieve the custom toolbar styling., - -```html - -``` - -N>The icons are embedded in the font file used in the previous code snippet. - -**Step 5:** Add the following scripts for performing user interaction in PDF Viewer in code behind. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} - - - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - - - -{% endhighlight %} -{% endtabs %} - -Sample: -[https://ej2.syncfusion.com/aspnetcore/PdfViewer/CustomToolbar#/material](https://ej2.syncfusion.com/aspnetcore/PdfViewer/CustomToolbar#/material) - -## See also - -* [Toolbar customization](./how-to/toolbar-customization) -* [Feature Modules](./feature-module) \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/troubleshooting/document-loading-issues.md b/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/troubleshooting/document-loading-issues.md deleted file mode 100644 index dd8ccdb1af..0000000000 --- a/ej2-asp-core-mvc/pdfviewer/EJ2_ASP.NETCORE/troubleshooting/document-loading-issues.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -layout: post -title: Document Loading Issues in Version 23.1 or Newer ##Platform_Name## Pdfviewer Component -description: Learn here all about troubleshooting Document Loading Issues in Version 23.1 or newer in ##Platform_Name## Pdfviewer of Syncfusion Essential JS 2 and more. -platform: ej2-asp-core-mvc -control: PDF Viewer -publishingplatform: ##Platform_Name## -documentation: ug ---- - -# Document Loading Issues in Version 23.1 or Newer - -If you're experiencing problems with your document not rendering in the viewer, especially when using version 23.1 or a newer version, follow these troubleshooting steps to resolve the issue: - -1. **Check for `viewer.dataBind()` Requirement**: Ensure that you have called `viewer.dataBind()` as required in version 23.1 or newer. This explicit call is essential for initializing data binding and document rendering correctly. It is must to call the dataBind() method before load. - -```html - -
- - -
- - -``` - -2. **Verify Document Source**: Confirm that the document source or URL you're trying to display is valid and accessible. Incorrect URLs or document paths can lead to loading issues. - -3. **Network Connectivity**: Ensure that your application has a stable network connection. Document rendering may fail if the viewer can't fetch the document due to network issues. - -4. **Console Errors**: Use your browser's developer tools to check for any error messages or warnings in the console. These messages can provide insights into what's causing the document not to load. - -5. **Loading Sequence**: Make sure that you're calling `viewer.dataBind()` and initiating document loading in the correct sequence. The viewer should be properly initialized before attempting to load a document. - -7. **Update Viewer**: Ensure that you're using the latest version of the viewer library or framework. Sometimes, issues related to document loading are resolved in newer releases. - -8. **Cross-Origin Resource Sharing (CORS)**: If you're loading documents from a different domain, ensure that CORS headers are correctly configured to allow cross-origin requests. - -9. **Content Security Policies (CSP)**: Check if your application's Content Security Policy allows the loading of external resources, as this can affect document loading. Refer [here](https://ej2.syncfusion.com/javascript/documentation/common/troubleshoot/content-security-policy) to troubleshoot. - -By following these troubleshooting steps, you should be able to address issues related to document loading in version 23.1 or newer, ensuring that your documents render correctly in the viewer. \ No newline at end of file diff --git a/ej2-asp-core-mvc/pdfviewer/images/Checkbox.png b/ej2-asp-core-mvc/pdfviewer/images/Checkbox.png deleted file mode 100644 index 50d4f8ef79..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/Checkbox.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/Dropdown.png b/ej2-asp-core-mvc/pdfviewer/images/Dropdown.png deleted file mode 100644 index 967dea1d08..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/Dropdown.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/ErrorinformationuintheNetworkTab.png b/ej2-asp-core-mvc/pdfviewer/images/ErrorinformationuintheNetworkTab.png deleted file mode 100644 index 8838f9a623..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/ErrorinformationuintheNetworkTab.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/InitialField.png b/ej2-asp-core-mvc/pdfviewer/images/InitialField.png deleted file mode 100644 index dbeabe5261..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/InitialField.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/Listbox.png b/ej2-asp-core-mvc/pdfviewer/images/Listbox.png deleted file mode 100644 index 7501268464..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/Listbox.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/MultiSearchPopup.png b/ej2-asp-core-mvc/pdfviewer/images/MultiSearchPopup.png deleted file mode 100644 index c7e90da243..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/MultiSearchPopup.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/Password.png b/ej2-asp-core-mvc/pdfviewer/images/Password.png deleted file mode 100644 index 09430e212b..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/Password.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/Radiobutton.png b/ej2-asp-core-mvc/pdfviewer/images/Radiobutton.png deleted file mode 100644 index 3599e00845..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/Radiobutton.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/SearchNavigationMatchCase.png b/ej2-asp-core-mvc/pdfviewer/images/SearchNavigationMatchCase.png deleted file mode 100644 index cd1a0229a9..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/SearchNavigationMatchCase.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/SearchNavigationNoMatchCase.png b/ej2-asp-core-mvc/pdfviewer/images/SearchNavigationNoMatchCase.png deleted file mode 100644 index 6a52877f3a..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/SearchNavigationNoMatchCase.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/SearchResultFromPopup.png b/ej2-asp-core-mvc/pdfviewer/images/SearchResultFromPopup.png deleted file mode 100644 index ab754ab652..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/SearchResultFromPopup.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/SingleSearchPopup.png b/ej2-asp-core-mvc/pdfviewer/images/SingleSearchPopup.png deleted file mode 100644 index 19a07343df..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/SingleSearchPopup.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/Textbox.png b/ej2-asp-core-mvc/pdfviewer/images/Textbox.png deleted file mode 100644 index 13eaf454ce..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/Textbox.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/add-role.png b/ej2-asp-core-mvc/pdfviewer/images/add-role.png deleted file mode 100644 index 1f7f58fcf6..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/add-role.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/add_nuget_packages.png b/ej2-asp-core-mvc/pdfviewer/images/add_nuget_packages.png deleted file mode 100644 index c9aad5b656..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/add_nuget_packages.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/add_nuget_packages_core.png b/ej2-asp-core-mvc/pdfviewer/images/add_nuget_packages_core.png deleted file mode 100644 index e27d51e5fb..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/add_nuget_packages_core.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/addformfield.gif b/ej2-asp-core-mvc/pdfviewer/images/addformfield.gif deleted file mode 100644 index 9d63a89d10..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/addformfield.gif and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/app-registration.png b/ej2-asp-core-mvc/pdfviewer/images/app-registration.png deleted file mode 100644 index 052231b9b8..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/app-registration.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/appearanceproperties.png b/ej2-asp-core-mvc/pdfviewer/images/appearanceproperties.png deleted file mode 100644 index 2211f35e9c..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/appearanceproperties.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/bookmark.png b/ej2-asp-core-mvc/pdfviewer/images/bookmark.png deleted file mode 100644 index 9b90e7242e..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/bookmark.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/calibrate_annotation.png b/ej2-asp-core-mvc/pdfviewer/images/calibrate_annotation.png deleted file mode 100644 index d0d12b400e..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/calibrate_annotation.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/calibrate_fillcolor.png b/ej2-asp-core-mvc/pdfviewer/images/calibrate_fillcolor.png deleted file mode 100644 index 9fbe718a05..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/calibrate_fillcolor.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/calibrate_lineprop.png b/ej2-asp-core-mvc/pdfviewer/images/calibrate_lineprop.png deleted file mode 100644 index 74005447fe..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/calibrate_lineprop.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/calibrate_opacity.png b/ej2-asp-core-mvc/pdfviewer/images/calibrate_opacity.png deleted file mode 100644 index 5f0b462cd7..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/calibrate_opacity.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/calibrate_scaledialog.png b/ej2-asp-core-mvc/pdfviewer/images/calibrate_scaledialog.png deleted file mode 100644 index 717ca7360e..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/calibrate_scaledialog.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/calibrate_scaleratio.png b/ej2-asp-core-mvc/pdfviewer/images/calibrate_scaleratio.png deleted file mode 100644 index bca22e025c..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/calibrate_scaleratio.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/calibrate_stroke.png b/ej2-asp-core-mvc/pdfviewer/images/calibrate_stroke.png deleted file mode 100644 index 2c977a6d76..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/calibrate_stroke.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/calibrate_thickness.png b/ej2-asp-core-mvc/pdfviewer/images/calibrate_thickness.png deleted file mode 100644 index 89a070ac44..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/calibrate_thickness.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/calibrate_tool.png b/ej2-asp-core-mvc/pdfviewer/images/calibrate_tool.png deleted file mode 100644 index 6d582c4697..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/calibrate_tool.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/client-secret.png b/ej2-asp-core-mvc/pdfviewer/images/client-secret.png deleted file mode 100644 index 4dcbae2a83..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/client-secret.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/clipboardformfield.png b/ej2-asp-core-mvc/pdfviewer/images/clipboardformfield.png deleted file mode 100644 index 3048e24a14..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/clipboardformfield.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/commentPanel.png b/ej2-asp-core-mvc/pdfviewer/images/commentPanel.png deleted file mode 100644 index 2109bf3ca2..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/commentPanel.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/commentannot.png b/ej2-asp-core-mvc/pdfviewer/images/commentannot.png deleted file mode 100644 index aef21b623f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/commentannot.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/commentsdelete.png b/ej2-asp-core-mvc/pdfviewer/images/commentsdelete.png deleted file mode 100644 index a198306942..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/commentsdelete.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/commentsedit.png b/ej2-asp-core-mvc/pdfviewer/images/commentsedit.png deleted file mode 100644 index a6ae23d0c3..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/commentsedit.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/commentstatus.png b/ej2-asp-core-mvc/pdfviewer/images/commentstatus.png deleted file mode 100644 index 6b7960d4c8..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/commentstatus.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/configure_new_project.png b/ej2-asp-core-mvc/pdfviewer/images/configure_new_project.png deleted file mode 100644 index ae3d614a2c..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/configure_new_project.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/configure_new_project_core.png b/ej2-asp-core-mvc/pdfviewer/images/configure_new_project_core.png deleted file mode 100644 index 32a9311060..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/configure_new_project_core.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/create_core_web_app.png b/ej2-asp-core-mvc/pdfviewer/images/create_core_web_app.png deleted file mode 100644 index e7e94a5a66..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/create_core_web_app.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/create_mvc_web_app.png b/ej2-asp-core-mvc/pdfviewer/images/create_mvc_web_app.png deleted file mode 100644 index 7b0ecd87c2..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/create_mvc_web_app.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/create_new_project.png b/ej2-asp-core-mvc/pdfviewer/images/create_new_project.png deleted file mode 100644 index 92ce11ca83..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/create_new_project.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/create_new_project_core.png b/ej2-asp-core-mvc/pdfviewer/images/create_new_project_core.png deleted file mode 100644 index 2fbd424045..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/create_new_project_core.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/customstamp.png b/ej2-asp-core-mvc/pdfviewer/images/customstamp.png deleted file mode 100644 index 0fe3cfa789..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/customstamp.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/default-template-mvc.png b/ej2-asp-core-mvc/pdfviewer/images/default-template-mvc.png deleted file mode 100644 index 81a250ace4..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/default-template-mvc.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/default-template.png b/ej2-asp-core-mvc/pdfviewer/images/default-template.png deleted file mode 100644 index 34fc6a83c8..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/default-template.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/delete_button.png b/ej2-asp-core-mvc/pdfviewer/images/delete_button.png deleted file mode 100644 index 83c6ac3201..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/delete_button.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/deletesign.png b/ej2-asp-core-mvc/pdfviewer/images/deletesign.png deleted file mode 100644 index e0b6288ebb..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/deletesign.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/download.png b/ej2-asp-core-mvc/pdfviewer/images/download.png deleted file mode 100644 index 1c7228cce6..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/download.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/dragformfield.gif b/ej2-asp-core-mvc/pdfviewer/images/dragformfield.gif deleted file mode 100644 index a1eeadc8b6..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/dragformfield.gif and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/dropdownproperties.png b/ej2-asp-core-mvc/pdfviewer/images/dropdownproperties.png deleted file mode 100644 index 1a28424b55..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/dropdownproperties.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/editAnnotation.png b/ej2-asp-core-mvc/pdfviewer/images/editAnnotation.png deleted file mode 100644 index 9086dcb152..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/editAnnotation.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/edit_color.png b/ej2-asp-core-mvc/pdfviewer/images/edit_color.png deleted file mode 100644 index 56a60f53b4..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/edit_color.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/edit_opacity.png b/ej2-asp-core-mvc/pdfviewer/images/edit_opacity.png deleted file mode 100644 index 0996a2ec06..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/edit_opacity.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/fillcolor.png b/ej2-asp-core-mvc/pdfviewer/images/fillcolor.png deleted file mode 100644 index 13d739a38b..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/fillcolor.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/fontcolor.png b/ej2-asp-core-mvc/pdfviewer/images/fontcolor.png deleted file mode 100644 index 0cde87e8a2..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/fontcolor.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/fontfamily.png b/ej2-asp-core-mvc/pdfviewer/images/fontfamily.png deleted file mode 100644 index 323d2abc6f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/fontfamily.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/fontopacity.png b/ej2-asp-core-mvc/pdfviewer/images/fontopacity.png deleted file mode 100644 index 569f97e8b0..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/fontopacity.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/fontsize.png b/ej2-asp-core-mvc/pdfviewer/images/fontsize.png deleted file mode 100644 index 1d38a63854..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/fontsize.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/fontstroke.png b/ej2-asp-core-mvc/pdfviewer/images/fontstroke.png deleted file mode 100644 index 0182264bf4..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/fontstroke.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/fontstyle.png b/ej2-asp-core-mvc/pdfviewer/images/fontstyle.png deleted file mode 100644 index 5a70f9a5de..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/fontstyle.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/fontthickness.png b/ej2-asp-core-mvc/pdfviewer/images/fontthickness.png deleted file mode 100644 index df4c88ea57..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/fontthickness.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/formfilling.png b/ej2-asp-core-mvc/pdfviewer/images/formfilling.png deleted file mode 100644 index a29ea146b0..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/formfilling.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/freetext_tool.png b/ej2-asp-core-mvc/pdfviewer/images/freetext_tool.png deleted file mode 100644 index 3d535b6cc5..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/freetext_tool.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/generalproperties.png b/ej2-asp-core-mvc/pdfviewer/images/generalproperties.png deleted file mode 100644 index cf7b942a9a..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/generalproperties.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/handwritten_sign.png b/ej2-asp-core-mvc/pdfviewer/images/handwritten_sign.png deleted file mode 100644 index 8a47a0a30f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/handwritten_sign.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/highlight_button.PNG b/ej2-asp-core-mvc/pdfviewer/images/highlight_button.PNG deleted file mode 100644 index d4f9541ae7..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/highlight_button.PNG and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/highlight_context.png b/ej2-asp-core-mvc/pdfviewer/images/highlight_context.png deleted file mode 100644 index 2bf8550463..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/highlight_context.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/import.gif b/ej2-asp-core-mvc/pdfviewer/images/import.gif deleted file mode 100644 index 54d25773a0..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/import.gif and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/ink_annotation.png b/ej2-asp-core-mvc/pdfviewer/images/ink_annotation.png deleted file mode 100644 index fcb11e9e5f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/ink_annotation.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/ink_opacity.png b/ej2-asp-core-mvc/pdfviewer/images/ink_opacity.png deleted file mode 100644 index 2bb29b8c23..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/ink_opacity.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/ink_strokecolor.png b/ej2-asp-core-mvc/pdfviewer/images/ink_strokecolor.png deleted file mode 100644 index 57277d821f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/ink_strokecolor.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/ink_thickness.png b/ej2-asp-core-mvc/pdfviewer/images/ink_thickness.png deleted file mode 100644 index 31b3509b2b..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/ink_thickness.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/ink_tool.png b/ej2-asp-core-mvc/pdfviewer/images/ink_tool.png deleted file mode 100644 index 393d2d79b7..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/ink_tool.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/insert-delete-copy.gif b/ej2-asp-core-mvc/pdfviewer/images/insert-delete-copy.gif deleted file mode 100644 index c617714bd3..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/insert-delete-copy.gif and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/link.png b/ej2-asp-core-mvc/pdfviewer/images/link.png deleted file mode 100644 index d15eb11841..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/link.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/mobileToolbar.png b/ej2-asp-core-mvc/pdfviewer/images/mobileToolbar.png deleted file mode 100644 index fb6cdfe793..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/mobileToolbar.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/more-options.png b/ej2-asp-core-mvc/pdfviewer/images/more-options.png deleted file mode 100644 index e722639bff..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/more-options.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/navigation.png b/ej2-asp-core-mvc/pdfviewer/images/navigation.png deleted file mode 100644 index b78cb3a3e0..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/navigation.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/networktab.png b/ej2-asp-core-mvc/pdfviewer/images/networktab.png deleted file mode 100644 index 60befbf974..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/networktab.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_core.png b/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_core.png deleted file mode 100644 index 0954be6ccb..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_core.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_mvc.png b/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_mvc.png deleted file mode 100644 index a6a215b84e..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_mvc.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_mvc5.png b/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_mvc5.png deleted file mode 100644 index 982f0634b6..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_mvc5.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_pdfviewer_aspnet_mvc5.png b/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_pdfviewer_aspnet_mvc5.png deleted file mode 100644 index 0643717578..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_pdfviewer_aspnet_mvc5.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_pdfviewer_core.png b/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_pdfviewer_core.png deleted file mode 100644 index 0fa33e4a90..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_pdfviewer_core.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_pdfviewer_mvc.PNG b/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_pdfviewer_mvc.PNG deleted file mode 100644 index c7acd1a44f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/nuget_ej2_pdfviewer_mvc.PNG and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/nuget_newtonsoftjson.png b/ej2-asp-core-mvc/pdfviewer/images/nuget_newtonsoftjson.png deleted file mode 100644 index 47c75f6285..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/nuget_newtonsoftjson.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/openexistingpdf.gif b/ej2-asp-core-mvc/pdfviewer/images/openexistingpdf.gif deleted file mode 100644 index d90d3a848e..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/openexistingpdf.gif and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/organize-page.png b/ej2-asp-core-mvc/pdfviewer/images/organize-page.png deleted file mode 100644 index b43b9d5d42..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/organize-page.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/organizePages.png b/ej2-asp-core-mvc/pdfviewer/images/organizePages.png deleted file mode 100644 index ea648f5187..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/organizePages.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/pan.png b/ej2-asp-core-mvc/pdfviewer/images/pan.png deleted file mode 100644 index 4fd0f181eb..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/pan.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/pdfium_dll_settings.png b/ej2-asp-core-mvc/pdfviewer/images/pdfium_dll_settings.png deleted file mode 100644 index 92f171ef54..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/pdfium_dll_settings.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/pdfviewer-control.png b/ej2-asp-core-mvc/pdfviewer/images/pdfviewer-control.png deleted file mode 100644 index 46fb505fbe..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/pdfviewer-control.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/print.png b/ej2-asp-core-mvc/pdfviewer/images/print.png deleted file mode 100644 index 76effb3fe3..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/print.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/printformfield.gif b/ej2-asp-core-mvc/pdfviewer/images/printformfield.gif deleted file mode 100644 index ce73a772ee..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/printformfield.gif and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/resizeformfield.gif b/ej2-asp-core-mvc/pdfviewer/images/resizeformfield.gif deleted file mode 100644 index 1a5ac7d8b5..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/resizeformfield.gif and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/rotate-rearrange.gif b/ej2-asp-core-mvc/pdfviewer/images/rotate-rearrange.gif deleted file mode 100644 index 172906f96e..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/rotate-rearrange.gif and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/saveformfield.gif b/ej2-asp-core-mvc/pdfviewer/images/saveformfield.gif deleted file mode 100644 index 8b18566559..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/saveformfield.gif and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/search.png b/ej2-asp-core-mvc/pdfviewer/images/search.png deleted file mode 100644 index 65507af340..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/search.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/searchOption.png b/ej2-asp-core-mvc/pdfviewer/images/searchOption.png deleted file mode 100644 index f896cfb838..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/searchOption.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/selectall.png b/ej2-asp-core-mvc/pdfviewer/images/selectall.png deleted file mode 100644 index efe64ff322..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/selectall.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/selection.png b/ej2-asp-core-mvc/pdfviewer/images/selection.png deleted file mode 100644 index 96a70a4d4d..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/selection.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/selectstamp_annot.png b/ej2-asp-core-mvc/pdfviewer/images/selectstamp_annot.png deleted file mode 100644 index 8b27bca4a6..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/selectstamp_annot.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/shape_annot.png b/ej2-asp-core-mvc/pdfviewer/images/shape_annot.png deleted file mode 100644 index c89f9797b2..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/shape_annot.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/shape_fillcolor.png b/ej2-asp-core-mvc/pdfviewer/images/shape_fillcolor.png deleted file mode 100644 index 4192ffd645..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/shape_fillcolor.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/shape_lineproperty.png b/ej2-asp-core-mvc/pdfviewer/images/shape_lineproperty.png deleted file mode 100644 index 710770547f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/shape_lineproperty.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/shape_opacity.png b/ej2-asp-core-mvc/pdfviewer/images/shape_opacity.png deleted file mode 100644 index 6e1e313283..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/shape_opacity.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/shape_strokecolor.png b/ej2-asp-core-mvc/pdfviewer/images/shape_strokecolor.png deleted file mode 100644 index 72870a9bc6..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/shape_strokecolor.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/shape_thickness.png b/ej2-asp-core-mvc/pdfviewer/images/shape_thickness.png deleted file mode 100644 index 5e7dfdfe11..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/shape_thickness.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/shape_toolbar.png b/ej2-asp-core-mvc/pdfviewer/images/shape_toolbar.png deleted file mode 100644 index 952b3ac7b4..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/shape_toolbar.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/sign.png b/ej2-asp-core-mvc/pdfviewer/images/sign.png deleted file mode 100644 index 6dc51c0bef..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/sign.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/signature.png b/ej2-asp-core-mvc/pdfviewer/images/signature.png deleted file mode 100644 index 13ab69b7a4..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/signature.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/signature_added.png b/ej2-asp-core-mvc/pdfviewer/images/signature_added.png deleted file mode 100644 index b42f1d86cd..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/signature_added.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/signature_field.png b/ej2-asp-core-mvc/pdfviewer/images/signature_field.png deleted file mode 100644 index 939ea85fc8..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/signature_field.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/signature_panel.png b/ej2-asp-core-mvc/pdfviewer/images/signature_panel.png deleted file mode 100644 index 8961905f8f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/signature_panel.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/signature_properties.png b/ej2-asp-core-mvc/pdfviewer/images/signature_properties.png deleted file mode 100644 index 3afa1c0ebe..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/signature_properties.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/signaturefield.png b/ej2-asp-core-mvc/pdfviewer/images/signaturefield.png deleted file mode 100644 index a29ea146b0..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/signaturefield.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/solution-explorer-core.png b/ej2-asp-core-mvc/pdfviewer/images/solution-explorer-core.png deleted file mode 100644 index 913cc84605..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/solution-explorer-core.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/solution-explorer-mvc.png b/ej2-asp-core-mvc/pdfviewer/images/solution-explorer-mvc.png deleted file mode 100644 index 2a1dfcaeea..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/solution-explorer-mvc.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/squiggly_button.png b/ej2-asp-core-mvc/pdfviewer/images/squiggly_button.png deleted file mode 100644 index 86418c5b1a..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/squiggly_button.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/squiggly_context.png b/ej2-asp-core-mvc/pdfviewer/images/squiggly_context.png deleted file mode 100644 index 97377da1d1..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/squiggly_context.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/stamp_annot.png b/ej2-asp-core-mvc/pdfviewer/images/stamp_annot.png deleted file mode 100644 index e04aa9e33d..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/stamp_annot.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/stamp_tool.png b/ej2-asp-core-mvc/pdfviewer/images/stamp_tool.png deleted file mode 100644 index 9762ce862e..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/stamp_tool.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/sticky_editbtn.png b/ej2-asp-core-mvc/pdfviewer/images/sticky_editbtn.png deleted file mode 100644 index 34418519e8..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/sticky_editbtn.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/sticky_opacity.png b/ej2-asp-core-mvc/pdfviewer/images/sticky_opacity.png deleted file mode 100644 index 6c68d69b9a..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/sticky_opacity.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/stickycomment.png b/ej2-asp-core-mvc/pdfviewer/images/stickycomment.png deleted file mode 100644 index 414a116266..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/stickycomment.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/stickynotes_annotation.png b/ej2-asp-core-mvc/pdfviewer/images/stickynotes_annotation.png deleted file mode 100644 index 8648bd0b8a..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/stickynotes_annotation.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/stickynotes_comment.png b/ej2-asp-core-mvc/pdfviewer/images/stickynotes_comment.png deleted file mode 100644 index bbd7ebc6ed..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/stickynotes_comment.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/stickynotes_tool.png b/ej2-asp-core-mvc/pdfviewer/images/stickynotes_tool.png deleted file mode 100644 index ab8781a26c..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/stickynotes_tool.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/storage-account.png b/ej2-asp-core-mvc/pdfviewer/images/storage-account.png deleted file mode 100644 index fe240b165d..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/storage-account.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/strikethrough_button.png b/ej2-asp-core-mvc/pdfviewer/images/strikethrough_button.png deleted file mode 100644 index 290c4aa45c..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/strikethrough_button.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/strikethrough_context.png b/ej2-asp-core-mvc/pdfviewer/images/strikethrough_context.png deleted file mode 100644 index 65e3bc808f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/strikethrough_context.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/text_markup_annotation.png b/ej2-asp-core-mvc/pdfviewer/images/text_markup_annotation.png deleted file mode 100644 index a0684a6282..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/text_markup_annotation.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/textalign.png b/ej2-asp-core-mvc/pdfviewer/images/textalign.png deleted file mode 100644 index c2914440b8..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/textalign.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/thumbnail.png b/ej2-asp-core-mvc/pdfviewer/images/thumbnail.png deleted file mode 100644 index a4effd64b3..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/thumbnail.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/toc.png b/ej2-asp-core-mvc/pdfviewer/images/toc.png deleted file mode 100644 index 26646b2345..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/toc.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/toolbar.png b/ej2-asp-core-mvc/pdfviewer/images/toolbar.png deleted file mode 100644 index c5705e764f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/toolbar.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/underline_button.png b/ej2-asp-core-mvc/pdfviewer/images/underline_button.png deleted file mode 100644 index 0688698b5f..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/underline_button.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/underline_context.png b/ej2-asp-core-mvc/pdfviewer/images/underline_context.png deleted file mode 100644 index 6ef56768cc..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/underline_context.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/undo-redo.png b/ej2-asp-core-mvc/pdfviewer/images/undo-redo.png deleted file mode 100644 index 3ead9ff13d..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/undo-redo.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/upload-pdf.png b/ej2-asp-core-mvc/pdfviewer/images/upload-pdf.png deleted file mode 100644 index d49aaabfb0..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/upload-pdf.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/webservice.png b/ej2-asp-core-mvc/pdfviewer/images/webservice.png deleted file mode 100644 index 5dea7153a4..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/webservice.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/zoom.png b/ej2-asp-core-mvc/pdfviewer/images/zoom.png deleted file mode 100644 index 41a2221059..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/zoom.png and /dev/null differ diff --git a/ej2-asp-core-mvc/pdfviewer/images/zoomOrganize.png b/ej2-asp-core-mvc/pdfviewer/images/zoomOrganize.png deleted file mode 100644 index e55f6058b4..0000000000 Binary files a/ej2-asp-core-mvc/pdfviewer/images/zoomOrganize.png and /dev/null differ diff --git a/ej2-asp-core-toc.html b/ej2-asp-core-toc.html index 6fb16d340b..2dd3fde4d7 100644 --- a/ej2-asp-core-toc.html +++ b/ej2-asp-core-toc.html @@ -1911,126 +1911,6 @@ -
  • PDF Viewer - -
  • -
  • Pivot Table
  • 2019 Volume 1 - 17.1.* diff --git a/ej2-asp-mvc-toc.html b/ej2-asp-mvc-toc.html index c07110af5c..8782cf503f 100644 --- a/ej2-asp-mvc-toc.html +++ b/ej2-asp-mvc-toc.html @@ -1871,129 +1871,6 @@
  • -
  • PDF Viewer - -
  • -
  • Pivot Table