Editable PDF Forms

Editable PDF forms.

Note: weayprint and prince require the commandline option --pdf-forms for generating an editable PDF form (otherwise read-only).

Repository files

PDF files

Converter Status PDF Preview
PDFreactor  OK
PrinceXML  OK
Antennahouse  OK
Weasyprint  ERROR
partly broken PDF forms support (no support for radio element)
PagedJS  UNSUPPORTED
Typeset.sh  OK
Vivliostyle  UNSUPPORTED
BFO  OK
OK OK with issues Error Unsupported

HTML input

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="styles.css" />
    </head>
    <body>
        <form method="POST">
            <fieldset>
                <legend>Test form</legend>

                <div class="row">
                    First name:
                    <input type="text" name="firstname" value="" placeholder="Firstname"/>
                </div>
                <div class="row">
                    Last name:
                    <input type="text" name="lastname" value="" placeholder="Lastname"/>
                </div>
                <div class="row">
                    <input type="checkbox"> Married? 
                </div>
                <div class="row">
                    Gender:
                    <br/>
                    <input type="radio" name="gender" value="male">Male 
                    <br/>
                    <input type="radio" name="gender" value="female">Female
                    <br/>
                    <input type="radio" name="gender" value="diverse">Diverse
                </div>
                <div class="row">
                    Gender 2:
                    <select name="testdata">
                        <option value="male">Male</option>
                        <option value="female">Female</option>
                        <option value="diverse">Diverse3</option>
                    </select>
                </div>
                <div class="row">
                    Comment
                    <br/>
                    <textarea rows="5" cols="60"></textarea>
                </div>
                <div class="row">
                    <input type="submit" value="Save"/>
                </div>
            </fieldset>
        </form>
    </body>
</html>

Stylesheet

@page {
    size: a4;
    margin: 2cm;
}

body {
    font-family: Arial, sans-serif;
}

form, form input, textarea, select{ 
    -ro-pdf-format: pdf; 
}

fieldset {
    border: 2px solid pink;
    padding: 1em;
}

legend {
    font-weight: bold;
    font-size: 1.2em;
}

select {
    width: 20em;
}

input[type="text"] {
    width: 50%;
}

div.row {
    margin-bottom: 1em;
}