Giter Club home page Giter Club logo

Comments (3)

gologames avatar gologames commented on May 28, 2024

Hello,

This is not a bug. This is expected behavior. We use Checkbox Acroform entity inside PDF document to map SurveyJS boolean question. Boolean question has three states: true, false, intermediate. But Acroform checbkox only two states:true and false

So, in case of true we set true value and true label. In case of false we set false value and false label. In case of intermediate we set false value without label. False value of Acroform checbkox renders without any checked mark. This depends on render of PDF viewer application (out of our responsibility)

As a workaround you can use SurveyPDF Adorners mechanism and set value of Acroform checbkox to true before export to PDF. Here live sample of this approach

image

surveyPDF.onRenderQuestion.add((_, options) => {
        if (options.question.getType() === "boolean" &&
            !options.question.isEmpty() && options.question.value === false) {
            options.bricks[0].unfold()[2].checked = true;
        }
    });

Thanks, Alex
SurveyJS Team

from survey-pdf.

jbrou015 avatar jbrou015 commented on May 28, 2024

I have tried your code but... TS2339: Property 'checked' does not exist on type 'IPdfBrick'. What am I missing? I have upgraded the libraries to 1.8.32

from survey-pdf.

gologames avatar gologames commented on May 28, 2024

Hello,

IPdfBrick is common interface for all "bricks" types. CheckItemBrick and RadioItemBrick classes have checked property

Thanks, Alex
SurveyJS Team

from survey-pdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.