You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -32,6 +32,7 @@ This KB answers the following questions:
32
32
* How to create an image from the Telerik QRCode for Blazor?
33
33
* How to convert a Barcode, Chart, or QRCode from SVG to an image?
34
34
* How to save a Barcode or QRCode as an image?
35
+
* How to export a Diagram to a PNG file?
35
36
36
37
## Solution
37
38
@@ -48,7 +49,11 @@ When using the `SVG` rendering mode:
48
49
49
50
> When using a Blazor app with **Server** render mode, make sure to [increase the SignalR max message size](slug:common-kb-increase-signalr-max-message-size), otherwise the Base64 data URI may not reach the .NET runtime.
50
51
51
-
>caption Export QRCode, BarCode, or Chart to Image
52
+
> The following examples demonstrates JavaScript APIs, which are not subject to Telerik technical support.
53
+
54
+
### Export BarCode, Chart and QRCode
55
+
56
+
>caption Export QRCode, BarCode, or Chart to PNG Image
52
57
53
58
````RAZOR
54
59
@inject IJSRuntime js
@@ -65,7 +70,7 @@ When using the `SVG` rendering mode:
@@ -254,10 +257,133 @@ When using the `SVG` rendering mode:
254
257
}
255
258
````
256
259
257
-
> The example in this KB article demonstrates JavaScript APIs, which are not subject to Telerik technical support.
260
+
### Export Diagram
261
+
262
+
The required approach with a Telerik Blazor Diagram is the same as described above, with one exception. The `getBlobImage` JavaScript function must receive the exact Diagram width and height, instead of `svgBox.width` and `svgBox.height`. This is because the Diagram supports panning and the `svgBox` is larger than the visible component dimensions. Using `svgBox.width` and `svgBox.height` may result in a clipped PNG image.
0 commit comments