Skip to content

Commit 778c855

Browse files
committed
989216: Resolved the given feedback
1 parent 31da92d commit 778c855

File tree

2 files changed

+12
-16
lines changed
  • Digital Signature/Add-a-digital-signature-to-an-existing-document/.NET/Add-a-digital-signature-to-an-existing-document

2 files changed

+12
-16
lines changed

Digital Signature/Add-a-digital-signature-to-an-existing-document/.NET/Add-a-digital-signature-to-an-existing-document/Program.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@
2020
signature.LocationInfo = "Honolulu, Hawaii";
2121
signature.Reason = "I am the author of this document.";
2222
// Load the image for the signature field
23-
using (FileStream imageStream = new FileStream(Path.GetFullPath(@"Data/signature.png"), FileMode.Open, FileAccess.Read))
24-
{
25-
PdfBitmap signatureImage = new PdfBitmap(imageStream);
26-
// Draw the image on the signature field
27-
signature.Appearance.Normal.Graphics.DrawImage(signatureImage, new RectangleF(0, 0, signature.Bounds.Width, signature.Bounds.Height));
28-
// Save the PDF document
29-
loadedDocument.Save(Path.GetFullPath(@"Output/Output.pdf"));
30-
}
23+
using FileStream imageStream = new FileStream(Path.GetFullPath(@"Data/signature.png"), FileMode.Open, FileAccess.Read);
24+
PdfBitmap signatureImage = new PdfBitmap(imageStream);
25+
// Draw the image on the signature field
26+
signature.Appearance.Normal.Graphics.DrawImage(signatureImage, new RectangleF(0, 0, signature.Bounds.Width, signature.Bounds.Height));
27+
// Save the PDF document
28+
loadedDocument.Save(Path.GetFullPath(@"Output/Output.pdf"));
3129
}

Digital Signature/Add-a-digital-signature-to-an-existing-document/.NET/Add-a-digital-signature-to-an-existing-document/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(@"Data/Input.pdf
3939
signature.LocationInfo = "Honolulu, Hawaii";
4040
signature.Reason = "I am the author of this document.";
4141
// Load the image for the signature field
42-
using (FileStream imageStream = new FileStream(Path.GetFullPath(@"Data/signature.png"), FileMode.Open, FileAccess.Read))
43-
{
44-
PdfBitmap signatureImage = new PdfBitmap(imageStream);
45-
// Draw the image on the signature field
46-
signature.Appearance.Normal.Graphics.DrawImage(signatureImage, new RectangleF(0, 0, signature.Bounds.Width, signature.Bounds.Height));
47-
// Save the PDF document
48-
loadedDocument.Save(Path.GetFullPath(@"Output/Output.pdf"));
49-
}
42+
using FileStream imageStream = new FileStream(Path.GetFullPath(@"Data/signature.png"), FileMode.Open, FileAccess.Read);
43+
PdfBitmap signatureImage = new PdfBitmap(imageStream);
44+
// Draw the image on the signature field
45+
signature.Appearance.Normal.Graphics.DrawImage(signatureImage, new RectangleF(0, 0, signature.Bounds.Width, signature.Bounds.Height));
46+
// Save the PDF document
47+
loadedDocument.Save(Path.GetFullPath(@"Output/Output.pdf"));
5048
}
5149
```
5250

0 commit comments

Comments
 (0)