Skip to content

Commit a030321

Browse files
authored
Merge pull request #95 from syncfusion-content/2022Vol1_PdfViewer
XAMARIN-42829 : Add or update UG documentation for the 2022 Volume 1 features and enhancements
2 parents 0c68b7f + 9537c28 commit a030321

11 files changed

+501
-28
lines changed

xamarin-android-toc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@
457457
<li><a href="/xamarin-android/sfpdfviewer/FreeText-Annotation">Free text annotations</a></li>
458458
<li><a href="/xamarin-android/sfpdfviewer/Textmarkup">Text markup annotations</a></li>
459459
<li><a href="/xamarin-android/sfpdfviewer/Bookmark-Navigation">Bookmark Navigation</a></li>
460+
<li><a href="/xamarin-android/sfpdfviewer/Working-with-PDF-Coordinates">Working with PDF coordinates</a></li>
460461
<li><a href="/xamarin-android/sfpdfviewer/Working-with-PDF-AcroForms">Working with PDF forms</a></li>
461462
<li><a href="/xamarin-android/sfpdfviewer/Working-with-Scrollhead">Working with ScrollHead</a></li>
462463
<li><a href="/xamarin-android/sfpdfviewer/Localization">Localization</a></li>

xamarin-android/SfPdfViewer/FreeText-Annotation.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,56 @@ private void PdfViewer_FreeTextAnnotationRemoved(object sender, FreeTextAnnotati
371371
{% endhighlight %}
372372
{% endtabs %}
373373

374+
## How to lock or unlock the free text annotations?
375+
376+
To lock or unlock all the free text annotation, set the `IsLocked` API to `true` or `false` respectively, and the following sample explains the same. But other annotation types can be moved, resized, removed or their attributes can be changed.
377+
378+
{% tabs %}
379+
{% highlight c# %}
380+
381+
//Disable the free text annotation interaction such as move, resize, remove, and attributes changes.
382+
pdfViewerControl.AnnotationSettings.FreeText.IsLocked = true;
383+
384+
{% endhighlight %}
385+
{% endtabs %}
386+
387+
Interactions with free text annotation types such as move, resize, remove or attribute changes will be allowed only if the `SfPdfViewer.AnnotationSettings.IsLocked` API is set to `false`. The following code prevents the unlocking of the free text annotations, although the `IsLocked` property of the free text annotation is set to `false`.
388+
389+
{% tabs %}
390+
{% highlight c# %}
391+
392+
//Disable the free text annotation interaction, though its 'IsLocked' property is set to ‘false’ .
393+
pdfViewerControl.AnnotationSettings.IsLocked = true;
394+
pdfViewerControl.AnnotationSettings.FreeText.IsLocked = false;
395+
396+
{% endhighlight %}
397+
{% endtabs %}
398+
399+
## How to enable or disable the free text annotation selection?
400+
401+
To enable or disable the free text annotation selection, set the `Constraints` API to `AnnotationConstraints.Selectable` or `~AnnotationConstraints.Selectable` respectively, and the following sample explains the same. But other annotation types can be selected, moved, resized, removed or their attributes can be changed.
402+
403+
{% tabs %}
404+
{% highlight c# %}
405+
406+
//Disable the selection of free text annotations.
407+
pdfViewerControl.AnnotationSettings.FreeText.Constraints = ~AnnotationConstraints.Selectable;
408+
409+
{% endhighlight %}
410+
{% endtabs %}
411+
412+
Free text annotation selection will be allowed only if the `SfPdfViewer.AnnotationSettings.Constraints` API is set to `AnnotationConstraints.Selectable`. The following code prevents the free text annotations selection, even though the `Constraints` property of the free text annotation is set to `AnnotationConstraints.Selectable`.
413+
414+
{% tabs %}
415+
{% highlight c# %}
416+
417+
//Disable the free text annotation selection, though its 'Constraints' property is set to ‘AnnotationConstraints.Selectable’
418+
pdfViewerControl.AnnotationSettings.Constraints= ~AnnotationConstraints.Selectable;
419+
pdfViewerControl.AnnotationSettings.FreeText.Constraints = AnnotationConstraints.Selectable;
420+
421+
{% endhighlight %}
422+
{% endtabs %}
423+
374424
## How to get and set the name of the free text annotations?
375425

376426
The PDF Viewer allows the users to get and set the name of free text annotations through the [Name](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.SfPdfViewer.Android.IAnnotation.html#Syncfusion_SfPdfViewer_Android_IAnnotation_Name) API.

xamarin-android/SfPdfViewer/Getting-Started.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,36 @@ private void PageDownButton_Click(object sender, System.EventArgs e)
401401

402402
N>When the current page is the first page, GoToPreviousPage method will not have any effect. Similarly, when in last page, GoToNextPage method will not have any effect.
403403

404+
## How to lock or unlock all the annotations?
405+
406+
To lock or unlock all the annotations in a PDF, set the `SfPdfViewer.AnnotationSettings.IsLocked` API to `true` or `false` respectively. The default value of the API is false, and when it is set to true, annotations can be selected, but resizing, moving, editing, and removing actions will be disabled. Only the tapped and selected events from the annotations will be raised. The following code sample explains the same.
407+
408+
{% tabs %}
409+
{% highlight c# %}
410+
411+
//Lock all the annotations
412+
pdfViewerControl.AnnotationSettings.IsLocked = true;
413+
414+
{% endhighlight %}
415+
{% endtabs %}
416+
417+
N>The lock operation can also be enabled or disabled for a particular annotation type such as shape, free text, text markup, etc. Please find the code samples to enable or disable interaction for particular annotation from their respective sections.
418+
419+
## How to enable or disable the annotation selection?
420+
421+
To enable or disable the annotation selection, set the `SfPdfViewer.AnnotationSettings.Constraints` API to `AnnotationConstraints.Selectable` or `~AnnotationConstraints.Selectable` respectively. Annotations will be selected by default, and when this API is set to `~AnnotationConstraints.Selectable`, annotation selection, moving, resizing, removing and attribute changes will be disabled. Only the tapped events of the annotations will be raised. The following code sample explains the same.
422+
423+
{% tabs %}
424+
{% highlight c# %}
425+
426+
//Disable the selection of all annotation types.
427+
pdfViewerControl.AnnotationSettings.Constraints = ~AnnotationConstraints.Selectable;
428+
429+
{% endhighlight %}
430+
{% endtabs %}
431+
432+
N>The selection operation can also be enabled or disabled for a particular annotation type such as shape, free text, text markup, etc. Please find the code samples to enable or disable interaction for particular annotation from their respective sections.
433+
404434
## How to get the list of annotations present in the PDF?
405435

406436
By using `Annotations` property, You can get the list of annotations present in the PDF document.

xamarin-android/SfPdfViewer/Handwritten-Signature.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,56 @@ private void PdfViewer_InkSelected(object sender, Syncfusion.SfPdfViewer.Android
192192
{% endhighlight %}
193193
{% endtabs %}
194194

195+
## How to lock or unlock the handwritten signature?
196+
197+
To lock or unlock all the handwritten signature, set the `IsLocked` API to `true` or `false` respectively, and the following sample explains the same. But other annotation types can be moved, resized, removed or their attributes can be changed.
198+
199+
{% tabs %}
200+
{% highlight c# %}
201+
202+
//Disable the handwritten signature interaction such as move, resize, remove, and attributes changes.
203+
pdfViewerControl.AnnotationSettings.HandwrittenSignature.IsLocked = true;
204+
205+
{% endhighlight %}
206+
{% endtabs %}
207+
208+
Interactions with handwritten signature types such as move, resize, remove or attribute changes will be allowed only if the `SfPdfViewer.AnnotationSettings.IsLocked` API is set to `false`. The following code prevents the unlocking of the handwritten signatures, although the `IsLocked` property of the handwritten signature is set to `false`.
209+
210+
{% tabs %}
211+
{% highlight c# %}
212+
213+
//Disable the handwritten signature interaction, though its 'IsLocked' property is set to ‘false’ .
214+
pdfViewerControl.AnnotationSettings.IsLocked = true;
215+
pdfViewerControl.AnnotationSettings.HandwrittenSignature.IsLocked = false;
216+
217+
{% endhighlight %}
218+
{% endtabs %}
219+
220+
## How to enable or disable the handwritten signature selection?
221+
222+
To enable or disable the handwritten signature selection, set the `Constraints` API to `AnnotationConstraints.Selectable` or `~AnnotationConstraints.Selectable` respectively, and the following sample explains the same. But other annotation types can be selected, moved, resized, removed or their attributes can be changed.
223+
224+
{% tabs %}
225+
{% highlight c# %}
226+
227+
//Disable the selection of handwritten signatures.
228+
pdfViewerControl.AnnotationSettings.HandwrittenSignature.Constraints = ~AnnotationConstraints.Selectable;
229+
230+
{% endhighlight %}
231+
{% endtabs %}
232+
233+
Handwritten signature selection will be allowed only if the `SfPdfViewer.AnnotationSettings.Constraints` API is set to `AnnotationConstraints.Selectable`. The following code prevents the handwritten signatures selection, even though the `Constraints` property of the handwritten signature annotation is set to `AnnotationConstraints.Selectable`.
234+
235+
{% tabs %}
236+
{% highlight c# %}
237+
238+
//Disable the handwritten signature selection, though its 'Constraints' property is set to ‘AnnotationConstraints.Selectable’
239+
pdfViewerControl.AnnotationSettings.Constraints= ~AnnotationConstraints.Selectable;
240+
pdfViewerControl.AnnotationSettings.HandwrittenSignature.Constraints = AnnotationConstraints.Selectable;
241+
242+
{% endhighlight %}
243+
{% endtabs %}
244+
195245
## How to get and set the name of the handwritten signatures?
196246

197247
The PDF Viewer allows the users to get and set the name of handwritten signatures through the [Name](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.SfPdfViewer.Android.IAnnotation.html#Syncfusion_SfPdfViewer_Android_IAnnotation_Name) API.

xamarin-android/SfPdfViewer/Ink.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,56 @@ private void PdfViewer_AnnotationMovedOrResized(object sender, AnnotationMovedOr
524524
{% endhighlight %}
525525
{% endtabs %}
526526

527+
## How to lock or unlock the ink annotations?
528+
529+
To lock or unlock all the ink annotation, set the `IsLocked` API to `true` or `false` respectively, and the following sample explains the same. But other annotation types can be moved, resized, removed or their attributes can be changed.
530+
531+
{% tabs %}
532+
{% highlight c# %}
533+
534+
//Disable the ink annotation interaction such as move, resize, remove, and attributes changes.
535+
pdfViewerControl.AnnotationSettings.Ink.IsLocked = true;
536+
537+
{% endhighlight %}
538+
{% endtabs %}
539+
540+
Interactions with ink annotation types such as move, resize, remove or attribute changes will be allowed only if the `SfPdfViewer.AnnotationSettings.IsLocked` API is set to `false`. The following code prevents the unlocking of the ink annotations, although the `IsLocked` property of the ink annotation is set to `false`.
541+
542+
{% tabs %}
543+
{% highlight c# %}
544+
545+
//Disable the ink annotation interaction, though its 'IsLocked' property is set to ‘false’ .
546+
pdfViewerControl.AnnotationSettings.IsLocked = true;
547+
pdfViewerControl.AnnotationSettings.Ink.IsLocked = false;
548+
549+
{% endhighlight %}
550+
{% endtabs %}
551+
552+
## How to enable or disable the ink annotation selection?
553+
554+
To enable or disable the ink annotation selection, set the `Constraints` API to `AnnotationConstraints.Selectable` or `~AnnotationConstraints.Selectable` respectively, and the following sample explains the same. But other annotation types can be selected, moved, resized, removed or their attributes can be changed.
555+
556+
{% tabs %}
557+
{% highlight c# %}
558+
559+
//Disable the selection of ink annotations.
560+
pdfViewerControl.AnnotationSettings.Ink.Constraints = ~AnnotationConstraints.Selectable;
561+
562+
{% endhighlight %}
563+
{% endtabs %}
564+
565+
Ink annotation selection will be allowed only if the `SfPdfViewer.AnnotationSettings.Constraints` API is set to `AnnotationConstraints.Selectable`. The following code prevents the ink annotations selection, even though the `Constraints` property of the ink annotation is set to `AnnotationConstraints.Selectable`.
566+
567+
{% tabs %}
568+
{% highlight c# %}
569+
570+
//Disable the ink annotation selection, though its 'Constraints' property is set to ‘AnnotationConstraints.Selectable’
571+
pdfViewerControl.AnnotationSettings.Constraints= ~AnnotationConstraints.Selectable;
572+
pdfViewerControl.AnnotationSettings.Ink.Constraints = AnnotationConstraints.Selectable;
573+
574+
{% endhighlight %}
575+
{% endtabs %}
576+
527577
## How to render Ink strokes using custom ink points?
528578

529579
By default, ink strokes are drawn by recording the points on the screen traversed by the input device (stylus or finger). The quality of the strokes thus drawn may not be satisfactory as it considers only raw points. If needed, the points can be modified using any algorithms to smoothen the strokes.

xamarin-android/SfPdfViewer/Shape-Annotation.md

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -466,39 +466,37 @@ private void PdfViewer_ShapeAnnotationRemoved(object sender, ShapeAnnotationRemo
466466
{% endhighlight %}
467467
{% endtabs %}
468468

469-
## How to enable or disable shape annotation interaction?
470-
471-
The interaction operation can be enabled or disabled for shape annotation alone by setting the `IsLocked` API to `false` or `true` respectively.
472-
473-
For example, the following code disables the interaction operations for all shape annotations in the PDF. But other annotation types can be selected, moved, resized, or removed.
469+
## How to lock or unlock the shape annotations?
470+
471+
To lock or unlock all the shape annotation, set the `IsLocked` API to `true` or `false` respectively, and the following sample explains the same. But other annotation types can be moved, resized, removed or their attributes can be changed.
474472

475473
{% tabs %}
476474
{% highlight c# %}
477475

478-
//Disable the arrow annotation interaction
476+
//Disable the arrow annotation interaction such as move, resize, remove, and attributes changes.
479477
pdfViewerControl.AnnotationSettings.Arrow.Settings.IsLocked = true;
480-
481-
//Disable the line annotation interaction
478+
479+
//Disable the line annotation interaction such as move, resize, remove, and attributes changes.
482480
pdfViewerControl.AnnotationSettings.Line.Settings.IsLocked = true;
483-
484-
//Disable the rectangle annotation interaction
481+
482+
//Disable the rectangle annotation interaction such as move, resize, remove, and attributes changes.
485483
pdfViewerControl.AnnotationSettings.Rectangle.Settings.IsLocked = true;
486-
487-
//Disable the circle annotation interaction
484+
485+
//Disable the circle annotation interaction such as move, resize, remove, and attributes changes.
488486
pdfViewerControl.AnnotationSettings.Circle.Settings.IsLocked = true;
489-
490-
//Disable the polygon annotation interaction
487+
488+
//Disable the polygon annotation interaction such as move, resize, remove, and attributes changes.
491489
pdfViewerControl.AnnotationSettings.Polygon.Settings.IsLocked = true;
492490

493491
{% endhighlight %}
494492
{% endtabs %}
495-
496-
The interaction with shape annotation types will be allowed only if the [`SfPdfViewer.AnnotationSettings.IsLocked`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.SfPdfViewer.Android.AnnotationSettings.html#Syncfusion_SfPdfViewer_Android_AnnotationSettings_IsLocked) API is set to `false`. The following code does not allow the interactions with shape annotations, although the `IsLocked` property of the shape annotation is set to `false`.
497-
493+
494+
Interactions with shape annotation types such as move, resize, remove or attribute changes will be allowed only if the `SfPdfViewer.AnnotationSettings.IsLocked` API is set to `false`. The following code prevents the unlocking of the shape annotations, although the `IsLocked` property of the shape annotation is set to `false`.
495+
498496
{% tabs %}
499497
{% highlight c# %}
500498

501-
//Disables the shape annotation interaction, though its 'IsLocked' property is set to ‘false’
499+
//Disable the shape annotation interaction, though its 'IsLocked' property is set to ‘false’ .
502500
pdfViewerControl.AnnotationSettings.IsLocked = true;
503501
pdfViewerControl.AnnotationSettings.Arrow.Settings.IsLocked = false;
504502
pdfViewerControl.AnnotationSettings.Line.Settings.IsLocked = false;
@@ -509,7 +507,48 @@ pdfViewerControl.AnnotationSettings.Polygon.Settings.IsLocked = false;
509507
{% endhighlight %}
510508
{% endtabs %}
511509

512-
N> The `IsLocked` properties of the classes [`RectangleAnnotation`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.SfPdfViewer.Android.RectangleAnnotation.html), [`CircleAnnotation`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.SfPdfViewer.Android.CircleAnnotation.html), [`LineAnnotation`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.SfPdfViewer.Android.LineAnnotation.html) and [`ArrowAnnotation`](https://help.syncfusion.com/cr/xamarin-android/Syncfusion.SfPdfViewer.Android.ArrowAnnotation.html) have been marked as obsolete. Use the `RectangleAnnotation.Settings.IsLocked`, `CircleAnnotation.Settings.IsLocked`, `LineAnnotation.Settings.IsLocked` and `ArrowAnnotation.Settings.IsLocked` properties instead.
510+
N> The `IsLocked` properties of the classes [RectangleAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.RectangleAnnotation.html), [CircleAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.CircleAnnotation.html), [LineAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.LineAnnotation.html) and [ArrowAnnotation](https://help.syncfusion.com/cr/xamarin/Syncfusion.SfPdfViewer.XForms.ArrowAnnotation.html) have been marked as obsolete. Use the `RectangleAnnotation.Settings.IsLocked`, `CircleAnnotation.Settings.IsLocked`, `LineAnnotation.Settings.IsLocked` and `ArrowAnnotation.Settings.IsLocked` properties instead.
511+
512+
## How to enable or disable the shape annotation selection?
513+
514+
To enable or disable the shape annotation selection, set the `Constraints` API to `AnnotationConstraints.Selectable` or `~AnnotationConstraints.Selectable` respectively, and the following sample explains the same. But other annotation types can be selected, moved, resized, removed or their attributes can be changed.
515+
516+
{% tabs %}
517+
{% highlight c# %}
518+
519+
//Disable the selection of arrow annotations.
520+
pdfViewerControl.AnnotationSettings.Arrow.Settings.Constraints = ~AnnotationConstraints.Selectable;
521+
522+
//Disable the selection of line annotations.
523+
pdfViewerControl.AnnotationSettings.Line.Settings.Constraints = ~AnnotationConstraints.Selectable;
524+
525+
//Disable the selection of rectangle annotations.
526+
pdfViewerControl.AnnotationSettings.Rectangle.Settings.Constraints = ~AnnotationConstraints.Selectable;
527+
528+
//Disable the selection of circle annotations.
529+
pdfViewerControl.AnnotationSettings.Circle.Settings.Constraints = ~AnnotationConstraints.Selectable;
530+
531+
//Disable the selection of polygon annotations.
532+
pdfViewerControl.AnnotationSettings.Polygon.Settings.Constraints = ~AnnotationConstraints.Selectable;
533+
534+
{% endhighlight %}
535+
{% endtabs %}
536+
537+
Shape annotation selection will be allowed only if the `SfPdfViewer.AnnotationSettings.Constraints` API is set to `AnnotationConstraints.Selectable`. The following code prevents the shape annotations selection, even though the `Constraints` property of the shape annotation is set to `AnnotationConstraints.Selectable`.
538+
539+
{% tabs %}
540+
{% highlight c# %}
541+
542+
//Disable the shape annotation selection, though its 'Constraints' property is set to ‘AnnotationConstraints.Selectable’
543+
pdfViewerControl.AnnotationSettings.Constraints= ~AnnotationConstraints.Selectable;
544+
pdfViewerControl.AnnotationSettings.Arrow.Settings.Constraints = AnnotationConstraints.Selectable;
545+
pdfViewerControl.AnnotationSettings.Line.Settings.Constraints = AnnotationConstraints.Selectable;
546+
pdfViewerControl.AnnotationSettings.Rectangle.Settings.Constraints = AnnotationConstraints.Selectable;
547+
pdfViewerControl.AnnotationSettings.Circle.Settings.Constraints = AnnotationConstraints.Selectable;
548+
pdfViewerControl.AnnotationSettings.Polygon.Settings.Constraints = AnnotationConstraints.Selectable;
549+
550+
{% endhighlight %}
551+
{% endtabs %}
513552

514553
## How to get and set the name of the shape annotations?
515554

0 commit comments

Comments
 (0)