After
I am using Here is an example of a call for this function While doing this, I had run a thing the fact that my Acrofield had a predefined font size as this function returned to the column at the top of the column Text is set, any font change in the function will be required. Here is an example of changing font size: I hope this saves some time and energy in the future. iTextSharp to fill in a
pdf template for. The data I am using is kept in a database and formatted as
HTML . My problem is that when I get the
load AcroField this text I get it to break the line but with no bold and italicizing . I've already tried using
HtmlWorker , but used to convert all the examples online
HTML to a
PDF But I'm trying to set up a
AcroField in the PDF template will be appreciated. After looking through the expense forums and iTextSharp source code I got a solution after reading the text "itemprop =" text "
string htmlText = ". & Lt; p & gt; Hello & lt; / P & gt; & lt; br / & gt; & lt; i & gt; World & lt; / i & gt; "; IList & LT; AcroFields.FieldPosition & gt; Pos = form.GetFieldPositions ("Field 1"); // field 1 is the name of the field in the PDF template that you are trying to fill / overlay AddHTMLToContent (htmlText, stamp.GetOverContent (pos [0] .page), pos); // Stamp In this example is pdfstammer
Public Zero AddHTMLToContent (string htmlText, PdfContentByte contentBtye, IList & lt; acroFields.FieldPosition & gt; pos) {paragraph para = new paragraph (); Column Text C1 = New Column Text (contentBtye); {List & lt; IElement & gt; Element = HTMLWorker.ParseToList (new stringreader (html text), empty); Prior (scales element in elements) {advance (chunk of chunk in element. Chunk) {chunk.Font.Size = 14; }} Par.Add (element [0]); C1.AddElement (equal); C1.SetSimpleColumn (pos [0]. Position.Left, pos [0] .position.bottom, pos [0] .position.right, pos [0] .position.Top); C1.Go (); // Very important !!! } Hold (pre-ex) {throw; }}
No comments:
Post a Comment