状態、および「未チェック」「確認」二つの画像、チェックボックスのための1つを作成し、右の画像を取得するためにIF文を使用します。すなわち:
string pdfpath = Server.MapPath("PDFs");
string imagepath = Server.MapPath("Images");
Document doc = new Document();
try
{
PdfWriter.GetInstance(doc, new FileStream(pdfpath + "/Images.pdf", FileMode.Create));
doc.Open();
doc.Add(new Paragraph("GIF"));
Image gif;
if (chkBoxExample.Checked)
{
gif = Image.GetInstance(imagepath + "/checked.gif");
}
else
{
gif = Image.GetInstance(imagepath + "/unchecked.gif");
}
doc.Add(gif);
}
finally
{
doc.Close();
}
こんにちはグスタボ、私はあなたの答えを感謝しています。しかし、プレースホルダを次のようなテキストに置き換えるのと同様の方法でプレースホルダに画像を挿入することができます:(content.Replace(["Product_ID"]、TextBox1.text);) –
コンテンツは何ですか? –
コンテンツは、HTMLのすべてのテキストを含む変数です。 Replace()のような同様のメソッドを使用してプレースホルダをイメージに置き換える方法があるのだろうかと疑問に思っています –