Text alignment inside input controls
This commit is contained in:
parent
f3ee85efab
commit
3d36a05d7f
@ -340,6 +340,7 @@ var Page = (function pagePage() {
|
||||
var m = /([\d\.]+)\sTf/.exec(da);
|
||||
if (m)
|
||||
item.fontSize = parseFloat(m[1]);
|
||||
item.textAlignment = annotation.get('Q');
|
||||
item.flags = annotation.get('Ff') || 0;
|
||||
break;
|
||||
}
|
||||
|
@ -398,7 +398,18 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight,
|
||||
function assignFontStyle(element, item) {
|
||||
var fontStyles = '';
|
||||
if ('fontSize' in item)
|
||||
fontStyles += 'font-size: ' + Math.round(item.fontSize * scale) + 'px';
|
||||
fontStyles += 'font-size: ' + Math.round(item.fontSize * scale) + 'px;';
|
||||
switch (item.textAlignment) {
|
||||
case 0:
|
||||
fontStyles += 'text-align: left;';
|
||||
break;
|
||||
case 1:
|
||||
fontStyles += 'text-align: center;';
|
||||
break;
|
||||
case 2:
|
||||
fontStyles += 'text-align: right;';
|
||||
break;
|
||||
}
|
||||
element.setAttribute('style', element.getAttribute('style') + fontStyles);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user