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).
A Link annotation must have an associated action, destination, or named destination specifying what should happen when the annotation is activated. When merging documents with invalid Link annotations, an ArgumentException is thrown with the message 'Value cannot be null. Parameter name: namedDestination'
Workaround: Remove the invalid annotations:
foreach (var annotation in document.Annotations.ToList())
{
var link = annotation as Link;
if (link != null && link.Action == null && link.Destination == null && link.NamedDestination == null)
{
(annotation.Parent as RadFixedPage).Annotations.Remove(annotation);
}
}
When merging documents containing the same embedded font every time a document is merged the same font is repeatedly embedded in the merged document. This leads to very large files.
A possible workaround before this feature is developed could be to use the PdfProcessing model to import and merge the documents. After the documents are merged to iterate the document`s content in order to cache the fonts using their name and if there are duplicated names to set the already cached one (check the attached project).
As a side note, the suggested workaround doesn't cover all possible cases (e.g. if there are fonts with a common name but different font sets (modified fonts or font subsets) this may lead to missing/different characters in the produced document). So in order to use this workaround, you will need to ensure the font names are unique for every different font.
When merging documents` pages using the PdfStreamWriter the Form Fields are not copied:
using (PdfStreamWriter fileWriter = new PdfStreamWriter(File.OpenWrite(document2Name)))
{
// Iterate through the files you would like to merge
for (int i = 0; i < 2; i++)
{
// Open each of the files
using (PdfFileSource fileToMerge = new PdfFileSource(File.OpenRead(document1Name)))
{
// Iterate through the pages of the current document
foreach (PdfPageSource pageToMerge in fileToMerge.Pages)
{
// Append the current page to the fileWriter, which holds the stream of the result file
fileWriter.WritePage(pageToMerge);
}
}
}
}
A possible workaround is to use the RadFixedDocument`s Merge() method:
document1.Merge(document2);
When using the Telerik.Documents.ImageUtils.JpegImageConverter default implementation in Blazor WebAssembly application the Magick.NET library doesn't load all of its assemblies.
Workaround:
Create a custom implementation of the JpegImageConverterBase class: Create Custom JpegImageConverter in .Net Standard.