Skip to content

Commit f06be61

Browse files
Merge pull request #4638 from Syncfusion-Content/hotfix/hotfix-v26.1.35
DOCINFRA-2341_merged_using_automation
2 parents 6ae46b3 + c8e121c commit f06be61

25 files changed

+277
-63
lines changed

blazor-toc.html

Lines changed: 8 additions & 1 deletion
Large diffs are not rendered by default.

blazor/Release-Notes/26.1.42.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Essential Studio for Blazor Weekly Nuget Release Release Notes
3+
description: Essential Studio for Blazor Weekly Nuget Release Release Notes
4+
platform: Blazor
5+
documentation: ug
6+
---
7+
8+
# Essential Studio for Blazor Release Notes
9+
10+
{% include release-info.html date="July 16, 2024" version="v26.1.42" %}
11+
12+
{% directory path: _includes/release-notes/v26.1.42 %}
13+
14+
{% include {{file.url}} %}
15+
16+
{% enddirectory %}
3.56 KB
Loading

blazor/barcode/qrcodegenerator.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,48 @@ Error Correction Level Table
8585
```
8686
{% previewsample "https://blazorplayground.syncfusion.com/embed/LNBKCVCzzDcveinV?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
8787

88+
## QR code with logo
89+
90+
The QR Code component supports embedding a logo image using the [ImageSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.BarcodeGenerator.QRCodeLogo.html#Syncfusion_Blazor_BarcodeGenerator_QRCodeLogo_ImageSource) property within the [QRCodeLogo](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.BarcodeGenerator.QRCodeLogo.html) element. This property sets the logo image in the center of the QR code. By default, the logo image is positioned at one-third of the QR code's size. Therefore, adjusting the size of the QR code will proportionally scale the logo image.
91+
92+
Advantages of Image QR Codes
93+
94+
* Enhanced Brand Identity: A QR code with an image allows businesses to integrate their logos or brand elements directly into the QR code. This enhances brand consistency and recognition, making it more memorable for users when they interact with the QR code.
95+
96+
* Increased User Interaction: An image QR code can convey messages, showcase products, or provide information more effectively than plain text or URLs. This visual approach can significantly boost user engagement and make the content more compelling and memorable.
97+
98+
* Comprehensive Visual Content: An image QR code generator enables the sharing of high-resolution images, infographics, diagrams, or product photos. This is particularly beneficial in art-related contexts where visual content is crucial for effective communication.
99+
100+
These benefits illustrate how an image QR code converter can enhance the effectiveness and impact of QR codes in various domains, from marketing to education and beyond.
101+
102+
The following code example demonstrates how to generate a QR barcode with a logo positioned at the center of it.
103+
104+
```cshtml
105+
@using Syncfusion.Blazor.BarcodeGenerator
106+
107+
<SfQRCodeGenerator Width="200px" Height="150px" Value="https://www.syncfusion.com/blazor-components/blazor-barcode">
108+
<QRCodeGeneratorDisplayText Visibility="false"></QRCodeGeneratorDisplayText>
109+
<QRCodeLogo ImageSource="images/barcode/syncfusion.png"></QRCodeLogo>
110+
</SfQRCodeGenerator>
111+
```
112+
113+
![QR barcode with logo in Blazor Barcode](images/blazor-barcode-qrcode-with-logo.png)
114+
115+
>**Note:** The [Error correction level](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.BarcodeGenerator.ErrorCorrectionLevel.html) is not taken into account when rendering the logo image inside the QR code.
116+
117+
### Customizing the logo size
118+
119+
The size of the logo can be changed using the [Height](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.BarcodeGenerator.QRCodeLogo.html#Syncfusion_Blazor_BarcodeGenerator_QRCodeLogo_Height) and [Width](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.BarcodeGenerator.QRCodeLogo.html#Syncfusion_Blazor_BarcodeGenerator_QRCodeLogo_Width) properties of the QR code generator. The image size should be equal to or less than 30% of the QR code's size. If the specified size exceeds 30% of the QR code's size, the QR code may not be scanned properly. Therefore, the lesser value between 30% of the QR code's size and the specified size will be used for rendering.
120+
121+
```cshtml
122+
@using Syncfusion.Blazor.BarcodeGenerator
123+
124+
<SfQRCodeGenerator Width="200px" Height="200px" Value="https://www.syncfusion.com/blazor-components/blazor-barcode">
125+
<QRCodeLogo Width="30" Height="30" ImageSource="images/barcode/syncfusion.png"></QRCodeLogo>
126+
</SfQRCodeGenerator>
127+
```
128+
>**Note:** The default value is one-third of the QR code size.
129+
88130
## Event
89131

90132
[OnValidationFailed](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.BarcodeGenerator.SfQRCodeGenerator.html#Syncfusion_Blazor_BarcodeGenerator_SfQRCodeGenerator_OnValidationFailed) event in the [SfQRCodeGenerator](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.BarcodeGenerator.SfQRCodeGenerator.html) is used to trigger when the input is an invalid string.
@@ -101,4 +143,4 @@ Error Correction Level Table
101143
}
102144
}
103145
104-
```
146+
```

blazor/document-editor/comments.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ The following example code illustrates how to enforce and stop protection in Doc
6363

6464
@code {
6565
SfDocumentEditorContainer container;
66-
protected void protectDocument(object args)
66+
protected async void protectDocument(object args)
6767
{
6868
//enforce protection
69-
container.DocumentEditor.Editor.EnforceProtectionAsync("123", ProtectionType.CommentsOnly);
69+
await container.DocumentEditor.Editor.EnforceProtectionAsync("123", ProtectionType.CommentsOnly);
7070
//stop the document protection
71-
container.DocumentEditor.Editor.StopProtectionAsync("123");
71+
await container.DocumentEditor.Editor.StopProtectionAsync("123");
7272
}
7373
}
7474
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
layout: post
3+
title: Unsupported file in Blazor DocumentEditor Component | Syncfusion
4+
description: Checkout and learn here all about Unsupported file in Syncfusion Blazor DocumentEditor component and more.
5+
platform: Blazor
6+
control: DocumentEditor
7+
documentation: ug
8+
---
9+
10+
# Why Do I Get the Unsupported Warning Message When Opening a Document?
11+
12+
If you receive an "The file format you have selected isn't supported. Please choose valid format." message when opening a document in the Document Editor, it typically indicates that the document format is not supported by the current version of the Document Editor. Here are some common reasons for this warning:
13+
1. Unsupported File Format: The document you are trying to open might be in a format that the Document Editor does not support. Ensure you are using a supported format, such as SFDT.
14+
2. Corrupted Document: The document file might be corrupted or improperly formatted. Try opening a different document to see if the issue persists.
15+
To avoid this warning, always use the recommended document formats and features supported by the Document Editor.
16+
17+
Document Editor supports the following file formats:
18+
• Word Document (*.docx)
19+
• Syncfusion Document Text (*.sfdt)
20+
• Plain Text (*.txt)
21+
• Word Template (*.dotx)
22+
• HyperText Markup Language (*.html)
23+
• Rich Text Format (*.rtf)
24+
• Word XML Document(*.xml)
25+
• Word 97-2003 Template (*.dot)
26+
• Word 97-2003 Document (*.doc)
27+
28+
By using these supported formats, you can ensure compatibility and avoid unsupported warning messages when opening documents in the Document Editor.

blazor/document-editor/fields.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ You can add a field to the document by using [`InsertFieldAsync`](https://help.s
1818
The following example code illustrates how to insert merge field programmatically by providing the field code and field result.
1919

2020
```csharp
21-
string fieldCode = 'MERGEFIELD First Name \\* MERGEFORMAT ';
22-
string fieldResult = '«First Name»';
21+
string fieldCode = "MERGEFIELD First Name \\* MERGEFORMAT ";
22+
string fieldResult = "«First Name»";
2323
await container.DocumentEditor.Editor.InsertFieldAsync(fieldCode, fieldResult);
2424
```
2525

@@ -64,10 +64,10 @@ You can modify the field code and field result of the current selected field by
6464
FieldInfo fieldInfo = await container.DocumentEditor.Selection.GetFieldInfoAsync();
6565

6666
//Modify field code
67-
fieldInfo.Code = 'MERGEFIELD First Name \\* MERGEFORMAT ';
67+
fieldInfo.Code = "MERGEFIELD First Name \\* MERGEFORMAT ";
6868

6969
//Modify field result
70-
fieldInfo.Result = '«First Name»';
70+
fieldInfo.Result = "«First Name»";
7171

7272
//Modify field code and result of the current selected field.
7373
await container.DocumentEditor.Editor.SetFieldInfoAsync(fieldInfo);

blazor/document-editor/history.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Inject the [`EditorHistory`](https://help.syncfusion.com/cr/blazor/Syncfusion.Bl
1818
```cshtml
1919
@using Syncfusion.Blazor.DocumentEditor
2020
21-
<SfDocumentEditor @ref="documentEditor" IsReadOnly=false EnableEditor=true EnableSelection=true>
21+
<SfDocumentEditorContainer @ref="container" EnableToolbar=true >
2222
<DocumentEditorContainerEvents Created="OnLoad"></DocumentEditorContainerEvents>
23-
</SfDocumentEditor>
23+
</SfDocumentEditorContainer>
2424
2525
@code {
26-
SfDocumentEditor documentEditor;
26+
SfDocumentEditorContainer container;
2727
protected void OnLoad(object args)
2828
{
29-
documentEditor.EnableEditorHistory = true;
29+
container.DocumentEditor.EnableEditorHistory = true;
3030
}
3131
}
3232
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
layout: post
3+
title: Add save button in Blazor DocumentEditor Component | Syncfusion
4+
description: Learn how to add a save button to the toolbar in the Syncfusion Blazor DocumentEditor component and much more.
5+
platform: Blazor
6+
control: DocumentEditor
7+
documentation: ug
8+
---
9+
# Add save button in Blazor Document editor toolbar
10+
11+
## To add a save button to the existing toolbar in DocumentEditorContainer
12+
13+
[`Blazor Word Processor`](https://www.syncfusion.com/blazor-components/blazor-word-processor) component (a.k.a Document Editor) component allows you to add a new button to the existing items in a toolbar using [`CustomToolbarItemModel`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.CustomToolbarItemModel.html) and with existing items in [`toolbarItems`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SfDocumentEditorContainer.html#Syncfusion_Blazor_DocumentEditor_SfDocumentEditorContainer_ToolbarItems) property. Newly added item click action can be defined in [`toolbarclick`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.DocumentEditorContainerEvents.html#Syncfusion_Blazor_DocumentEditor_DocumentEditorContainerEvents_OnToolbarClick).
14+
15+
```csharp
16+
<SfDocumentEditorContainer @ref="container" EnableToolbar=true ToolbarItems="@Items" ToolbarClick="OnToolbarClick">
17+
</SfDocumentEditorContainer>
18+
19+
@code {
20+
SfDocumentEditorContainer container;
21+
List<Object> Items = new List<Object> { new CustomToolbarItemModel() {"New","Open", Id = "save", Text = "Save" }, "Separator", "Undo", "Redo", "Separator", "Image", "Table", "Hyperlink", "Bookmark", "TableOfContents", "Separator", "Header", "Footer", "PageSetup", "PageNumber", "Break", "InsertFootnote", "InsertEndnote", "Separator", "Find", "Separator", "Comments", "TrackChanges", "Separator", "LocalClipboard", "RestrictEditing", "Separator", "FormFields", "UpdateFields" };
22+
23+
private void OnToolbarClick(ClickEventArgs args)
24+
{
25+
if (args.Item.Id == "save")
26+
{
27+
container.DocumentEditor.SaveAsync("sample", SaveFormat.Docx);
28+
}
29+
}
30+
};
31+
```
32+
33+
N> Default value of `ToolbarItems` are `['New', 'Open', 'Separator', 'Undo', 'Redo', 'Separator', 'Image', 'Table', 'Hyperlink', 'Bookmark', 'TableOfContents', 'Separator', 'Header', 'Footer', 'PageSetup', 'PageNumber', 'Break', 'InsertFootnote', 'InsertEndnote', 'Separator', 'Find', 'Separator', 'Comments', 'TrackChanges', 'Separator', 'LocalClipboard', 'RestrictEditing', 'Separator', 'FormFields', 'UpdateFields' ]`.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
layout: post
3+
title: Auto save document in Blazor DocumentEditor Component | Syncfusion
4+
description: Learn here all about Auto save document in document editor in Syncfusion Blazor DocumentEditor component and much more.
5+
platform: Blazor
6+
control: DocumentEditor
7+
documentation: ug
8+
---
9+
# Auto save document in Blazor Document editor component
10+
11+
In this article, we are going to see how to autosave the document to server. You can automatically save the edited content in regular intervals of time. It helps reduce the risk of data loss by saving an open document automatically at customized intervals.
12+
13+
The following example illustrates how to auto save the document in server.
14+
15+
* In the client-side, using content change event, we can automatically save the edited content in regular intervals of time. Based on `contentChanged` boolean, the document send as Docx format to server-side using [`SaveAsBlobAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DocumentEditor.SfDocumentEditor.html#Syncfusion_Blazor_DocumentEditor_SfDocumentEditor_SaveAsBlobAsync_System_Nullable_Syncfusion_Blazor_DocumentEditor_FormatType__) method.
16+
17+
```cshtml
18+
@using Syncfusion.Blazor.DocumentEditor
19+
@using System.IO
20+
@using System.Timers
21+
22+
<SfDocumentEditorContainer @ref="container" EnableToolbar="true">
23+
<DocumentEditorContainerEvents ContentChanged="OnContentChange"></DocumentEditorContainerEvents>
24+
</SfDocumentEditorContainer>
25+
26+
@code {
27+
SfDocumentEditorContainer container;
28+
private Timer autoSaveTimer;
29+
private bool isDocumentChanged = false;
30+
31+
protected override void OnInitialized()
32+
{
33+
// Set up the timer to trigger the callback every 1 second (1000 milliseconds)
34+
autoSaveTimer = new Timer(AutoSaveDocument, null, 1000, 1000);
35+
}
36+
37+
private void OnContentChange()
38+
{
39+
isDocumentChanged = true; // Mark the document as changed
40+
}
41+
42+
private async void AutoSaveDocument(object state)
43+
{
44+
if (isDocumentChanged)
45+
{
46+
await OnSave();
47+
isDocumentChanged = false; // Reset the flag after saving
48+
}
49+
}
50+
51+
public async Task OnSave()
52+
{
53+
SfDocumentEditor editor = container.DocumentEditor;
54+
string base64Data = await editor.SaveAsBlobAsync(FormatType.Docx);
55+
byte[] data = Convert.FromBase64String(base64Data);
56+
// To observe the memory go down, null out the reference of base64Data variable.
57+
base64Data = null;
58+
// Word document file stream
59+
Stream stream = new MemoryStream(data);
60+
// To observe the memory go down, null out the reference of data variable.
61+
data = null;
62+
using (var fileStream = new FileStream(@"wwwroot/data/GettingStarted.docx", FileMode.Create, FileAccess.Write))
63+
{
64+
// Saving the new file in root path of application
65+
await stream.CopyToAsync(fileStream);
66+
}
67+
stream.Close();
68+
// To observe the memory go down, null out the reference of stream variable.
69+
stream = null;
70+
}
71+
72+
public void Dispose()
73+
{
74+
autoSaveTimer?.Dispose(); // Dispose of the timer when the component is disposed
75+
}
76+
}
77+
```

0 commit comments

Comments
 (0)