AFLayoutText causes failure in creating appearance
In Acrobat 11 I'm using AFLayout object to create annotation appearance. I want it to have background and some text on it. Everything seems to run fine but, when I use also method AFLayoutText as in the sample below it creates null CosObj. Without the text method works fine and the appearance is created correctly. Am I missing something?
Thanks
ASFixedRect rect;
PDAnnotGetRect(annot, &rect);
AFLayout layout = AFLayoutNew(&rect, pdRotate0, cosDoc);
// border and background
AFPDWidgetBorderRec border;
border.nStyle = AFPDWBSolid;
border.nWidth = 0;
PDColorValueRec brdrColor = { PDDeviceRGB, { fixedOne, fixedZero, fixedZero, fixedZero } };
PDColorValueRec bkndColor = { PDDeviceRGB, { fixedOne, fixedZero, fixedZero, fixedZero } };
AFLayoutBorder(layout, &border, &brdrColor, &bkndColor, false);
// text
TextAppearance_t ta;
SetDefault_TextAppearanceP(&ta);
AFLayoutText(layout, false, false, &border, &ta, "OK");
// create stream cosObj
CosObj cosN = AFLayoutCreateStream(layout);
AFLayoutDelete(layout);
