A more accurate question is Here
I have this dbf database file containing several names and information of employees... and my java application reads rows from this database and prepare some papers (like work certificate...). And where i am from we use special characters in names since it's francophone country. Like for example "Hédia" or "fayçal".. The problem here is that the database contains names with special characters as mentioned, and when printing the papers in question, the characters are not supported and an empty white space is shown instead. I hope i am making myself clear.
So is there a way to programmatically make the printing support these characters?
I know that there's the Locale class in java but i don't know if it is possible to use it for printing purposes.
I hope this problem gets solved and thank you in advance for any help.
Edit: to create the table by the way i'm using a normal table constructor and to add the data to it i'm using a class that fetches the data from the database and returns an Object [], and a for method for this class since it's more than one row.
Here is my printing code for a table (i also wrapped the table printable to format the header and footer):
final MessageFormat headerFormat = new MessageFormat(builder.toString(), Locale.FRANCE);
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(OrientationRequested.LANDSCAPE);
aset.add(PrintQuality.HIGH);
Bulletin.print(PrintMode.FIT_WIDTH, headerFormat, null, true, aset, true);
}catch (PrinterException pe) {
String s= "Une erreur est survenue lors de l'impression, vérifier que votre imprimante est connectée \n Si le problème persiste, contacter la personne qui s'occupe de votre système";
JOptionPane.showMessageDialog(Bulletin, s, "Erreur d'impression", 1);
} catch(IndexOutOfBoundsException e){
JOptionPane.showMessageDialog(Bulletin, "Aucun bulletin dans la liste. Veuillez au moins ajouter une entrée.\n Pour ajouter une entrée, cliquez sur le menu \"Gérer les Assurances\" puis sur \"Ajouter un Bulletin\".", "Aucun Bulletin selectionné", 1);
}
To build the textpane it's the default constructor plus a method to fetch the data and add that data to a default text contained in the jtextpane (the type of the JTextPane is html by the way).
And this one is for printing a textpane (it's the default printing method of the JTextPane):
public void print()
{
MessageFormat headerMessage=new MessageFormat("Header");
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
aset.add(OrientationRequested.PORTRAIT);
aset.add(PrintQuality.HIGH);
try {
attest.print(headerMessage, null, true, null, aset, true);
} catch (PrinterException e) {
e.printStackTrace();
}
}