Skip to content

Commit 6f40fc0

Browse files
committed
1006681: Resolved the given feedback.
1 parent 592792e commit 6f40fc0

File tree

2 files changed

+7
-17
lines changed
  • Digital Signature/Group-signature-for-all-pages/.NET/Group-signature-for-all-pages

2 files changed

+7
-17
lines changed
Binary file not shown.

Digital Signature/Group-signature-for-all-pages/.NET/Group-signature-for-all-pages/Program.cs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
// Load the signature image once
1818
using FileStream imageStream = new FileStream(Path.GetFullPath(@"Data/Signature.png"), FileMode.Open, FileAccess.Read);
1919
PdfBitmap signatureImage = new PdfBitmap(imageStream);
20-
// use this flag. Set to 'false' to draw for each signature field
21-
bool appearanceApplied = false;
2220
// Iterate pages and add a signature field to each page
2321
for (int i = 0; i < document.Pages.Count; i++)
2422
{
@@ -27,22 +25,14 @@
2725
// Create a signature field on the page using the certificate
2826
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
2927
// Position & size of the signature field
30-
signature.Bounds = new RectangleF(new PointF(10, 10), new SizeF(100, 60));
31-
// Optional metadata shown in the signature properties
32-
signature.ContactInfo = "johndoe@owned.us";
33-
signature.LocationInfo = "Honolulu, Hawaii";
34-
signature.Reason = "I am author of this document.";
28+
signature.Bounds = new RectangleF(new PointF(350, 200), new SizeF(100, 60));
3529
// Draw the signature image into the signature appearance once
36-
if (!appearanceApplied)
37-
{
38-
signature.Appearance.Normal.Graphics.DrawImage(
39-
signatureImage,
40-
0, 0,
41-
signature.Bounds.Width,
42-
signature.Bounds.Height
43-
);
44-
appearanceApplied = true;
45-
}
30+
signature.Appearance.Normal.Graphics.DrawImage(
31+
signatureImage,
32+
0, 0,
33+
signature.Bounds.Width,
34+
signature.Bounds.Height
35+
);
4636
}
4737
// Save the PDF document
4838
document.Save(Path.GetFullPath(@"Output/Output.pdf"));

0 commit comments

Comments
 (0)