GithubHelp home page GithubHelp logo

Comments (2)

sambitdash avatar sambitdash commented on May 27, 2024

@gwierzchowski Unfortunately, PDF specification ISO-32000 does not support empty strings in DocInfo.
https://www.adobe.com/content/dam/acom/en/devnet/pdf/PDF32000_2008.pdf

Specification text provided below:

The optional Info entry in the trailer of a PDF file (see 7.5.5, “File Trailer”) shall hold a document information
dictionary containing metadata for the document; Table 317 shows its contents. Any entry whose value is not
known should be omitted from the dictionary rather than included with an empty string as its value.

Many PDF writers have taken exceptions to such PDF specification directives that are not ideal. Fixing for every writer may not be practical and being too tolerant can lead to unknown side effects.

My suggestion will be to identify all these cases but throw one exception to the end of processing so that an API user can get whatever compliant information is available but throwing meaningful exception should be to help identify for non-compliant behavior and handle exceptions in the API user's code not PDFIO code as a graceful option. Hence, you may want to review the PRs again in these lines. If you have an alternate viewpoint or have seen a newer version of specification please let me know.

from pdfio.jl.

sambitdash avatar sambitdash commented on May 27, 2024

Labeling as enhancement as the error thrown is not clean and once error is throw no easy way to recover valid values. A good API should provide cleaner way to recover on genuine failures which needs to be implemented here.

from pdfio.jl.

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.