Hello,
I am using TextAreaEditor on my address field. How can I display entered value in TextAreaEditor in multiline when exported on pdf.
Thanks
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
Most helpful comment
I've created a wiki with some custom formatters:
https://github.com/volkanceylan/Serenity/wiki/SlickGrid-Formatters
Best Regards