When Cyrillic culture is set an InvalidCastException is thrown.
Workaround: use English culture during the import process
System.Globalization.CultureInfo currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture;
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-EN");
PdfFormatProvider provider = new PdfFormatProvider();
RadFixedDocument document;
using (Stream stream = File.OpenRead("popup_dedetizacao_ok.pdf"))
{
document = provider.Import(stream);
}
System.Threading.Thread.CurrentThread.CurrentCulture = currentCulture;
For the RadPdfViewer control you can use a similar approach:
System.Globalization.CultureInfo currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture;
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-EN");
PdfFormatProvider provider = new PdfFormatProvider();
RadFixedDocument document;
using (Stream stream = File.OpenRead("popup_dedetizacao_ok.pdf"))
{
document = provider.Import(stream);
}
System.Threading.Thread.CurrentThread.CurrentCulture = currentCulture;
RadForm form = new RadForm();
RadPdfViewer radPdfViewer1 = new RadPdfViewer();
form.Controls.Add(radPdfViewer1);
radPdfViewer1.LoadElementTree();
radPdfViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
radPdfViewer1.Document = document;
form.ShowDialog();