ZUGFeRD (acronym for Zentraler User Guide des Forums elektronische Rechnung Deutschland) is a specification for the electronic invoice format of the same name.
The feature depends on the following features:
With the current implementation when passing the font file using the FontsRepository the entire font file is embedded.
In order to embed only a subset of characters used in the document, the font should be installed and the font shouldn't be registered in the FontsRepository.
12 0 obj ( Brillig ) endobj
2545 0 obj << /Type /Page /Parent 2537 0 R /Contents 8 0 R /Resources 2538 0 R >> 2546 0 obj ....
URI Action with invalid mailto URL scheme - mailto:***@***.**(E-mail) can be imported but trying to merge or clone the document throws UriFormatException: 'Invalid URI: The hostname could not be parsed.'
Workaround: Remove the annotations that contain invalid Uri:
PdfFormatProvider provider = new PdfFormatProvider();
this.pdfDocument = provider.Import(memory);
foreach (var page in this.pdfDocument.Pages.ToList())
{
List<Link> links = page.Annotations.Where(a => a.Type == AnnotationType.Link).Select(a => a as Link).ToList();
foreach (var link in links)
{
Uri uri;
UriAction uriAction = link.Action as UriAction;
try
{
uri = uriAction.Uri;
}
catch (UriFormatException)
{
page.Annotations.Remove(link);
}
}
}
According to the Pdf Specification: A given object number must not have an entry in more than one subsection within a single section.
The object on line 7 has object number 2, the same as of object on line 5.
With the current implementation, the Standard Fonts preloaded in the FontsRepository cannot be replaced.
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.'
When importing such documents an InvalidDataException (Unknown compression method <method-name>) is thrown.
According to the current .ZIP File Format Specification these methods are 7, 11, 13, 15, and 17.
Compression method:
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);
}
}
By specification, the last line of the file contains only the end-of-file marker, %%EOF. If the file contains many trailing bytes at its end, a NotSupportedException: 'StartXRef keyword cannot be found.', is thrown.
Workaround: Trim any content after the end-of-file marker (see FixInvalidEndOfFile).
An InvalidCastException is thrown when importing documents containing outlines with an invalid destination set:
The exception:
System.InvalidCastException: 'Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfReal' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfName'.'