Skip to content

Commit bc1ea0e

Browse files
authored
Merge branch 'development' into 998507-UpdateSkiasharpVersion
2 parents b227e48 + ac47603 commit bc1ea0e

File tree

3 files changed

+346
-0
lines changed

3 files changed

+346
-0
lines changed

Document-Processing-toc.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<li>
1818
<a href="/document-processing/ai-coding-assistant/mcp-server">MCP Server</a>
1919
</li>
20+
<li>
21+
<a href="/document-processing/ai-coding-assistant/prompt-library">Prompt Library</a>
22+
</li>
2023
</ul>
2124
</li>
2225
<li>Installation<ul>

Document-Processing/Excel/Spreadsheet/Blazor/open-and-save.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,117 @@ An Excel file encoded as a Base64 string can be loaded into the Spreadsheet comp
7272
{% endhighlight %}
7373
{% endtabs %}
7474

75+
### Open an Excel file from Google Drive
76+
To load an Excel file from `Google Drive` in the Blazor Spreadsheet, follow the steps below.
77+
78+
**Prerequisites:**
79+
- [Google Cloud project](https://developers.google.com/workspace/guides/create-project) in the Google Cloud Console.
80+
- [Service account](https://cloud.google.com/iam/docs/service-accounts-create) within the GCP project.
81+
- [Service account key](https://cloud.google.com/iam/docs/keys-create-delete) (JSON) available on disk.
82+
- [Google Drive API enabled](https://console.cloud.google.com/apis/library/drive.googleapis.com) for the project.
83+
- [Google Drive account](https://drive.google.com/) with access to the file to download.
84+
- [Google.Apis.Drive.v3](https://www.nuget.org/packages/Google.Apis.Drive.v3) NuGet package installed in your project to access Google Drive API.
85+
86+
**Step 1:** Install required NuGet packages
87+
88+
To use Google Drive with the Blazor Spreadsheet, install the following packages:
89+
90+
- [Google.Apis.Drive.v3](https://www.nuget.org/packages/Google.Apis.Drive.v3) — to access the Google Drive API
91+
- [Syncfusion.Blazor.Spreadsheet](https://www.nuget.org/packages/Syncfusion.Blazor.Spreadsheet) — to use the Syncfusion Blazor Spreadsheet component
92+
93+
**Step 2:** Include the following namespaces in the **Index.razor** file
94+
95+
Import the required namespaces at the top of the file:
96+
97+
```
98+
@using Google.Apis.Auth.OAuth2;
99+
@using Google.Apis.Drive.v3;
100+
@using Google.Apis.Services;
101+
@using Syncfusion.Blazor.Spreadsheet;
102+
@using System.IO;
103+
```
104+
105+
**Step 3:** Download the Excel file, convert to bytes, and prepare for binding
106+
107+
Add the below code example to download the `Google Drive` file using the Drive API, convert the stream to a byte array, and bind it to the [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_DataSource) property.
108+
109+
{% tabs %}
110+
{% highlight razor %}
111+
112+
@page "/"
113+
114+
@if (IsSpreadsheetDataLoaded)
115+
{
116+
<SfSpreadsheet DataSource="DataSourceBytes">
117+
<SpreadsheetRibbon></SpreadsheetRibbon>
118+
</SfSpreadsheet>
119+
}
120+
@code{
121+
122+
public byte[] DataSourceBytes { get; set; }
123+
124+
// Flag to indicate whether the spreadsheet data has been loaded and is ready for rendering
125+
public bool IsSpreadsheetDataLoaded { get; set; }
126+
127+
protected override async Task OnInitializedAsync()
128+
{
129+
//Download the document from Google Drive
130+
MemoryStream stream = await GetDocumentFromGoogleDrive();
131+
132+
//Set the position as '0'
133+
stream.Position = 0;
134+
135+
// Convert the MemoryStream to a byte array to be used as the DataSource
136+
DataSourceBytes = stream.ToArray();
137+
138+
// Set the flag to true to indicate that the spreadsheet data is ready
139+
IsSpreadsheetDataLoaded = true;
140+
}
141+
142+
// Download file from Google Drive
143+
public async Task<MemoryStream> GetDocumentFromGoogleDrive()
144+
{
145+
//Define the path to the service account key file
146+
string serviceAccountKeyPath = "Your_service_account_key_path";
147+
148+
//Specify the file ID of the file to download
149+
string fileID = "Your_file_id";
150+
151+
try
152+
{
153+
//Authenticate the Google Drive API access using the service account key
154+
GoogleCredential credential = GoogleCredential.FromFile(serviceAccountKeyPath).CreateScoped(DriveService.ScopeConstants.Drive);
155+
156+
//Create the Google Drive service
157+
DriveService service = new DriveService(new BaseClientService.Initializ()
158+
{
159+
HttpClientInitializer = credential
160+
});
161+
162+
//Create a request to get the file from Google Drive
163+
var request = service.Files.Get(fileID);
164+
165+
//Download the file into a MemoryStream
166+
MemoryStream stream = new MemoryStream();
167+
await request.DownloadAsync(stream);
168+
169+
return stream;
170+
}
171+
catch (Exception ex)
172+
{
173+
Console.WriteLine($"Error retrieving document from Google Drive: {ex.Message}");
174+
throw;
175+
}
176+
}
177+
}
178+
179+
{% endhighlight %}
180+
{% endtabs %}
181+
182+
N> Replace **Your_file_id** with the actual Google Drive file ID, and **Your_service_account_key_path** with the actual path to your service account key JSON file.
183+
184+
N> The **FileID** is the unique identifier for a Google Drive file. For example, if the file URL is: `https://drive.google.com/file/d/abc123xyz456/view?usp=sharing`, then the file ID is `abc123xyz456`.
185+
75186
### Supported file formats
76187
The Spreadsheet component supports opening the following file formats:
77188
* Microsoft Excel Workbook (.xlsx)
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
---
2+
layout: post
3+
title: Syncfusion AI Coding Assistant Prompt Library | Syncfusion
4+
description: Explore the AI Coding Assistant Prompt Library to enhance DocumentSDK productivity with code generation and configuration guidance.
5+
platform: document-processing
6+
control: Syncfusion AI Coding Assistant Prompt Library
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Prompt Library - AI Coding Assistant
12+
13+
Speed up your projects using these ready-made prompts for Syncfusion® Document Processing libraries. Each prompt is short, easy to understand, and focused on real tasks—like quick setups, tweaks, and fixes.
14+
15+
## How to Use
16+
17+
Before starting, make sure your MCP Server is set up and running.
18+
19+
* Choose a prompt that fits your need.
20+
* Copy the full prompt with the #SyncfusionDocumentSDKAssistant handle.
21+
* Customize the prompt for your specific use case.
22+
* Execute via the MCP Server.
23+
* Always check and test the code before adding it to your project.
24+
25+
## Component-Specific Prompts
26+
27+
### PDF
28+
29+
The Syncfusion PDF Library enables developers to create, read, and edit PDF documents programmatically across all .NET applications.
30+
31+
{% promptcards %}
32+
{% promptcard Create PDF %}
33+
#SyncfusionDocumentSDKAssistant Show me how to create text and images in a PDF document?
34+
{% endpromptcard %}
35+
{% promptcard Edit and Save %}
36+
#SyncfusionDocumentSDKAssistant How can I open an existing PDF, modify its content, and save the updated file in ASP.NET MVC?
37+
{% endpromptcard %}
38+
{% promptcard Form Fields %}
39+
#SyncfusionDocumentSDKAssistant How can I create form fields and add combo and radio box in PDF document?
40+
{% endpromptcard %}
41+
{% promptcard Bookmarks %}
42+
#SyncfusionDocumentSDKAssistant How do I add, edit, and remove bookmarks in a PDF?
43+
{% endpromptcard %}
44+
{% promptcard Watermarks %}
45+
#SyncfusionDocumentSDKAssistant Provide steps to add text watermarks and image watermarks to a PDF?
46+
{% endpromptcard %}
47+
{% promptcard Table and Shape %}
48+
#SyncfusionDocumentSDKAssistant Insert an image on a new PDF page, add a table, draw a shape, and place text inside the shape?
49+
{% endpromptcard %}
50+
{% promptcard ZUGFeRD Invoices %}
51+
#SyncfusionDocumentSDKAssistant Provide an example to generate a ZUGFeRD-compliant invoice PDF?
52+
{% endpromptcard %}
53+
{% promptcard Merge and Split %}
54+
#SyncfusionDocumentSDKAssistant How do I merge multiple PDFs and split a PDF into separate files or pages?
55+
{% endpromptcard %}
56+
{% promptcard Compress PDF %}
57+
#SyncfusionDocumentSDKAssistant How do I compress an existing PDF and optimize it for a smaller file size?
58+
{% endpromptcard %}
59+
{% promptcard Digital Signatures %}
60+
#SyncfusionDocumentSDKAssistant Provide steps to digitally sign a PDF and validate existing signatures?
61+
{% endpromptcard %}
62+
{% promptcard XPS to PDF Conversion %}
63+
#SyncfusionDocumentSDKAssistant How do I convert XPS documents to PDF?
64+
{% endpromptcard %}
65+
{% promptcard HTML to PDF Conversion %}
66+
#SyncfusionDocumentSDKAssistant How do I convert HTML documents to PDF?
67+
{% endpromptcard %}
68+
{% promptcard Security Operations %}
69+
#SyncfusionDocumentSDKAssistant Show me how to encrypt a PDF with password and later decrypt it?
70+
{% endpromptcard %}
71+
{% endpromptcards %}
72+
73+
### Word
74+
75+
The Syncfusion Word Library enables developers to create, read, edit, and convert Word documents programmatically across all .NET applications.
76+
77+
{% promptcards %}
78+
{% promptcard Create Word Document %}
79+
#SyncfusionDocumentSDKAssistant Show me how to create a Word document from scratch with paragraphs in new document?
80+
{% endpromptcard %}
81+
{% promptcard Edit and Save %}
82+
#SyncfusionDocumentSDKAssistant How can I open an existing DOCX, modify content and save the document?
83+
{% endpromptcard %}
84+
{% promptcard Mail Merge %}
85+
#SyncfusionDocumentSDKAssistant How to create a Word template document with merge fields?
86+
{% endpromptcard %}
87+
{% promptcard Bookmarks %}
88+
#SyncfusionDocumentSDKAssistant How to navigate to a bookmark and insert contents in DOCX?
89+
{% endpromptcard %}
90+
{% promptcard Split Documents %}
91+
#SyncfusionDocumentSDKAssistant How do I split a Word document into multiple files by section?
92+
{% endpromptcard %}
93+
{% promptcard Table and Shapes %}
94+
#SyncfusionDocumentSDKAssistant Insert a table in new page, draw a shape, and place text inside the shape in Word document?
95+
{% endpromptcard %}
96+
{% promptcard Table of Contents (TOC) %}
97+
#SyncfusionDocumentSDKAssistant How can I insert TOC in Word Document?
98+
{% endpromptcard %}
99+
{% promptcard Forms %}
100+
#SyncfusionDocumentSDKAssistant How do I create a checkbox and dropdown field in a Word document for ASP.NET Core?
101+
{% endpromptcard %}
102+
{% promptcard Fields %}
103+
#SyncfusionDocumentSDKAssistant How to update the fields present in Word document?
104+
{% endpromptcard %}
105+
{% promptcard Styles and Formatting %}
106+
#SyncfusionDocumentSDKAssistant How can I define and apply paragraph, styles, bullet lists in Word document?
107+
{% endpromptcard %}
108+
{% promptcard HTML to DOCX %}
109+
#SyncfusionDocumentSDKAssistant Provide code to convert HTML to DOCX Document?
110+
{% endpromptcard %}
111+
{% promptcard Find and Replace %}
112+
#SyncfusionDocumentSDKAssistant How to find text and replace with other text in Word document?
113+
{% endpromptcard %}
114+
{% promptcard Security %}
115+
#SyncfusionDocumentSDKAssistant Show me how to encrypt the Word document with password?
116+
{% endpromptcard %}
117+
{% promptcard Compare %}
118+
#SyncfusionDocumentSDKAssistant How to compare two Word documents?
119+
{% endpromptcard %}
120+
{% promptcard Math Equation %}
121+
#SyncfusionDocumentSDKAssistant How to create accent equation using LaTeX in Word document?
122+
{% endpromptcard %}
123+
{% promptcard Word to PDF %}
124+
#SyncfusionDocumentSDKAssistant How to convert a Word document into PDF document?
125+
{% endpromptcard %}
126+
{% promptcard Word to MD %}
127+
#SyncfusionDocumentSDKAssistant How to convert a Word document to a Markdown?
128+
{% endpromptcard %}
129+
{% endpromptcards %}
130+
131+
### Excel
132+
133+
The Syncfusion Excel Library enables developers to create, read, edit, and convert Excel documents programmatically across all .NET applications.
134+
135+
{% promptcards %}
136+
{% promptcard Create Excel Document %}
137+
#SyncfusionDocumentSDKAssistant How to create an Excel file from scratch?
138+
{% endpromptcard %}
139+
{% promptcard Edit and Save %}
140+
#SyncfusionDocumentSDKAssistant How can I open an existing Excel document, modify content and save the document?
141+
{% endpromptcard %}
142+
{% promptcard Import Data from Data Table to Excel %}
143+
#SyncfusionDocumentSDKAssistant How do I import a Data Table into a new Excel worksheet using Document SDK?
144+
{% endpromptcard %}
145+
{% promptcard Conditional Format %}
146+
#SyncfusionDocumentSDKAssistant How to create and apply various conditional formats for different ranges?
147+
{% endpromptcard %}
148+
{% promptcard Export Data from Excel to Data Table %}
149+
#SyncfusionDocumentSDKAssistant Show me how to export Excel data into collection objects using Export Data<>?
150+
{% endpromptcard %}
151+
{% promptcard Charts and PivotChart %}
152+
#SyncfusionDocumentSDKAssistant Create a column chart from a data range with title, axis labels, and legend in Excel?
153+
{% endpromptcard %}
154+
{% promptcard Formula %}
155+
#SyncfusionDocumentSDKAssistant How to create workbook-level named ranges and use them in formulas in Excel Components?
156+
{% endpromptcard %}
157+
{% promptcard Data Validation %}
158+
#SyncfusionDocumentSDKAssistant Add dropdown list validation for a column using a named range?
159+
{% endpromptcard %}
160+
{% promptcard Table %}
161+
#SyncfusionDocumentSDKAssistant Convert a range to an Excel Table with header row and banded style?
162+
{% endpromptcard %}
163+
{% promptcard Remove Encryption %}
164+
#SyncfusionDocumentSDKAssistant How to remove a protection for an encrypted document for Excel Data?
165+
{% endpromptcard %}
166+
{% promptcard Drawing Objects and Shapes %}
167+
#SyncfusionDocumentSDKAssistant Show the code for how to create a group shape in ASP.NET MVC for Excel Components?
168+
{% endpromptcard %}
169+
{% promptcard Excel to PDF %}
170+
#SyncfusionDocumentSDKAssistant How to convert an entire Excel workbook to PDF?
171+
{% endpromptcard %}
172+
{% promptcard Chart to Image Conversion %}
173+
#SyncfusionDocumentSDKAssistant How to convert an Excel chart to an image using the chart to image conversion class?
174+
{% endpromptcard %}
175+
{% endpromptcards %}
176+
177+
### PowerPoint
178+
179+
The Syncfusion PowerPoint Library enables developers to create, read, edit, and convert PowerPoint presentations programmatically across all .NET applications.
180+
181+
{% promptcards %}
182+
{% promptcard Create Presentation %}
183+
#SyncfusionDocumentSDKAssistant How to programmatically create a new PowerPoint with slides, layouts, themes, and styled text?
184+
{% endpromptcard %}
185+
{% promptcard Edit and Save %}
186+
#SyncfusionDocumentSDKAssistant How can I load an existing PPTX and save the updated presentation?
187+
{% endpromptcard %}
188+
{% promptcard Convert PowerPoint to PDF %}
189+
#SyncfusionDocumentSDKAssistant How to convert a PowerPoint document into PDF document in .NET Core?
190+
{% endpromptcard %}
191+
{% promptcard Convert Slides to Images %}
192+
#SyncfusionDocumentSDKAssistant Give an example that demonstrates the conversion of an entire Presentation to images?
193+
{% endpromptcard %}
194+
{% promptcard Create and Edit Charts %}
195+
#SyncfusionDocumentSDKAssistant Show me how to insert charts, update data, and customize legends, axes, and data labels in PPTX?
196+
{% endpromptcard %}
197+
{% promptcard Convert Chart to Image %}
198+
#SyncfusionDocumentSDKAssistant Is it possible to convert the charts in a Presentation slide to image?
199+
{% endpromptcard %}
200+
{% promptcard Create and Edit Animations %}
201+
#SyncfusionDocumentSDKAssistant How do I apply and control entrance and emphasis animations with triggers and sequence ordering in Presentation?
202+
{% endpromptcard %}
203+
{% promptcard Create and Edit Transition Effects %}
204+
#SyncfusionDocumentSDKAssistant Show how to set a transition effect to a PowerPoint slide?
205+
{% endpromptcard %}
206+
{% promptcard Create and Manage Comments %}
207+
#SyncfusionDocumentSDKAssistant How can I insert, edit, and delete reviewer comments and list all comments in a presentation?
208+
{% endpromptcard %}
209+
{% promptcard Encrypt and Decrypt Presentations %}
210+
#SyncfusionDocumentSDKAssistant Does PPTX support a password-protect with encryption and open a protected file?
211+
{% endpromptcard %}
212+
{% promptcard Create and Modify Sections %}
213+
#SyncfusionDocumentSDKAssistant How can I create sections in PowerPoint?
214+
{% endpromptcard %}
215+
{% promptcard Clone and Merge %}
216+
#SyncfusionDocumentSDKAssistant How to clone the slide collection of a section and add those slides to a destination presentation?
217+
{% endpromptcard %}
218+
{% promptcard Work with Tables %}
219+
#SyncfusionDocumentSDKAssistant Show the code to apply the custom table formatting in presentation?
220+
{% endpromptcard %}
221+
{% promptcard Insert Shapes %}
222+
#SyncfusionDocumentSDKAssistant Show how to insert shapes in presentation document?
223+
{% endpromptcard %}
224+
{% promptcard Insert PowerPoint Elements %}
225+
#SyncfusionDocumentSDKAssistant Insert an image on a new slide, add a table, draw a shape, and place text inside the shape in the presentation document?
226+
{% endpromptcard %}
227+
{% endpromptcards %}
228+
229+
## See also
230+
231+
* [AI Coding Assistant Overview](https://help.syncfusion.com/document-processing/ai-coding-assistant/overview)
232+
* [SyncfusionDocumentSDKAssistant MCP Server](https://help.syncfusion.com/document-processing/ai-coding-assistant/mcp-server)

0 commit comments

Comments
 (0)