Giter Club home page Giter Club logo

pdf's Introduction

PDF

DEMO

Basic PDF parser whose functionality is limited at parsing out text and image bounding rectangles.

Running

Generate demo.pdf by running chrome --headless --print-to-pdf="demo.pdf" demo.html.

npx serve .

To-Do

Find entry object and parse the ops and args from the text stream

https://skia.org/dev/design/pdftheory

https://en.wikipedia.org/wiki/PDF#File_structure

http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/pdf_reference_1-7.pdf (last free and available version before ISO started selling the standard)

https://www.pdfexaminer.com can be used to visualize the internal structure and cross-reference it with my code.

Rip PDF.js for the subset of the rendering logic needed

src/display/canvas.js: CanvasGraphics

Rewrite in Node / complement by a Node version later on

For now using the browser for ArrayBuffer and DataView.

Figure out parsing pages and their objects

https://wiki.tcl-lang.org/page/Parsing+PDF might have info on this.

Improve parsing values

https://skia.org/dev/design/pdftheory

Be stricter about allowed value formats.

Fix XRef table second number to be count and not generation

Ensure the number of entries is equal to the count by using a for loop and then expecting the trailer.

Parse dictionaries where keys are immediately followed by values

For this, a proper formatting of values needs to be implemented first, so that things like names and strings do not get interrupted by otherwise significant characters and the slash can be used as a stop character when parsing the value.

Parse arrays recursively or replace with new value parsing completely

pdf's People

Contributors

tomashubelbauer avatar

Watchers

 avatar  avatar  avatar

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.