Skip to content

Commit 2914b39

Browse files
committed
Update Readme
1 parent e0c8b12 commit 2914b39

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

README.md

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Introduction
22
[ComPDFKit PDF SDK](https://www.compdf.com) is a robust PDF library, which offers comprehensive functions for quickly viewing, annotating, editing, and signing PDFs. It is feature-rich and battle-tested, making PDF files process and manipulation easier and faster.
33

4-
[ComPDFKit PDF SDK for Windows](https://www.compdf.com/windows) offers powerful [.Net APIs](https://github.com/ComPDFKit/compdfkit-api-.net), allowing you to quickly add PDF functions to any Windows application and ensure seamless and efficient development.
5-
6-
[ComPDFKit API](https://api.compdf.com/api/pricing) allows you to get 1000 files processing monthly now! Just [sign up](https://api.compdf.com/signup) for a free trial and enjoy comprehensive PDF functions.
4+
[ComPDFKit for Windows](https://www.compdf.com/windows) allows you to quickly add PDF functions to any Windows application, elevating your Window programs to ensure efficient development. It is available at [nuget](https://www.nuget.org/packages/ComPDFKit.NetFramework) and [github.com](https://github.com/ComPDFKit/compdfkit-pdf-sdk-windows).
75

86
# Related
97

@@ -28,7 +26,7 @@ It is easy to embed ComPDFKit PDF SDK in your Windows application with a few lin
2826

2927
In this guide, we take ***"PDFViewer"*** as an example to show how to run it in Visual Studio 2022.
3028

31-
1. Copy your ***"license_key_windows.txt"*** to the ***"Examples"*** folder (The file is the license to make your project run).
29+
1. Copy your ***"license_key_windows.xml"*** to the ***"Examples"*** folder (The file is the license to make your project run).
3230

3331
2. Find ***"Examples.sln"*** in the ***"Examples"*** folder and open it in Visual Studio 2022.
3432

@@ -127,20 +125,59 @@ Rather than targeting a package held at Nuget, you may set up a configuration to
127125

128126
### Apply the License Key
129127

130-
You can [contact ComPDFKit team](https://www.compdf.com/contact-us) to get a trial license. Before using any ComPDFKit PDF SDK classes, a required operation is to set the license key. Add the following method - `LicenseVerify()` to ***"MainWindow.xaml.cs"***.
128+
You can [contact the ComPDFKit team](https://www.compdf.com/contact-us) to obtain a trial license. Before using any classes from the ComPDFKit PDF SDK, you need to choose the corresponding scheme from the following two options based on the license type and apply the license to your application.
129+
130+
**Online Authentication**
131+
132+
You can perform online authentication using the following approach:
131133

132134
```c#
133-
bool LicenseVerify()
135+
public static async Task<bool> LicenseVerify()
134136
{
135137
if (!CPDFSDKVerifier.LoadNativeLibrary())
138+
{
136139
return false;
140+
}
141+
LicenseErrorCode status = await CPDFSDKVerifier.OnlineLicenseVerify("Input your license here.");
142+
return status == LicenseErrorCode.E_LICENSE_SUCCESS;
143+
}
137144

138-
LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify("license_key_windows.txt", true);
139-
return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);
145+
```
146+
147+
Additionally, if you need to confirm the communication status with the server during online authentication, you can implement the `CPDFSDKVerifier.LicenseRefreshed` callback:
148+
149+
```C#
150+
CPDFSDKVerifier.LicenseRefreshed += CPDFSDKVerifier_LicenseRefreshed;
151+
152+
private void CPDFSDKVerifier_LicenseRefreshed(object sender, ResponseModel e)
153+
{
154+
if(e != null)
155+
{
156+
string message = string.Format("{0} {1}", e.Code, e.Message);
157+
Trace.WriteLine(message);
158+
}
159+
else
160+
{
161+
Trace.WriteLine("Network not connected.");
162+
}
140163
}
164+
141165
```
142166

167+
**Offline Authentication**
168+
169+
The following is the `LicenseVerify()` method for implementing offline authentication:
143170

171+
```c#
172+
bool LicenseVerify()
173+
{
174+
if (!CPDFSDKVerifier.LoadNativeLibrary())
175+
return false;
176+
177+
LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify("Input your license here.", false);
178+
return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);
179+
}
180+
```
144181

145182
### Display a PDF Document
146183

images-windows/image.png

300 Bytes
Loading

0 commit comments

Comments
 (0)