You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: File-Formats/PDF/Working-with-DigitalSignature.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4164,3 +4164,33 @@ loadedDocument.Close(true)
4164
4164
4165
4165
{% endtabs %}
4166
4166
4167
+
## Troubleshooting
4168
+
4169
+
<thstyle="font-size:14px"><b>Signature is not visible after signing the document.
4170
+
</b></th>
4171
+
4172
+
<table>
4173
+
<tr>
4174
+
<thstyle="font-size:14px">Reason
4175
+
</th>
4176
+
<tdstyle="font-size:14px">
4177
+
<b>The signature bounds is not properly set, due to this may appear invisible.</b>
4178
+
</td>
4179
+
</tr>
4180
+
<tr>
4181
+
<thstyle="font-size:14px"> Solution
4182
+
</th>
4183
+
<td>We recommend ensuring that the bounds value of the signature field is correctly set and drawing the image with the signature to ensure its visibility
4184
+
{% tabs %}
4185
+
4186
+
{% highlight c# tabtitle="C#" %}
4187
+
4188
+
//Set the signature bounds.
4189
+
signature.Bounds= new RectangleF(new PointF(0, 0), new SizeF(100, 100));
Copy file name to clipboardExpand all lines: File-Formats/PDF/Working-with-Tagged-PDF.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1193,7 +1193,7 @@ You can download a complete working sample from [GitHub](https://github.com/Sync
1193
1193
## Marking PDF content as an artifact
1194
1194
1195
1195
Artifacts in the PDF document can be graphic objects or other markings that are not a part of the authored content and will include such things as: headers, footers, page numbers, watermarks, cut marks, color bars, background images, lines separating content, or decorative images.
1196
-
You can add artifact tag to PDF element by using the [PdfArtifact](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.PdfArtifact.html) class. The artifact type can be speified by using the [ArtifactType](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.PdfArtifact.html#Syncfusion_Pdf_PdfArtifact_ArtifactType) property available in the ```PdfArtifact``` class.
1196
+
You can add artifact tag to PDF element by using the [PdfArtifact](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.PdfArtifact.html) class. The artifact type can be specified by using the [ArtifactType](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.PdfArtifact.html#Syncfusion_Pdf_PdfArtifact_ArtifactType) property available in the ```PdfArtifact``` class.
1197
1197
1198
1198
The following code explains how to add tag for header and footers in the PDF document.
Copy file name to clipboardExpand all lines: File-Formats/PDF/Working-with-Watermarks.md
+164Lines changed: 164 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -372,3 +372,167 @@ You can download a complete working sample from [GitHub](https://github.com/Sync
372
372
373
373
The following screenshot shows the output of adding image watermark to an existing PDF document.
374
374
<imgsrc="Watermark_images/Watermark_img4.jpg"alt="Image watermark in an existing PDF"width="100%"Height="Auto"/>
375
+
376
+
377
+
### Adding Watermark Annotation
378
+
379
+
A watermark annotation is used to represent graphics that are expected to be printed at a fixed size and position on a page, regardless of the dimensions of the printed page. [PdfWatermarkAnnotation](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.Interactive.PdfWatermarkAnnotation.html) can be used.
380
+
The following code example explains how to add a watermark annotation in the PDF document
381
+
382
+
{% tabs %}
383
+
{% highlight c# tabtitle="C# [Cross-platform]" %}
384
+
385
+
//Load the PDF document
386
+
FileStream docStream = new FileStream("input.pdf", FileMode.Open, FileAccess.Read);
387
+
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream);
388
+
//Get the page
389
+
PdfLoadedPage lpage = loadedDocument.Pages[0] as PdfLoadedPage;
390
+
391
+
//Creates PDF watermark annotation
392
+
PdfWatermarkAnnotation watermark = new PdfWatermarkAnnotation(new RectangleF(100, 100, 200, 50));
393
+
//Sets properties to the annotation
394
+
watermark.Opacity = 0.5f;
395
+
//Create the appearance of watermark
396
+
watermark.Appearance.Normal.Graphics.DrawString("Watermark Text", new PdfStandardFont(PdfFontFamily.Helvetica, 20), PdfBrushes.Red, new RectangleF(0, 0, 200, 50), new PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle));
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
412
+
//Get the page
413
+
PdfLoadedPage lpage = loadedDocument.Pages[0] as PdfLoadedPage;
414
+
415
+
//Creates PDF watermark annotation
416
+
PdfWatermarkAnnotation watermark = new PdfWatermarkAnnotation(new RectangleF(100, 100, 200, 50));
417
+
//Sets properties to the annotation
418
+
watermark.Opacity = 0.5f;
419
+
//Create the appearance of watermark
420
+
watermark.Appearance.Normal.Graphics.DrawString("Watermark Text", new PdfStandardFont(PdfFontFamily.Helvetica, 20), PdfBrushes.Red, new RectangleF(0, 0, 200, 50), new PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle));
Dim loadedDocument As New PdfLoadedDocument("input.pdf")
434
+
'Get the page
435
+
Dim lpage As PdfLoadedPage = TryCast(loadedDocument.Pages(0),PdfLoadedPage)
436
+
437
+
'Creates PDF watermark annotation
438
+
Dim watermark As New PdfWatermarkAnnotation(New RectangleF(100, 100, 200, 50))
439
+
watermark.Opacity = 0.5f;
440
+
'Creates the appearance of watermark
441
+
watermark.Appearance.Normal.Graphics.DrawString("Watermark Text", New PdfStandardFont(PdfFontFamily.Helvetica, 20), PdfBrushes.Red, New RectangleF(0, 0, 200, 50), New PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle))
442
+
'Adds annotation to the page
443
+
lpage.Annotations.Add(watermark)
444
+
445
+
'Saves the document to disk.
446
+
loadedDocument.Save("WatermarkAnnotation.pdf")
447
+
loadedDocument.Close(True)
448
+
449
+
{% endhighlight %}
450
+
451
+
{% endtabs %}
452
+
453
+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Annotation/Add-watermark-annotation-in-the-PDF-document).
454
+
455
+
456
+
### Removing Watermark Annotation
457
+
458
+
You can remove the Watermark annotation from the annotation collection, represented by the [PdfLoadedAnnotationCollection](https://help.syncfusion.com/cr/file-formats/Syncfusion.Pdf.Parsing.PdfLoadedAnnotationCollection.html) of the loaded page. The following code illustrates this.
459
+
460
+
{% tabs %}
461
+
{% highlight c# tabtitle="C# [Cross-platform]" %}
462
+
463
+
//Load the PDF document
464
+
FileStream docStream = new FileStream("input.pdf", FileMode.Open, FileAccess.Read);
465
+
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream);
466
+
// Iterate through the annotations collection and remove PdfLoadedWatermark annotations
467
+
foreach (PdfPageBase page in loadedDocument.Pages)
468
+
{
469
+
for (int i = page.Annotations.Count - 1; i >= 0; i--)
470
+
{
471
+
// Check if the annotation is a PdfLoadedWatermarkAnnotation
472
+
if (page.Annotations[i] is PdfLoadedWatermarkAnnotation)
Dim loadedDocument As New PdfLoadedDocument("input.pdf")
516
+
' Iterate through the annotations collection and remove PdfLoadedWatermark annotations
517
+
For Each page As PdfPageBase In loadedDocument.Pages
518
+
Dim i As Integer = page.Annotations.Count - 1
519
+
While i >= 0
520
+
' Check if the annotation is a PdfLoadedWatermarkAnnotation
521
+
If TypeOf page.Annotations(i) Is PdfLoadedWatermarkAnnotation Then
522
+
' Remove the PdfLoadedWatermarkAnnotation
523
+
page.Annotations.RemoveAt(i)
524
+
End If
525
+
i -= 1
526
+
End While
527
+
Next
528
+
529
+
'Saves the document to disk.
530
+
loadedDocument.Save("WatermarkAnnotation.pdf")
531
+
loadedDocument.Close(True)
532
+
533
+
{% endhighlight %}
534
+
535
+
{% endtabs %}
536
+
537
+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Watermark/Removing-watermark-annotation-in-PDF-document).
0 commit comments