overleaf/services/clsi/scripts/demo-pdfjs-Xref.js
Jakob Ackermann 97624d0c6c Merge pull request #8847 from overleaf/jpa-emit-start-of-xref-table
[clsi] try to emit the start of the xref table

GitOrigin-RevId: 6d8348a349572cc997ac5924664428228c00fed1
2022-07-18 08:04:17 +00:00

12 lines
343 B
JavaScript

const fs = require('fs')
const { parseXrefTable } = require('../app/lib/pdfjs/parseXrefTable')
const pdfPath = process.argv[2]
async function main() {
const size = (await fs.promises.stat(pdfPath)).size
const { xRefEntries } = await parseXrefTable(pdfPath, size)
console.log('Xref entries', xRefEntries)
}
main().catch(console.error)