<html>
<head>
<script type="text/javascript">
function addOption(dropdown,text,value )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
dropdown.options.add(optn);
}
</script>
</head>
<select id="year" name="year" style="width: 70px" ></select>
<script type="text/javascript">
var date = new Date();
var startYear = '2000' ;
var currentYear = date.getFullYear();
do
{
addOption(document.getElementById("year"), currentYear, currentYear);
currentYear--;
}
while (currentYear >= startYear);
</script>
</BODY>
</html>
Creating Pdf in multiple Languages in Java This code demonstrate how to create pdf in multiple languages in java by using ITEXT pdf creator. To use this sample code download itext.jar To display different locale on pdf you need to download font known as Arialuni.ttf and added to the project Most important thing is the encoding part set encoding to "Identity-H" (String encoding = "Identity-H";) as well as create font for the same to take effect in pdf create font (Font fontNormal = FontFactory.getFont(("c:/windows/fonts/arialuni.ttf"), encoding,BaseFont.EMBEDDED, 8, Font.NORMAL);) You can download the source code from here import java.io.FileOutputStream; import com.lowagie.text.Chunk; import com.lowagie.text.Document; import com.lowagie.text.Font; import com.lowagie.text.FontFactory; import com.lowagie.text.HeaderFooter; import com.lowagie.text.Paragraph; import com.lowagie.text.Phrase; import com.lowagie.text.pdf....
Comments
Post a Comment