Giter VIP home page Giter VIP logo

pdf-to-text-via-php's Introduction

PDF 2 text via PHP

This is a collection (quite a draft collection) of classes with the aspiration of becoming a parsing library so that the task of converting a pdf file to text or extracting its images through php becomes a trivial one.

Sharing

Sharing is highly appreciated. The current code is by no means a working/stable library, but it does work quite well with pdfs exported with OpenOffice even with unicode characters.

Internals

There is an encapsulating Pdf class that parses the document, quite ignorantly at the moment due to poor reading of the pdf reference, and then creates all the pdf objects that it meets.

The classes do not declare an object type for each possible pdf value because php already covers the value types boolean, string, int, float, etc. but they do declare a PdfStream (which is our main interest) and a PdfReferenceValue.

PdfStream

The pdf stream represents a stream of information encapsulated in the pdf keywords 'stream' 'endstream'. It allows for easy decoding (decompressing, etc.) and it determines if it is a text stream statistically measuring the BT pdf keywords of the decompressed stream.

If it is, indeed, a string it passes it to the PdfstringParser in order to apply the correct unicode mappings and return a utf-8 string.

PdfReferenceValue

As its name show this class is simply a reference to the value of another object.

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.