Published
Edited
Sep 9, 2020
Insert cell
Insert cell
pdfJS = require('pdfjs-dist@2.0.943').then(pdf => {
pdf.GlobalWorkerOptions.workerSrc = 'https://cdn.jsdelivr.net/npm/pdfjs-dist@2.0.943/build/pdf.worker.js';
return pdf;
})
Insert cell
url = 'https://davidb-data.herokuapp.com/https://github.com/bumbeishvili/dataviz-style-guide/raw/master/Sunlight-StyleGuide-DataViz.pdf'
Insert cell
pdfDataLoaded = fetch(url).then(d=>d.arrayBuffer())
Insert cell
doc = pdfJS.getDocument({data:pdfDataLoaded})
Insert cell
data = (await doc.getPage(1)).getTextContent()
Insert cell
data.items.map(d=>d.str).join('\n')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more