Serenity: TextAreaEditor

Created on 23 Sep 2016  路  8Comments  路  Source: serenity-is/Serenity

Hello,

I am using TextAreaEditor on my address field. How can I display entered value in TextAreaEditor in multiline when exported on pdf.

Thanks

Most helpful comment

I've created a wiki with some custom formatters:

https://github.com/volkanceylan/Serenity/wiki/SlickGrid-Formatters

Best Regards

All 8 comments

Additional how can I make font on rendered pdf clearer?

Please ignore the additional. I able to fix the distortion of font by setting dpi to 130

If I understood your issue correctly, this is not serenity related, but a third part plugin... try searching for this in jspdf forums... something like this https://github.com/simonbengtsson/jsPDF-AutoTable/issues/43 may help you...

Or maybe you can try implementing a formatter for the column... if you want to convert new lines entered in text area field to the grid...

Regards

May not be ideal, but you could separate the address fields into different columns in your database?

thanks for the replies :) it's gives me things to try.

Hi, @rsbatacjr . I don't know if you've already done this, but I've came to this kind of demanding problem... So I managed to create a simple slick formatter to address this, so the pdf is generated correctly. In case anyone needs it:

namespace yourProject {

    @Serenity.Decorators.registerFormatter()
    export class TextAreaColumnFormatter implements Slick.Formatter {

        format(ctx: Slick.FormatterContext) {

            if ((ctx.value == null || String(ctx.value).length == 0)) {
                return ctx.value;
            }



            var textArea: String = ctx.value;
            textArea.replace(/\\r\\n/g, "<br />");

            return "<span>" + textArea + '</span>';
        }



    }
}

Best Regards

I've created a wiki with some custom formatters:

https://github.com/volkanceylan/Serenity/wiki/SlickGrid-Formatters

Best Regards

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stepankurdylo picture stepankurdylo  路  3Comments

ga5tan picture ga5tan  路  3Comments

dudeman972 picture dudeman972  路  3Comments

Pinellus picture Pinellus  路  3Comments

chintankukadiya18 picture chintankukadiya18  路  3Comments