Hi,
I use the SyncFusion SfPdfViewer-Control in my Xamarin.Forms Projects (targeting Android, iOS and UWP platforms).
All I want to do is add and remove Images to a PDF-Document and display it with the PDFViewer-Control.
I use MVVM concept so I only placed the control in a Xamarin.Forms Page with a databinding to my ViewModel-Property PdfDocumentStream.
<syncfusion:SfPdfViewer Grid.Row="0"
x:Name="pdfViewerControl"
InputFileStream="{Binding PdfDocumentStream}"
PageNumber="{Binding Path=PageNumber}"
MinimumHeightRequest="200"
PageViewMode="PageByPage"
WidthRequest="100"
BookmarkNavigationEnabled="False"
BookmarkPaneVisible="False"
EnableFormFilling="False"
EnableDocumentLinkAnnotation="False"
EnableScrollHead="False"
IsTextSearchEnabled="False"
IsTextSelectionEnabled="False"
ShowPageNumber="False"
/>
So nothing magic.
In the ViewModel I have 2 methods to add and remove an image to the PdfDocumentStream using SyncFusions PdfLoadedDocument and PdfDocument classes.
These methods create a new MemoryStream and assign this one to the PdfDocumentStream property in my ViewModel.
My main problem is that if I there is only 1 page left in the document and I want to remove this page, this is not shown from the SfPdfViewer-Control.
I tried setting my PdfDocumentStream-property to null, but this did not work.
Can you provide a working MVVM sample for adding and removing pages from a PDF?
Kind Regards