I use iTextSharp to create document in my programs. All text in documents is Russian, I use Tahoma fonts:
private static void PrepareFonts()
{
_baseTahoma = BaseFont.CreateFont("c:/windows/fonts/tahoma.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
_tahomaBold = new Font(_baseTahoma, 10, Font.BOLD);
_tahoma = new Font(_baseTahoma, 10, Font.NORMAL);
_tahoma16Bold = new Font(_baseTahoma, 18, Font.BOLD);
_tahomaSmall = new Font(_baseTahoma, 8, Font.NORMAL);
}
When document is created, I print it on button click that way:
RegistryKey adobe = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe");
if (adobe != null)
{
string path = adobe.GetValue("").ToString();
GenerateDocuments();
Process proc = new Process();
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.StartInfo.Verb = "print";
string pdfFileName = _invoice.FullName;
proc.StartInfo.FileName = path;
proc.StartInfo.Arguments = @"/p /h " + pdfFileName;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
if (proc.HasExited == false)
{
if (!proc.WaitForExit(5000))
proc.Kill();
}
proc.EnableRaisingEvents = true;
proc.Close();
}
But on the paper there are only lines from tables without any characters. There’s no text or numbers.
In requirements specification is written that user must print documents on button click and I have to do it that way. Manual opening document and “Print as image” are not possible.
Can anyone give suggestion, how can I print Cyrillic document?
@Drac When I open the file, I see Cyrillic characters; when I print the file (normal printing), I see Cyrillic characters. If some printer isn’t able to print the document correctly, you need to look at your printer driver (maybe you’re using the wrong one) or your printer.