I extract the font size of a form field to get the information about its size (using iText). This works well for most of the documents however for some I get a font size of 1 because in the appearance the font size is 1. However if I open the PDF in several different viewers the size of this text field is always 8. I thought a form field should be rendered according to its appearance? So why do PDF Viewers use the default appearance and not the font size defined in the appearance stream?
Update: As mentioned by MKL I did forget to consider the text matrix. I did implement my own RenderListener for the font. Does anyone know how to apply the scaling?
public class PdfStreamFontExtractor implements RenderListener{
@Override
public void usedFont(DocumentFont font, float fontSize) {
this.font=font;
this.fontSize=fontSize;
}
@Override
public void renderText(TextRenderInfo renderInfo) {
//get scaling factor from textToUserSpaceTransformMatrix?
}
...
}