According to this article, the basics works fine, but I'm trying to display PrimeFaces p:signature SMALLER like this:
When I try simply change width
and height
of signature (in CSS or directly like attribute of signature component), it displays small signature component, but the signature itself it's still the same size, so it's not displayed, or part of it only:
I suppose it's because the signature is stored in absolute dimensions..
How to display the stored signature smaller?
SVG: According answer on this topic, I've tried to display generated SVG like this:
<h:outputText value="#{bean.toSvg(item.signature,600,20)}" escape="false"/>
Problem is still the same, I can't resize the SVG
Update (solution):
To use viewBox
attribute
public String toSvg(..)
{
..
sb.append(String.format("<svg width=\"%d\" height=\"%d\" viewBox=\"0 0 %d %d\" preserveAspectRatio=\"xMinYMin meet\" xmlns=\"http://www.w3.org/2000/svg\">\n", width/10, height/10, width, height));
..
}