Giter Site home page Giter Site logo

Comments (4)

FinalFrontierPrototyping avatar FinalFrontierPrototyping commented on August 14, 2024

I noticed that when I open the file, add one character to a field, save it and reprocess it, it gives no error?

from pdfpig.

FinalFrontierPrototyping avatar FinalFrontierPrototyping commented on August 14, 2024

Anything I can provide in order to support you as efficient as possible?
This issue is making my current tool non-functional because 5% of the PDF files cannot be processed.

from pdfpig.

EliotJones avatar EliotJones commented on August 14, 2024

Unfortunately this error can be due to basically any unexpected formatting in the source file. Without the source file it is very difficult to tell.

The error message suggests the error is happening when trying to find the information near the end of the document which looks like:

xref
0 103
0000000000 65535 f 
0000058002 00000 n 
0000000019 00000 n 
0000001903 00000 n 
0000058273 00000 n
...

It might be possible to get more information about the error locally by debugging the PdfPig code. You can clone this repository and locally set the version of .NET you have available with this script https://github.com/UglyToad/PdfPig/blob/master/tools/set-dotnet-version.ps1

Then you can load the file in a test and see what is going wrong: https://github.com/UglyToad/PdfPig/blob/master/src/UglyToad.PdfPig.Tests/Integration/LocalTests.cs

from pdfpig.

FinalFrontierPrototyping avatar FinalFrontierPrototyping commented on August 14, 2024

Hello @EliotJones,

Thanks for the feedback.
I removed the Nuget package and cloned the repository.

When I run my code I see the following:

  • PdfTokenScanner: Line: 241 : Debug.WriteLine("Found more than 1 token in an object.");
  • The exception is thrown by: CrossReferenceParser (line 164:
if (!TryParseCrossReferenceStream(previousCrossReferenceLocation, pdfScanner, null, out var tablePart))
                    {
                        if (!TryBruteForceXrefTableLocate(bytes, previousCrossReferenceLocation, out var actualOffset))
                        {
                            //This is the point when it gives the error
                            throw new PdfDocumentFormatException();
                        }

                        previousCrossReferenceLocation = actualOffset;
                        missedAttempts++;
                        continue;
                    }

from pdfpig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.