tcr / scissors

PDF manipulation in Node.js! Split, join, crop, read, extract, boil, mash, stick them in a stew.
Apache License 2.0
285 stars 45 forks source link

Added property stream #12

Closed dennisschaaf closed 7 years ago

dennisschaaf commented 8 years ago

Added a property stream function to extract properties from the PDF file. This makes it possible to find out properties such as the number of pages.

scissors(path).propertyStream().on('data', function (d) {
    if (d.event === 'NumberOfPages') {
       console.log('page count ', d.value)
    }
})
dennisschaaf commented 7 years ago

Thanks for reviewing!

I dont think I found a comprehensive list of possible properties when I wrote the PR.

Dennis On Sun 14. May 2017 at 22:19, Christian Boulanger notifications@github.com wrote:

@cboulanger approved this pull request.

Looks good to me. Do you have a link to a list of possible properties that can be retrieved this way?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tcr/scissors/pull/12#pullrequestreview-38001050, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHGnhq3HTnC7Ocykty3oIVy9AUiBhV1ks5r5w1XgaJpZM4G7_v6 .

-- Dennis Schaaf Director

dennis@plantdemand.com +1 (408) 786-5358

PlantDemand.com byMeSch Software UG (Haftungsbeschränkt) Schinkel Str 39 - DE-80805 München

cboulanger commented 7 years ago

It's not necessary, I was just curious!