Hi all,
I have created a tagmap and a template.
tagmap:
<tagmap>
<tag name="newline" alias="br" />
<tag name="list" alias="ul">
<attribute name="symbolindent" value="20" />
<attribute name="listsymbol" value="-" />
</tag>
<tag name="listitem" alias="li">
<attribute name="size" value="10" />
</tag>
<tag name="paragraph" alias="p" >
<attribute name="size" value="10" />
</tag>
<tag name="phrase" alias="em">
<attribute name="style" value="italic" />
</tag>
<tag name="phrase" alias="strong">
<attribute name="style" value="bold" />
</tag>
<tag name="phrase" alias="[/kd]">
<attribute name="color" value="red" />
</tag>
<tag name="phrase" alias="[kd]">
<attribute name="color" value="red" />
</tag>
</tagmap>
<tag name="newline" alias="br" />
<tag name="list" alias="ul">
<attribute name="symbolindent" value="20" />
<attribute name="listsymbol" value="-" />
</tag>
<tag name="listitem" alias="li">
<attribute name="size" value="10" />
</tag>
<tag name="paragraph" alias="p" >
<attribute name="size" value="10" />
</tag>
<tag name="phrase" alias="em">
<attribute name="style" value="italic" />
</tag>
<tag name="phrase" alias="strong">
<attribute name="style" value="bold" />
</tag>
<tag name="phrase" alias="[/kd]">
<attribute name="color" value="red" />
</tag>
<tag name="phrase" alias="[kd]">
<attribute name="color" value="red" />
</tag>
</tagmap>
template:
<LetterTemplate>
<Text>
<p>To: <kd>fname</kd> <kd>lname</kd><br /><kd>address</kd><br /><kd>city</kd> <kd>state</kd> <kd>zip</kd> </p>
<br/>
<p>
This is from the
<strong>university of louisville</strong> and is for
<strong>
<em><kd>name</kd></em>
</strong> who requested this
letter.
</p>
</Text>
</LetterTemplate>
<Text>
<p>To: <kd>fname</kd> <kd>lname</kd><br /><kd>address</kd><br /><kd>city</kd> <kd>state</kd> <kd>zip</kd> </p>
<br/>
<p>
This is from the
<strong>university of louisville</strong> and is for
<strong>
<em><kd>name</kd></em>
</strong> who requested this
letter.
</p>
</Text>
</LetterTemplate>
I want to do a mailmerg and replace anything between the <kd></kd> tags with data from a database. If I have 50 records in the database then I will create a pdf with 50 pages.
I would like to use a tagmap also when doing this. This way I only have to worry about my personal <kd> tags. The problem is that the XMLParser only takes input streams and sax input sources. It would be nice if I could pass a string of xml to the XMLParser. That way I could manipulate the text with data from a database and then create a new page for each record of the database.
I don't see any tutorials for xml and mail merge. Is there another or better way to do the mailmerge concept.
Thanks Doug
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
