Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: b9da8ebedd
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (26 sloc) 0.771 kB
###
PDFObjectStore - stores the object heirarchy for the PDF document
By Devon Govett
###
PDFReference = require './reference'
class PDFObjectStore
constructor: ->
@objects = {}
@length = 0
@root = @ref
Type: 'Catalog'
Pages: @ref
Type: 'Pages'
Count: 0
Kids: []
@pages = @root.data['Pages']
ref: (data) ->
@push ++@length, data
push: (id, data) ->
ref = new PDFReference(id, data)
@objects[id] = ref
return ref
addPage: (page) ->
@pages.data['Kids'].push(page.dictionary)
@pages.data['Count']++
module.exports = PDFObjectStore
Jump to Line
Something went wrong with that request. Please try again.