Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Signature Field #911

Open
wants to merge 1 commit into
base: open-dev-v1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="required" 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