Null reference Exception During Import Fixed Document

5 posts, 0 answers
  1. Alexander
    Alexander avatar
    30 posts
    Member since:
    May 2016

    Posted 25 Jan Link to this post

    I use folowing function to Import Byte array into RadFixedDocument

    private RadFixedDocument GetFixedDocument(byte[] Content)
    {
        using (var contentStream = new MemoryStream(Content))
        {
            PdfFormatProvider formatProvider = new PdfFormatProvider(contentStream,
                                                                     FormatProviderSettings.ReadAllAtOnce);
            return formatProvider.Import();
        }
    }
     

    I become Nullreference Exception for Parameter Pages in Method import with following Stacktrace:

      bei Telerik.Windows.Documents.Fixed.FormatProviders.Old.Pdf.PdfReader.PdfContentManager.GetPages()
       bei Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.GetPages(RadFixedDocumentInternal doc)
       bei Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.LoadPages()
       bei Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.Import()

  2. Alexander
    Alexander avatar
    30 posts
    Member since:
    May 2016

    Posted 25 Jan Link to this post

    I forgot to mention that Pdf document consists from fwo greyscaled Pictures of scanned document
  3. Tanya
    Admin
    Tanya avatar
    797 posts

    Posted 30 Jan Link to this post

    Hi Alexander,

    Such an error could be observed when the offset on which the cross-reference table start index should be present inside the document is with a wrong value. We have logged a task to handle documents which contain similar invalid offsets: Handle import of documents with invalid cross-reference table offsets. In the public item, you will find a project proposing how you could repair similar documents. Could you please check it and let me know if it fixes the issue you are observing?

    Regards,
    Tanya
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  4. Ben
    Ben avatar
    5 posts
    Member since:
    Jul 2015

    Posted 13 Feb in reply to Tanya Link to this post

    Tanya, can I please get a link to the sample project?
  5. Tanya
    Admin
    Tanya avatar
    797 posts

    Posted 18 Feb Link to this post

    Hi all,

    I am sorry for misleading you. I attached the project in question and you can find it in the item: PdfProcessing: Handle import of documents with invalid cross-reference table offsets. Please, note that the project handles only a simple case of a cross-reference table and is not a full implementation of a repairing mechanism.

    Regards,
    Tanya
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top