Skip to content

Commit

Permalink
Add Signature Field
Browse files Browse the repository at this point in the history
  • Loading branch information
burka committed Feb 15, 2023
1 parent 780ba56 commit 8ba8bf9
Show file tree
Hide file tree
Showing 7 changed files with 277 additions and 182 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
input { color: orange; font-family: monospace; }
textarea { color: red; font-family: monospace; }
button { color: blue; font-family: monospace; border-radius: 8px; background-color: yellow; }
input[name="signature"] { color: green; }
</style>
</head>
<body>
Expand All @@ -20,6 +21,7 @@
<input type="submit" value="GO!"/>
<button type="submit">SUBMIT</button>
<input type="password" name="notvery" value="secret"/>
<input type="text" name="signature" class="signature"/>

<div>
<input type="checkbox" name="checker1" value="1" checked="" style="-fs-checkbox-style: check;" />
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<html>
<head>
<style>
@page {
size: 500px 250px;
margin:0;padding:20px;
}
body {margin:0;padding:0;font-size:10px; font-famliy: TestFont, serif, sans-serif; }
div {border: 0px}
input[name="signature"] {
height: 80px;
width: 150px;
border: 0;
background-color: lightgrey;
}
input[name="another-signature"] {
width: 400px;
height: 2.5em;
border: 0;
border-bottom: 1px solid black;
}
</style>
</head>

<body>
<div>
<form>
<div>
Required signature please:
<input type="text" name="signature1" required="true" class="signature"/>
</div>
<div>

<input type="text" name="another-signature" title="Alternate Field Name" alt="Partial Nameeee" class="signature"/>
<div>Another one</div>
</div>

</form>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,11 @@ public void testIssue792TargetCounterStyle() throws IOException {
assertTrue(vt.runTest("issue-792-target-counter-style"));
}

@Test
public void testSignatureField() throws IOException {
assertTrue(vt.runTest("form-signature-field"));
}

// TODO:
// + Elements that appear just on generated overflow pages.
// + content property (page counters, etc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ public void paintBackground(RenderingContext c, Box box) {
}
}

private void processControls() {
_formState.processControls(_sharedContext, _writer, _root);
private void processControls(RenderingContext renderingContext) {
_formState.processControls(_sharedContext, _writer, _root, renderingContext);
}

/**
Expand Down Expand Up @@ -898,7 +898,7 @@ public void finish(RenderingContext c, Box root) {
_bmManager.writeOutline(c, root);

// Also need access to the structure tree.
processControls();
processControls(c);
_linkManager.processLinks(_pdfUa);

if (_pdfUa != null) {
Expand Down
Loading

0 comments on commit 8ba8bf9

Please sign in to comment.