|
private void Button_Click(object sender, RoutedEventArgs e)
{
PdfLoadedDocument copiedDoc = pdfViewer.LoadedDocument;
for (int pageIndex = 0;pageIndex < copiedDoc.Pages.Count;pageIndex++)
{
for(int i=0;i< copiedDoc.Pages[pageIndex].Annotations.Count;i++)
{
// Get the rectangle or square annotation from the PdfViewer.
Syncfusion.Pdf.Interactive.PdfSquareAnnotation annotation = copiedDoc.Pages[pageIndex].Annotations[i] as Syncfusion.Pdf.Interactive.PdfSquareAnnotation;
if (annotation != null)
annotation.Opacity = 0F;
}
}
MemoryStream stream = new MemoryStream();
// Save the changes in a stream.
copiedDoc.Save(stream);
stream.Position = 0;
// Reload the PDF document.
pdfViewer.Load(stream);
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
PdfLoadedDocument copiedDoc = pdfViewer.LoadedDocument;
for (int pageIndex = 0; pageIndex < copiedDoc.Pages.Count; pageIndex++)
{
for (int i = 0; i < copiedDoc.Pages[pageIndex].Annotations.Count; i++)
{
// Get the rectangle or square annotation from the PdfViewer.
Syncfusion.Pdf.Interactive.PdfSquareAnnotation annotation = copiedDoc.Pages[pageIndex].Annotations[i] as Syncfusion.Pdf.Interactive.PdfSquareAnnotation;
if (annotation != null)
annotation.Opacity = 1F;
}
}
MemoryStream stream = new MemoryStream();
// Save the changes in a stream.
copiedDoc.Save(stream);
stream.Position = 0;
// Reload the PDF document.
pdfViewer.Load(stream);
}
|