I am trying to print a pdf with only some of the annotations showing.
When printing, I am iterating through the annotations on the page and setting the IsPrintable property to false on the annotations that I do not want to print. However, the annotations still show when I print them. The only way I can get the annotations to not show when printing, is to set the IsHidden property to true.
I looked at the AnnotationDemo which sets the IsPrintable property, but that also prints the annotations when the IsPrintable is set to false.
We are using the Vintasoft Winforms .Net Plug-in.
Is there a way to set specific annotations to not print with the IsPrintable property?
Below is a sample of how I am setting the annotations IsPrintable property when printing.
Code: Select all
_annotationDataController = AnnotationDataController(_documentViewer.Images); // _documentViewer is Vintasoft.Imaging.UI.ImageViewer
AnnotatedPdfPrintDocument printManager = new AnnotatedPdfPrintDocument();
PdfAnnotationList annotations = null;
for (int i = 0; i < _annotationDataController.Images.Count; i++)
{
PdfPage page = PdfDocumentController.GetPageAssociatedWithImage(_annotationDataController.Images[i]);
annotations = page?.Annotations;
foreach (PdfAnnotation annotation in annotations)
{
annotation.IsPrintable = false;
annotation.Flags &= PdfAnnotationFlags.Print ^ (PdfAnnotationFlags)int.MaxValue;
}
}
printManager.AnnotationDataController = _annotationDataController;
Thanks
Harlan
T