Skip to content

Commit 01a218c

Browse files
SaravanaPriya31SaravanaPriya31
SaravanaPriya31
authored and
SaravanaPriya31
committed
888629: commit
1 parent df55fba commit 01a218c

20 files changed

+1057
-109
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
layout: post
3+
title: Controlling File Downloads in EJ2 ASP.NET MVC PDF Viewer | Syncfusion
4+
description: Learn here how to Controlling File Downloads in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more.
5+
platform: ej2-asp-core-mvc
6+
control: PDF Viewer
7+
publishingplatform: ##Platform_Name##
8+
documentation: ug
9+
---
10+
11+
# Controlling File Downloads in Syncfusion PDF Viewer
12+
13+
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.
14+
15+
### Using the downloadStart Event
16+
17+
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.
18+
19+
{% tabs %}
20+
{% highlight html tabtitle="Standalone" %}
21+
22+
@{
23+
ViewBag.Title = "Home Page";
24+
}
25+
26+
<div style="width:100%;height:600px">
27+
@Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").DownloadStart("downloadStart").Render()
28+
</div>
29+
30+
<script>
31+
function downloadStart(args) {
32+
// Your custom logic here
33+
args.cancel = true; // Prevent download action
34+
};
35+
</script>
36+
37+
{% endhighlight %}
38+
{% highlight html tabtitle="Server-Backed" %}
39+
40+
@{
41+
ViewBag.Title = "Home Page";
42+
}
43+
44+
<div style="width:100%;height:600px">
45+
@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").DownloadStart("downloadStart").Render()
46+
</div>
47+
48+
<script>
49+
function downloadStart(args) {
50+
// Your custom logic here
51+
args.cancel = true; // Prevent download action
52+
};
53+
</script>
54+
55+
{% endhighlight %}
56+
{% endtabs %}
57+
58+
59+
By default, the cancel argument is set to `false`, indicating that the download action will proceed unless explicitly canceled by your custom logic.
60+
61+
### Enhanced Flexibility
62+
63+
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.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
layout: post
3+
title: Minimum and Maximum Zoom in EJ2 ASP.NET MVC PDF Viewer | Syncfusion
4+
description: Learn here all about Minimum and Maximum Zoom in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more.
5+
platform: ej2-asp-core-mvc
6+
control: PDF Viewer
7+
publishingplatform: ##Platform_Name##
8+
documentation: ug
9+
---
10+
11+
## Minimum and Maximum Zoom Properties
12+
13+
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.
14+
15+
### minZoom
16+
17+
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.
18+
19+
### maxZoom
20+
21+
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.
22+
23+
```cs
24+
25+
@{
26+
ViewBag.Title = "Home Page";
27+
double maxZoom = 200;
28+
double minZoom = 20;
29+
}
30+
31+
<div>
32+
<div style="height:100%; width: 100%;">
33+
@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/Home/")).DocumentPath("PDF_Succinctly.pdf").MaxZoom(maxZoom).MinZoom(minZoom).Render()
34+
</div>
35+
</div>
36+
```
37+
38+
#### Restrict Zoom Percentage on Mobile Devices
39+
40+
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.
41+
42+
{% tabs %}
43+
{% highlight html tabtitle="Standalone" %}
44+
45+
<div style="width:100%;height:600px">
46+
@Html.EJS().PdfViewer("pdfviewer").DocumentLoad("documentLoad").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render()
47+
</div>
48+
49+
<script>
50+
function documentLoad() {
51+
var viewer = document.getElementById('pdfviewer').ej2_instances[0];
52+
if (ej2_base_1.Browser.isDevice && !viewer.enableDesktopMode) {
53+
viewer.maxZoom = 200;
54+
viewer.minZoom = 10;
55+
}
56+
else {
57+
viewer.zoomMode = 'Default';
58+
}
59+
}
60+
</script>
61+
62+
{% endhighlight %}
63+
{% highlight html tabtitle="Server-Backed" %}
64+
65+
<div style="width:100%;height:600px">
66+
@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentLoad("documentLoad").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").Render()
67+
</div>
68+
69+
<script>
70+
function documentLoad() {
71+
var viewer = document.getElementById('pdfviewer').ej2_instances[0];
72+
if (ej2_base_1.Browser.isDevice && !viewer.enableDesktopMode) {
73+
viewer.maxZoom = 200;
74+
viewer.minZoom = 10;
75+
}
76+
else {
77+
viewer.zoomMode = 'Default';
78+
}
79+
}
80+
</script>
81+
{% endhighlight %}
82+
{% endtabs %}
83+
84+
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.

ej2-asp-core-mvc/pdfviewer/EJ2_ASP.MVC/how-to/organize-pdf.md

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
layout: post
3+
title: Signature selection events in EJ2 ASP.NET MVC PDF Viewer | Syncfusion
4+
description: Learn here all about signatureSelect and signatureUnselect event in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more.
5+
platform: ej2-asp-core-mvc
6+
control: PDF Viewer
7+
publishingplatform: ##Platform_Name##
8+
documentation: ug
9+
---
10+
11+
# SignatureSelect and SignatureUnselect event
12+
13+
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.
14+
15+
**signatureSelect**
16+
17+
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.
18+
19+
**signatureUnselect**
20+
21+
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.
22+
23+
The code snippet demonstrates how to subscribe to the `signatureSelect` and `signatureUnselect` events in the Syncfusion PDF Viewer component.
24+
25+
{% tabs %}
26+
{% highlight html tabtitle="Standalone" %}
27+
28+
@{
29+
ViewBag.Title = "Home Page";
30+
}
31+
32+
<div style="width:100%;height:600px">
33+
@Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").SignatureUnselect("signatureUnselect").SignatureSelect("signatureSelect").Render()
34+
</div>
35+
36+
<script>
37+
38+
function signatureSelect(args) {
39+
console.log('Signature selected:', args);
40+
};
41+
42+
function signatureUnselect(args) {
43+
console.log('Signature selected:', args);
44+
};
45+
</script>
46+
47+
{% endhighlight %}
48+
{% highlight html tabtitle="Server-Backed" %}
49+
50+
@{
51+
ViewBag.Title = "Home Page";
52+
}
53+
54+
<div style="width:100%;height:600px">
55+
@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf").SignatureUnselect("signatureUnselect").SignatureSelect("signatureSelect").Render()
56+
</div>
57+
58+
<script>
59+
function signatureSelect(args) {
60+
console.log('Signature selected:', args);
61+
};
62+
63+
function signatureUnselect(args) {
64+
console.log('Signature selected:', args);
65+
};
66+
</script>
67+
68+
{% endhighlight %}
69+
{% endtabs %}
70+
71+
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.

0 commit comments

Comments
 (0)