Trying to clone the Signature of a SignatureField leads to InvalidOperationException as the FieldName of the cloned signature is already set.
Workaround: Remove the signatures before the merging of the document:
private static void RemoveSignatures(RadFixedDocument document)
{
List<FormField> signatures = document.AcroForm.FormFields.Where(ff => ff.FieldType == FormFieldType.Signature).ToList();
if (signatures.Count > 0)
{
foreach (FormField signature in signatures)
{
document.AcroForm.FormFields.Remove(signature);
}
}
List<SignatureWidget> signatureWidgets = document.Annotations.Where(a => a.Type == AnnotationType.Widget && a.GetType() == typeof(SignatureWidget)).Cast<SignatureWidget>().ToList();
if (signatureWidgets.Count > 0)
{
foreach (var signatureWidget in signatureWidgets)
{
foreach (RadFixedPage page in document.Pages)
{
if (page.Annotations.Contains(signatureWidget))
{
page.Annotations.Remove(signatureWidget);
}
}
}
}
}
We should implement the logic for getting character codes from Unicode when using CFFFontSource.
Workaround: The font may be changed by creating a similar font with FontsRepository.TryCreateFont(...) method.
Telerik.Windows.Documents.Fixed.Model.Fonts.FontsRepository.RegisterFont(new Telerik.Documents.Core.Fonts.FontFamily("Arial"), Telerik.Documents.Core.Fonts.FontStyles.Normal, Telerik.Documents.Core.Fonts.FontWeights.Normal, fontData); // fontData is a byte[] keeping the font definition
FontBase font;
bool hasCreatedFont = FontsRepository.TryCreateFont(new FontFamily("Arial"), out font);
foreach (TextField field in document.AcroForm.FormFields.OfType<TextField>())
{
if (hasCreatedFont)
{
foreach (var widget in field.Widgets)
{
widget.TextProperties.Font = font;
}
field.TextProperties.Font = font;
}
}
Currently, signature flags, represented by the 'SigFlags' optional entry, are not imported and exported, and there is no API for setting them.
As a result, documents signed with RadPdfProcessing (or with RadPdfViewer) appear in Adobe Reader without the blue document message bar at the top (the analogue of the RadPdfViewer's SignaturePanel).
If the API is supported, setting the flag to 1 or 3 would ensure that the message bar would be visualized in Adobe Reader.
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).
When importing a document containing an invalid PDF object dictionary key an exception is thrown.
ArgumentOutOfRangeException is thrown when importing a document because of wrongly parsing to Unicode mapping.
System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index'
According to the PDF specification (AdobeĀ® Portable Document Format Version 1.7), the appearance dictionary is optional and it is specifying how the annotation is presented visually on the page.
Exceptions thrown:
InvalidCastException: 'Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfNull' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Annotations.Appearance'.'
NullReferenceException: 'Object reference not set to an instance of an object.'
This type of action is currently not supported and a NotSupportedActionException is thrown when accessing such an object.
These exceptions can be handled using the Handling Exceptions mechanism.