Skip to content

Commit 216d81d

Browse files
committed
Committing the changes for the Readme file
1 parent 4590f9c commit 216d81d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CreatePDFAndView/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ This folder contains a sample project that demonstrates how to create a PDF docu
1212

1313
# Steps
1414
## 1. Create PDF
15-
Create the PDF using the PDF library and save the PDF using a memory stream. Create the below method in the PdfViewerViewModel class.
15+
In this example, we will load the PDF document through MVVM binding. Create a new C# file named PdfViewerViewModel.cs. Create the PDF using the PDF library and save the PDF as a stream. Create the following method in the PdfViewerViewModel class.
16+
Create the PDF using the PDF library and save the PDF as stream. Create the below method in the PdfViewerViewModel class.
1617

1718
```csharp
1819
private MemoryStream CreatePDF()
@@ -41,14 +42,15 @@ Create the PDF using the PDF library and save the PDF using a memory stream. Cre
4142
}
4243
```
4344
## 2. To load PDF in the PDF Viewer
44-
Initialize the PDF Viewer control in the .NET MAUI application and load the PDF stream to the PDF Viewer.
45+
Initialize the PDF Viewer control in the .NET MAUI application and load the PDF stream into the PDF Viewer by binding the PDF Viewer's `DocumentSource` to the PdfDocumentStream property of the PdfViewerViewModel class.
4546

4647
```xaml
4748
<syncfusion:SfPdfViewer x:Name="pdfViewer" DocumentSource="{Binding PdfDocumentStream}">
4849
</syncfusion:SfPdfViewer>
4950
```
5051

51-
In your ViewModel class, bind the PDF document stream:
52+
In your PdfViewerViewModel class, set the created stream to the PdfDocumentStream property from the CreatePDF method.
53+
5254
```csharp
5355
public class PdfViewerViewModel
5456
{
@@ -62,4 +64,4 @@ public class PdfViewerViewModel
6264
```
6365
## 3.Run the sample to view the PDF in the PDF Viewer.
6466
1. Build and deploy your .NET MAUI application on your preferred platform (Android, iOS, Windows, and Mac Catalyst).
65-
2. The PDF Viewer should display the "Hello World!!!" PDF document directly from the memory stream.
67+
2. The PDF Viewer should display the "This PDF was created using the Syncfusion PDF Library." PDF document directly from the stream.

0 commit comments

Comments
 (0)