Unplanned
Last Updated: 18 Aug 2020 14:38 by ADMIN
Dimitar
Created on: 09 Dec 2019 11:48
Category: PdfProcessing
Type: Bug Report
3
PdfProcessing: ArgumentException when merging or splitting files with PdfStreamWriter

When merging or splitting files that contain the "159 '\u009f'" char, ArgumentException("The encoding is not supported.") is thrown.

This issue can also result in ArgumentException in client applications with the message: currentIndirectObject should be null.

Workaround:

Use PdfFormatProvider or reflection to register the char (check the comments).

3 comments
ADMIN
Martin
Posted on: 18 Aug 2020 14:38

Hello Maik,

Thank you very much for the suggested workaround. 

I am going to include it in our internal item in order to have it in mind when the development of this issue begins.

Regards,
Martin
Progress Telerik

Maik
Posted on: 18 Aug 2020 10:18

We found another workaround without the performance decrease.

Type adobeGlyph = Type.GetType("Telerik.Windows.Documents.Fixed.Model.Fonts.Encoding.AdobeGlyphList, Telerik.Windows.Documents.Fixed");
if (adobeGlyph != null)
{
	MethodInfo dynMethod = adobeGlyph.GetMethod("RegisterPair",
		BindingFlags.NonPublic | BindingFlags.Static);
	if (dynMethod != null)
	{
		object invoke = dynMethod.Invoke(null, new object[] { ".notdef", '□' });
		return;
	}
}

Maik
Posted on: 18 Aug 2020 07:20
This should be fixed, as .notdef char are common and in my tests the workaround is 10 times slower.