Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Radiobutton checked value bug: works in all pdf viewers except Acrobat Reader.

Community Beginner ,
Sep 04, 2020 Sep 04, 2020

"Checked" radiobutton value is only working in Acrobat Reader when:

  • First radio button value is "0".
  • Radio button values are consecutive integers.

https://github.com/danfickle/openhtmltopdf/issues/547 — here I spent several hours to identify this issue.

 

Result pdf:

See the file attachment.

 

Source html:

 

<html>
<head>
    <title>Radios checked test for PDF conversion</title>
    <style>
        .div-with-padding {
            padding-bottom: 20px;
        }
    </style>
</head>
<body>
<form action="http://localhost/form.php" method="POST">
    <div class="div-with-padding">
        <div>Radios with values 0, 1, 2. Checked works.</div>
        <input type="radio" name="radio-1-name" value="0" id="radio-1-0"/>
        <label for="radio-1-0">Radio 1, value 0</label>
        <input type="radio" name="radio-1-name" value="1" id="radio-1-1"/>
        <label for="radio-1-1">Radio 1, value 1</label>
        <input type="radio" name="radio-1-name" value="2" id="radio-1-2" checked="checked"/>
        <label for="radio-1-2">Radio 1, value 2</label>
    </div>

    <div class="div-with-padding">
        <div>Radios with values 1, 2. Checked does not work.</div>
        <input type="radio" name="radio-2-name" value="1" id="radio-2-1" checked="checked"/>
        <label for="radio-2-1">Radio 2, value 1</label>
        <input type="radio" name="radio-2-name" value="2" id="radio-2-2"/>
        <label for="radio-2-2">Radio 2, value 2</label>
    </div>

    <div class="div-with-padding">
        <div>Radios with values 1, 0. Checked does not work on any value.</div>
        <input type="radio" name="radio-3-name" value="1" id="radio-3-1"/>
        <label for="radio-3-1">Radio 3, value 1</label>
        <input type="radio" name="radio-3-name" value="0" id="radio-3-0" checked="checked"/>
        <label for="radio-3-0">Radio 3, value 0</label>
    </div>

    <div class="div-with-padding">
        <div>Radios with values one, two. Checked does not work.</div>
        <input type="radio" name="radio-4-name" value="one" id="radio-4-one" checked="checked"/>
        <label for="radio-4-one">Radio 4, value one</label>
        <input type="radio" name="radio-4-name" value="two" id="radio-4-two"/>
        <label for="radio-4-two">Radio 4, value two</label>
    </div>

    <div class="div-with-padding">
        <div>Radios with values 0, 2, 1. Checked will only work on values 0 and 1.</div>
        <input type="radio" name="radio-5-name" value="0" id="radio-5-0"/>
        <label for="radio-5-0">Radio 5, value 0</label>
        <input type="radio" name="radio-5-name" value="2" id="radio-5-2" checked="checked"/>
        <label for="radio-5-2">Radio 5, value 2</label>
        <input type="radio" name="radio-5-name" value="1" id="radio-5-1"/>
        <label for="radio-5-1">Radio 5, value 1</label>
    </div>

    <div class="div-with-padding">
        <input type="checkbox" name="check-1" id="check-1-id" checked="checked"/>
        <label for="check-1-id">Checked checkbox</label>
        <input type="checkbox" name="check-2" id="check-2-id"/>
        <label for="check-2-id">Non-checked checkbox</label>
    </div>
</form>
</body>
</html>

 

 

Pdf file display in different viewers:

 

Acrobat Reader:

Dmitry5C6A_0-1599216593652.pngexpand image

 

Foxit Reader:

Dmitry5C6A_1-1599216613626.pngexpand image

 

Firefox:

Dmitry5C6A_2-1599216637346.pngexpand image

 

Chrome:

Dmitry5C6A_3-1599216663739.pngexpand image

 

Please fix ASAP!

TOPICS
View PDF
2.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 04, 2020 Sep 04, 2020

Sounds a problem. Please report it to Adobe. Posting here DOES NOT REPORT IT. https://www.adobe.com/products/wishform.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 04, 2020 Sep 04, 2020

Thank you. I've posted a bug here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 04, 2020 Sep 04, 2020

In the PDF file the radiobuttons are not checked.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 04, 2020 Sep 04, 2020

Hallo Bernd.

 

Exactly, so the default "checked" works for any values of the checkbox in all other pdf viewers.

 

In Acrobat Reader, however, default "checked" only works if the radio buttons (with the same name) have values 0, 1, 2 etc, mandatory starting with value 0.

 

Beste Grüße, Dmitriy.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 04, 2020 Sep 04, 2020
LATEST

E.g. when I look in the PDF file at Radio 2 both radio buttons are set to Off. So no button is checked when you open the file in Acrobat Reader.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines