Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Seth Ford   on Feb 11 In Java Category.

  
Question Answered By: Stacy Cunningham   on Feb 11

Just use Identity-H as your PDF Encoding.
To define your PDF Encoding you can define a style then use it in your
report elements.

Example:


// Define Your Style
JRDesignStyle normalStyle = new JRDesignStyle();
normalStyle.setName("Arial_Normal");
normalStyle.setDefault(true);
normalStyle.setFontName("C:/WINDOWS/Fonts/tahoma.ttf");
normalStyle.setFontSize(9);
normalStyle.setPdfFontName("C:/WINDOWS/Fonts/tahoma.ttf");
normalStyle.setPdfEncoding("Identity-H");
normalStyle.setPdfEmbedded(true);
normalStyle.setBlankWhenNull(true);
jasperDesign.addStyle(normalStyle);

// Use the defined style in you elements
staticText = new JRDesignStaticText();
staticText.setX(x1);
staticText.setY(0);
staticText.setWidth(sizes[i]);
staticText.setHeight(15);
staticText.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
staticText.setStyle(normalStyle);
staticText.setText(fieldName);

Share: