When exporting a specific document with a CIDFontType0 font (Korean TAWBUL+HGGGothicssiP80g or BPRSCV+HGGGothicssiP60g) the document is wrongly exported which leads to missing content.
Workaround:
After import you can change the font:
pdfDocument = provider.Import(memory);
FontBase malgunGothicFont;
FontsRepository.TryCreateFont(new FontFamily("Malgun Gothic"), out malgunGothicFont);
foreach (RadFixedPage page in pdfDocument.Pages)
{
foreach (ContentElementBase element in page.Content)
{
TextFragment textFragment = element as TextFragment;
if (textFragment != null && (textFragment.Font.Name == "TAWBUL+HGGGothicssiP80g" || textFragment.Font.Name == "BPRSCV+HGGGothicssiP60g"))
{
textFragment.Font = malgunGothicFont;
}
}
}
When exporting PDF documents containing images different than Jpeg and Jpeg2000 the PdfProcessing is using by default the ImageSharp library in order to convert these images to Jpeg.
It seems there is an issue in the older version of the ImageSharp library: Saving a PNG as Jpeg only processes a part of the image on .NET 6.
Workaround: This issue seems to be fixed in the current version (2.0.0) of the ImageSharp library.
Currently, the text extraction is following the behavior (text distance) as exported with Adobe.
Provide a setting in TextFormatProvider in order to keep the original distance as in the PDF document.
According to the PDF Specification: The first entry in the table (object number 0) is always free and has a generation number of 65,535;
An invalid xref table:
xref 1 3 0000000010 00000 n 0000000124 00000 n 0000011290 00000 n
xref 0 4 0000000000 65535 f 0000000010 00000 n 0000000124 00000 n 0000011290 00000 n
The table border styles are not imported correctly with a specific document.
Workaropund:
RtfFormatProvider provider = new RtfFormatProvider();
RadFlowDocument document = provider.Import(File.ReadAllText(@"..\..\test.rtf"));
PdfFormatProvider pdfProvider = new PdfFormatProvider();
var tables = document.EnumerateChildrenOfType<Table>();
foreach (var table in tables)
{
table.Borders = new TableBorders(new Border(BorderStyle.None));
}
using (FileStream stream = File.OpenWrite(@"..\..\result.pdf"))
{
pdfProvider.Export(document, stream);
}