Question T4915
Visible to All Users

Add Custom Styling, Horizontal Rule <hr/> or Border Bottom after/before each question?

created 4 years ago

I would like to add a custom element after/before every question to display a horizontal rule or similar to separate each questions from the previous/next.

Is there a recommended way of doing this?

Answers approved by surveyjs Support

created 4 years ago

Hello,

Yes, you can use SurveyPDF adorners mechanism for this

Thanks, Alex
SurveyJS Team

    Comments (2)

      Hi Alex,

      I am trying to use the adorners based on the examples on the site, however am struggling to get them to render.

      So far I have the following, but this isn't working for me:

      JavaScript
      surveyPDF.onRenderQuestion.add(function (survey, options{ var flatHtml = options.repository.create(survey, "<hr/>", options.controller, "html"); flatHtml.generateFlats(options.point).then(function(hrBrick{ options.bricks.push(hrBrick); resolve(); }); }

        Hello,

        Method repository.create accepts SurveyModel's questions as second parameter, not string with value. Here is live sample in plunker how to add hr tag between questions in SurveyPDF

        Clipboard-File-1.png

        Thanks, Alex
        SurveyJS Team