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

Radio Button is not disabled / readonly #338

Closed
ThoSchCon opened this issue Mar 18, 2019 · 12 comments
Closed

Radio Button is not disabled / readonly #338

ThoSchCon opened this issue Mar 18, 2019 · 12 comments

Comments

@ThoSchCon
Copy link

ThoSchCon commented Mar 18, 2019

Hi,

I noticed that this html string for a radio button is not readonly in the generated pdf as expected.

<input type='radio' name='radio-input' readonly='' checked='' />
Expected behaviour:
The radio button in the generated pdf should be readonly.

Meanwhile for a checkbox readonly works as expected
<input type='checkbox' name='checker' readonly='' checked='' />

Setup
As suggested in the last release note I use the "FastMode".
PdfRendererBuilder builder = new PdfRendererBuilder().useFastMode();

openhtmltopdf version = 0.0.1-RC18

@syjer
Copy link
Contributor

syjer commented Nov 17, 2019

hi @ThoSchCon ,

a little bit late for the answer, but it seems it's not possible (easily): see https://answers.acrobatusers.com/How-do-I-disable-a-specific-radiobutton-in-a-set-of-radiobuttons-q25869.aspx .

I did try with pdfbox, and effectively it's not possible to disable a single radio button in a group.

@ThoSchCon
Copy link
Author

Thank you for the hint! Appreciate you getting back to me ;-).

Best regards

@aleks-shbln
Copy link

Hi,

@syjer mentioned that you can't disable one radio button from the group but the whole group with the same name can be disabled. I tried to set readonly="" to every radio button input but it didn't help.

Any clues how I can disable the whole group of input radio buttons?

@syjer
Copy link
Contributor

syjer commented Jun 26, 2020

hi @aleks-shbln , currently I don't think it's implemented (in openhtmltopdf)

@dmitry-weirdo
Copy link

dmitry-weirdo commented Sep 4, 2020

We also need this feature.
https://github.com/danfickle/openhtmltopdf/wiki/Form-Controlsdisabled / readonly works for other elements (checkbox, text, textarea), but not for the radio :(
It will be enough to just disable the whole group.

@paulterinho
Copy link

So there isn't any way to make the pdf readonly either?

(@dmitry-weirdo Plus one to that request)

@paulterinho
Copy link

Thanks @danfickle !

@paulterinho
Copy link

paulterinho commented Dec 23, 2020

@danfickle To get this fix working with the Pretty-Resume example project, what steps would I have to take? (For the https://github.com/danfickle/pretty-resume project, which I'm using for a test harness )

I've added some radio buttons in the HTML like so in the Experience section :

<div class="block">
                <div class="icon">
                    <i class="fa fa-suitcase"></i>
                </div>
                <div class="content">
                    <h2 th:text="${lang.headings.experience}"></h2>
                    <form >
                        <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" readonly="" />
                            <label for="radio-1-0">Radio 1, value 0</label>
                            <input type="radio" name="radio-1-name" value="1" id="radio-1-1" readonly="" />
                            <label for="radio-1-1">Radio 1, value 1</label>
                            <input type="radio" name="radio-1-name" value="2" id="radio-1-2" readonly="" />
                            <label for="radio-1-2">Radio 1, value 2</label>
                        </div>


                    </form>

                    <div class="item" th:each="experience : ${person.experience}">
                        <h3><span th:text="${experience.position}" /> - <span th:text="${experience.company}" /></h3>
                        <span th:text="${experience.timeperiod}"></span>
                        <p th:text="${experience.description}"></p>
                    </div>
                </div>
            </div>

I have tried to update the POM file to

<dependency>
  		<groupId>com.openhtmltopdf</groupId>
  		<artifactId>openhtmltopdf-pdfbox</artifactId>
  		<version>1.0.6</version>
  	</dependency>

From version 1.0.0. but it looks like that isn't sufficient to get checkboxes to be readonly.

Suggestions would be most welcomed: I have an upcoming demo to propose this project's adoption to my dev team.

No worries if you are too busy to respond,

Paul

@syjer
Copy link
Contributor

syjer commented Dec 25, 2020

hi @paulito-bandito , the fix has been committed after the release of 1.0.6, you will need to wait a little bit for the next release.

@paulterinho
Copy link

paulterinho commented Dec 25, 2020 via email

@danfickle
Copy link
Owner

You can also build it yourself:

  • Download or clone
  • Run mvn install -DskipTests
  • This will build all modules and put them in your local maven repository.
  • Use installed modules, version will be 1.0.7-SNAPSHOT
  • Assumes you have Maven installed.

@paulterinho
Copy link

paulterinho commented Dec 25, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants