When extracting text from a composite font the ToUnicode mapping should be used but when this mapping is missing the char codes must be mapped by constructing a secondary map from fonts ordering and registry.
A possible workaround could be to register a TrueType font using the FontsRepository.RegisterFont() method:
FontsRepository.RegisterFont(new FontFamily(fontName), FontStyles.Normal, FontWeights.Normal, File.ReadAllBytes(pathToFont));
FontsRepository.TryCreateFont(new FontFamily(fontName), FontStyles.Normal, FontWeights.Normal, out FontBase font);
foreach (RadFixedPage page in document.Pages)
{
foreach (ContentElementBase contentElement in page.Content)
{
if (contentElement is TextFragment textFragment)
{
if (textFragment.Font.Name == fontName)
{
textFragment.Font = font;
}
}
}
}
When importing a PDF document, opening the stream in using statement, and using the default constructor of the PdfDocumentSource class, an exception is thrown:
using (Stream stream = ofd.OpenFile())
{
this.pdfViewer.DocumentSource = new PdfDocumentSource(stream);
}
using (Stream stream = ofd.OpenFile())
{
PdfImportSettings importSettings = new PdfImportSettings
{
CopyStream = true
};
this.pdfViewer.DocumentSource = new PdfDocumentSource(stream, importSettings);
}
This is caused by an incorrect order of applying the TextMatrix and the glyph stroking operation.
This is Unicode (UTF-16BE) encoding for the Adobe-GB1 character collection; contains mappings for all characters in the GB18030-2000 character set. Described on page 443 in Pdf Reference 1.7.
Implement import and export of content with Type0Font with GBK-EUC-H encoding.
Hello,
We are using PdfViewer and its command descriptor.
Right now, I don't find how to set the name of the file being saved. In my humble opinion, the command parameter should be the fileName of the PDF being exported.
The documentation doesn't tell how to set the fileName which is a basic thing to do for a save file command.
I didn't find a solution in the forum. Weird nobody ever talked about it.
Thanks for evaluating this feedback
NullReferenceException is thrown when importing a document with AcroForm referencing a missing object for fields collection. This is a regression as the same document will be imported without a problem in previous versions of RadPdfViewer as the AcroForm object would be entirely skipped.