1

我正在尝试使用 itextsharp 在 pdf 文件中制作单选按钮列表,但它会创建框。

有没有人可以告诉我为什么会这样?

for (int j = 0; j < 8; j++)
{
    Rectangle(0, 0, 22, 22), "RadioButtons_" + j.ToString(), "On");
    Rectangle _rect;

    _rect = new Rectangle(100, 100, 100, 100);


    radios[j] = new RadioCheckField(writer, _rect, "RadioButtons_" + j.ToString(), "On");
    radios[j].BackgroundColor = new GrayColor(0.8f);
    radios[j].BorderColor = GrayColor.BLACK;
    radios[j].CheckType = RadioCheckField.TYPE_CIRCLE;

    cell = new PdfPCell();
    if (j == 6)
    {
        cell.Colspan = 3;
        radios[j].Text = "&nbsp;&nbsp; Not Important";
    }
else if (j == 7)
    {
        cell.Colspan = 3;
        radios[j].Text = "Not Applicable";
    }
    else
    {
        cell.Colspan = 1;
    }

    kid = new iTextSharp.text.pdf.events.FieldPositioningEvents(writer, radios[j].CheckField, "radios");
    kid.Padding = 0.5f;
    cell.CellEvent = kid;
    table.AddCell(cell);
}
4

0 回答 0