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).
I have read that there limitations to PDF files being imported, however, the file being imported was generated with FixedContentEditor, so, should be able to import?
using (Stream stream = Stream)When exporting a document referencing PdfProcessing`s .NET Standard assemblies with PdfComplianceLevel set an exception is thrown.
The common annotation properties are described in table "Entries common to all annotation dictionaries" of the Pdf specification.
Declined: Handling a partial annotation import-export could lead to exporting invalid PDF documents.
According to the PDF Specification: A redaction annotation (PDF 1.7) identifies content that is intended to be removed from the document.
There are two possible options to workaround this functionality:
foreach (RadFixedPage page in document.Pages)
{
foreach (ContentElementBase elementBase in page.Content)
{
if (elementBase is TextFragment textFragment)
{
if (IsValidEmail(textFragment.Text))
{
textFragment.Text = string.Empty;
}
}
}
}
foreach (RadFixedPage page in document.Pages)
{
foreach (ContentElementBase elementBase in page.Content)
{
if (elementBase is TextFragment textFragment)
{
if (IsIntersecting(rectangleGeometry, textFragment))
{
textFragment.Text = string.Empty;
}
}
}
}
When importing a document containing a CIDFont with default width (DW) set as PdfReal (double) an exception is thrown: 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.PdfInt'.'
44 0 obj
<< /BaseFont /NotoSansMono-Medium /CIDSystemInfo << ... >> /CIDToGIDMap /Identity /DW 600.00000 ... /Subtype /CIDFontType2 /Type /Font >>
endobj
According to the PDF Specification: DW - integer - (Optional) The default width for glyphs in the CIDFont. Default value: 1000.
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.