Skip to content

Commit 9bd391d

Browse files
987332: Update the How To section in MVC
1 parent f36999c commit 9bd391d

File tree

64 files changed

+1649
-678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1649
-678
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
layout: post
3+
title: FAQ Section in Pdfviewer control | Syncfusion
4+
description: In this section, you can know about the various questions asked about manipulation of in Pdfviewer control.
5+
platform: document-processing
6+
control: PDF Viewer
7+
documentation: ug
8+
---
9+
10+
# Frequently Asked Questions Section in PdfViewer Component
11+
12+
The frequently asked questions in Essential<sup>&reg;</sup> Pdfviewer are listed below.
13+
14+
* [How to add annotation in text search in ASP.NET MVC ?](./how-to/add-annotation-in-text-search)
15+
* [How to add custom header to the PDF Viewer ajax request?](./how-to/include-the-authorization-token)
16+
* [How to add a save button to PDF Viewer toolbar?](./how-to/add-save-button)
17+
* [How to customize the annotation selectors?](./how-to/configure-annotation-selector-setting)
18+
* [How to delete a specific annotation from the PDF document?](./how-to/delete-a-specific-annotation)
19+
* [How to control the visibility of the annotation?](./how-to/control-annotation-visibility)
20+
* [How to convert the PDF library bounds to PDF viewer bounds?](./how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds)
21+
* [How to customize the context menu in PDF Viewer?](./how-to/custom-context-menu)
22+
* [How to add custom font in handwritten signature?](./how-to/custom-font-signature-field)
23+
* [How to add custom fonts for form fields and free text annotations?](./how-to/custom-fonts)
24+
* [How to customize text search highlight color in PDF Viewer?](./how-to/customize-text-search-color)
25+
* [How to disable the context menu?](./how-to/disable-context-menu)
26+
* [How to disable tile rendering in PDF Viewer?](./how-to/disable-tile-rendering)
27+
* [How to get the download start event?](./how-to/download-start-event)
28+
* [How to enable or disable the local storage?](./how-to/enable-local-storage)
29+
* [Enable the resizer for text markup annotation?](./how-to/enable-resize)
30+
* [How to enable or disable the text selection?](./how-to/enable-text-selection)
31+
* [How to export the PDF pages as images?](./how-to/export-as-image)
32+
* [How to extract text from the PDF document?](./how-to/extract-text-completed)
33+
* [How to extract text from a specific region?](./how-to/extract-text-option)
34+
* [How to extract text from the PDF document?](./how-to/extract-text)
35+
* [How to find the text in the PDF document asynchronously?](./how-to/find-text-async)
36+
* [How to get the base64 string of the loaded document?](./how-to/get-base64)
37+
* [How to get the page information of the loaded document?](./how-to/get-page-info)
38+
* [How to identify the added annotation and its mode?](./how-to/identify-added-annotation-mode)
39+
* [How to import and export annotations in PDF Viewer?](./how-to/import-export-annotation)
40+
* [How to load a PDF document in PDF Viewer?](./how-to/load-documents)
41+
* [How to set the minimum and maximum zoom percentage?](./how-to/min-max-zoom)
42+
* [How to open the bookmark pane when the document is loaded?](./how-to/open-bookmark)
43+
* [How to open the thumbnail pane when the document is loaded?](./how-to/open-thumbnail)
44+
* [How to get the page render started and completed event?](./how-to/pagerenderstarted-pagerendercompleted)
45+
* [How to resolve the `Unable to find an entry point named 'FreeExportedValues' in DLL 'pdfium''?](./how-to/resolve-unable-to-find-an-entry-point-error)
46+
* [How to restrict the zooming in mobile mode?](./how-to/restricting-zoom-in-mobile-mode)
47+
* [How to show custom stamp item in the stamp annotation?](./how-to/show-custom-stamp-item)
48+
* [How to show or hide a particular annotation?](./how-to/show-hide-annotation)
49+
* [How to get the signature selected and unselected event?](./how-to/signatureselect-signatureunselect)
50+
* [How to unload the PDF document from the viewer?](./how-to/unload-document)
51+
* [How to clear the Web service not listening error?](./how-to/webservice-not-listening)
52+
* [How to Enable Bookmark pane in PDF Viewer?](./how-to/show-bookmark)
53+
* [How to Save original document at the server side?](./how-to/save-original-document-at-the-server-side)
54+
* [How to Configure retry timeout in PDF Viewer?](./how-to/retry-timeout)
55+
* [How to Resolve the Pdfium issue in PDF Viewer?](./how-to/resolve-pdfium-issue)
56+
* [How to Load N number of pages on initial loading in PDF Viewer?](./how-to/load-n-number-page)
57+
* [How to Instantiate the PDF Viewer component dynamically in PDF Viewer?](./how-to/Instantiate-pdfviewer-dynamically)
58+
* [How to Install packages based on OS in PDF Viewer?](./how-to/install-packages)
59+
* [How to Extract Text using TextLineCollection in PDF Viewer?](./how-to/extract-text-using-text-collection)
60+
* [How to Export As Image from PDF document in PDF Viewer?](./how-to/export-as-image-standalone)
61+
* [How to Display document without downloading in PDF Viewer?](./how-to/display-document-without-downloading)
62+
* [How to Capture the current page number being viewed in PDF Viewer?](./how-to/capture-page-number)
63+
* [How to select annotations in multi page?](./how-to/select-multi-page-annotations)
64+
* [How to get the annotation when it is overlapped with another annotation on its selection?](./how-to/overlapped-annotation)
65+
* [How to print the PDF document silently?](./how-to/print-document)
66+
* [How to Access the file name from PDF in PDF Viewer?](./how-to/access-file-name)
67+
* [How to Close the Comment Panel in PDF Viewer?](./how-to/close-comment-panel)
68+
* [How to Change the default Width of PDF Viewer?](./how-to/default-width-height)
69+
* [How to Delete an annotation from a PDF in PDF Viewer?](./how-to/delete-annotation)
70+
* [How to Identify PDF is edited in PDF Viewer?](./how-to/identify-the-loaded-document-is-edited)
71+
* [How to Load blancing environment in PDF Viewer?](./how-to/load-balancing-environment)
72+
* [How to Load the document in PDF Viewer?](./how-to/load-the-document)
73+
* [How to Redirect to the Home page in PDF Viewer?](./how-to/redirect-to-home-page)
74+
* [How to set Author name for annotation in PDF Viewer?](./how-to/set-author-name-to-annotation)
75+
* [How to Show notification dialog in PDF Viewer?](./how-to/show-notification-dialog)
76+
* [How to set date to the signature in PDF Viewer?](./how-to/signature-date)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
layout: post
3+
title: Dynamically instantiate the ASP.NET MVC PDF Viewer | Syncfusion
4+
description: Learn how to instantiate the Syncfusion ASP.NET MVC PDF Viewer at runtime and load PDF documents on demand.
5+
platform: document-processing
6+
control: PDF Viewer
7+
documentation: ug
8+
---
9+
10+
# Dynamically instantiate the ASP.NET MVC PDF Viewer
11+
12+
Create the Syncfusion<sup style="font-size:70%">&reg;</sup> PDF Viewer instance at runtime when a document request succeeds, instead of rendering it during the initial page load. This approach is useful when the PDF is determined after user input or must be fetched securely from a server endpoint.
13+
14+
Follow these steps to instantiate the component dynamically:
15+
16+
- Confirm that the application references the required Syncfusion EJ2 scripts and styles and that the PDF Viewer service endpoint is available in the ASP.NET MVC application.
17+
- Add a container element and a button (or another trigger) to the Razor view. The trigger initiates an AJAX request that retrieves the document information.
18+
- Inside the callback, create a new viewer instance, set its [`serviceUrl`](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_serviceUrl) to the controller endpoint, assign the document identifier to [`documentPath`](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.PdfViewer.PdfViewer.html#Syncfusion_EJ2_PdfViewer_PdfViewer_documentPath), and call `appendTo` to render the control in the container.
19+
20+
```html
21+
22+
<button id="loadPDF Viewer" onclick="loadPDFViewer()">Load PDF Viewer</button>
23+
24+
<div id="e-pv-e-sign-pdfViewer-div">
25+
@Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").Render()
26+
</div>
27+
28+
<script type="text/javascript">
29+
function loadPDFViewer() {
30+
var pdfViewer = document.getElementById('pdfviewer').ej2_instances[0];
31+
var xhr = new XMLHttpRequest();
32+
xhr.open('GET', '/Home/GetPdfDocument', true);
33+
34+
xhr.onreadystatechange = function () {
35+
if (xhr.readyState === 4 && xhr.status === 200) {
36+
var base64String = 'data:application/pdf;base64,' + xhr.responseText;
37+
pdfViewer.load(base64String);
38+
}
39+
};
40+
41+
xhr.send();
42+
}
43+
</script>
44+
45+
```
46+
47+
Ensure that the controller action returns the PDF file or document token expected by the viewer and that the response respects authentication requirements. Dispose of the dynamically created viewer when it is no longer needed to release resources.

Document-Processing/PDF/PDF-Viewer/asp-net-mvc/how-to/access-file-name.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
---
22
layout: post
3-
title: Access File Name in ASP.NET MVC Pdfviewer Component
4-
description: Learn here all about Access File Name in Syncfusion ASP.NET MVC Pdfviewer component of Syncfusion Essential JS 2 and more.
3+
title: Access or Change File Name in ASP.NET MVC PDF Viewer | Syncfusion
4+
description: Learn how to access the loaded PDF filename and change the download filename using the DocumentLoad and DownloadEnd events in the Syncfusion ASP.NET MVC PDF Viewer.
55
platform: document-processing
6-
control: Access File Name
6+
control: PDF Viewer
77
publishingplatform: ASP.NET MVC
88
documentation: ug
99
---
1010

11+
# Access or change the PDF filename
1112

12-
# Access file name
13+
The Syncfusion ASP.NET MVC PDF Viewer allows you to access the filename of the loaded PDF document, and to customize the filename used when the document is downloaded. This is achieved using the `DocumentLoad` and `DownloadEnd` events.
1314

14-
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.
15+
The following steps demonstrate how to access and modify the filename in the PDF Viewer:
1516

16-
The following steps are used to access the file name of loaded PDF document in PDF viewer control,
17+
**Step 1:** Create an ASP.NET MVC PDF Viewer sample by following the [getting started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-mvc/getting-started/).
1718

18-
**Step 1:** Follow the steps provided in the [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-mvc/getting-started/) to create simple PDF Viewer sample.
19+
**Step 2:** Access and change the filename using the code snippets below.
1920

20-
**Step 2:** Access file name using below code snippet,
21+
In the `DocumentLoad` or `DownloadEnd` event handler, you can access the original filename from `args.fileName`. To change the filename for download, set the `viewer.downloadFileName` property.
2122

2223
{% tabs %}
2324
{% highlight html tabtitle="Standalone" %}
@@ -55,4 +56,4 @@ The following steps are used to access the file name of loaded PDF document in P
5556
{% endhighlight %}
5657
{% endtabs %}
5758

58-
Download the sample [how to access file name](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVC_SAMPLE-609765609)
59+
Download the sample [how to access file name](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVC_SAMPLE-609765609)

Document-Processing/PDF/PDF-Viewer/asp-net-mvc/how-to/add-annotation-in-text-search.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
---
22
layout: post
3-
title: Add Annotation in Text Search in ASP.NET MVC | Syncfusion
4-
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.
3+
title: Add Rectangle Annotation via Text Search in ASP.NET MVC | Syncfusion
4+
description: Learn to add rectangle annotations using text search bounds in the Syncfusion ASP.NET MVC PDF Viewer component, including initialization and search controls.
55
platform: document-processing
66
control: PDF Viewer
7-
publishingplatform: ASP.NET MVC
87
documentation: ug
98
---
109

11-
# Add Rectangle Annotations Using Search Text Bounds in PDF Viewer
10+
# Add rectangle annotations using text search bounds in PDF Viewer
1211

13-
## Overview
12+
A concise guide to adding rectangle annotations at highlighted text search results in the ASP.NET MVC PDF Viewer to visually emphasize matches and improve readability.
1413

15-
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.
14+
## Steps to add rectangle annotations on search result highlight
1615

17-
## Steps to Add Rectangle Annotations on Search Result Highlight
16+
**Step 1:** Follow the steps provided in the [Syncfusion PDF Viewer Getting Started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-mvc/getting-started) to create a simple ASP.NET MVC PDF Viewer sample.
1817

19-
**Step 1:** Set Up the PDF Viewer in Your ASP.NET MVC Project
20-
21-
Follow the steps provided in the [Syncfusion PDF Viewer Getting Started Guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/asp-net-mvc/getting-started/) to create a basic PDF Viewer sample.
22-
23-
**Step 2:** Set Up the PdfViewer Component to add rectangle annotations based on the bounds of highlighted search text in the PDF Viewer.
18+
**Step 2:** Configure the PDF Viewer to add rectangle annotations based on the bounds of highlighted search text.
2419

2520
```cs
2621
@using Syncfusion.EJ2
@@ -82,6 +77,8 @@ Follow the steps provided in the [Syncfusion PDF Viewer Getting Started Guide](h
8277
</script>
8378
```
8479

85-
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.
80+
**Step 3:** Handle the `textSearchHighlight` event to add a rectangle annotation for each highlighted match. The `handleTextSearchHighlight` callback in the script adds the annotation by using the bounds returned from the search event.
81+
82+
Following these steps enables the PDF Viewer to add rectangle annotations at search result locations, improving the visibility of matches in your ASP.NET mvc application.
8683

87-
[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to)
84+
[View sample in GitHub](https://github.com/SyncfusionExamples/mvc-pdf-viewer-examples/tree/master/How%20to)

0 commit comments

Comments
 (0)