私はこれが可能だとは確信していませんが、質問する価値があると思いました。私はpdfstamperとacrofieldsメソッドを使ってフォームフィールドのフォントを設定する方法を考え出しましたが、同じフィールドにテキストの異なる部分のフォントを設定できるようにしたいと思います。私は現在、フォームフィールドのフォントを設定していますどのようにここにあります:iTextSharpを使用して異なるフォントを使用するようにフォームフィールドの異なる部分を設定してください
// Use iTextSharp PDF Reader, to get the fields and send to the
//Stamper to set the fields in the document
PdfReader pdfReader = new PdfReader(fileName);
// Initialize Stamper (ms is a MemoryStream object)
PdfStamper pdfStamper = new PdfStamper(pdfReader, ms);
// Get Reference to PDF Document Fields
AcroFields pdfFormFields = pdfStamper.AcroFields;
//create a bold font
iTextSharp.text.Font bold = FontFactory.GetFont(FontFactory.COURIER, 8f, iTextSharp.text.Font.BOLD);
//set the field to bold
pdfFormFields.SetFieldProperty(nameOfField, "textfont", bold.BaseFont, null);
//set the text of the form field
pdfFormFields.SetField(nameOfField, "This: Will Be Displayed In The Field");
// Set the flattening flag to false, so the document can continue to be edited
pdfStamper.FormFlattening = true;
// close the pdf stamper
pdfStamper.Close();
私はテキストは、上記の「この:」に設定されている設定どこで行うことができるようにしたいのですがどのような「大胆にをして去りますフィールドに表示されます "太字ではありません。私はこれが実際に可能であるかどうかはわかりませんが、私が現在取り組んでいることに本当に役立つだろうから頼む価値があると思いました。
ありがとうございます!
フィールドフォームのテキストはどこで区別されますか?これを設定することはどのようにして知ることができますか? – Jake
@ Jake私の答えである12.7.4.3でリンクされたPDF Referenceに行くと、許可されているものの完全な説明が表示されます。これは基本的にHTMLのサブセットです。 –