mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2024-11-21 23:33:31 +01:00
Little working pdfs integration
This commit is contained in:
parent
d20347f70f
commit
a4a3d08222
@ -19,6 +19,7 @@
|
||||
"url": "https://github.com/jzillmann/pdf-to-markdown"
|
||||
},
|
||||
"dependencies": {
|
||||
"pdfjs-dist": "^1.6.317",
|
||||
"vue": "^2.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -14,6 +14,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pdfjs from 'pdfjs-dist';
|
||||
export default {
|
||||
props : {
|
||||
multiple : {
|
||||
@ -58,6 +59,18 @@ export default {
|
||||
var files = e.target.files || e.dataTransfer.files;
|
||||
console.debug(files);
|
||||
if (!files.length) return;
|
||||
|
||||
var reader = new FileReader();
|
||||
reader.onload = (evt) => {
|
||||
console.debug("Loaded");
|
||||
var buffer = evt.target.result;
|
||||
PDFJS.getDocument(buffer).then(function (pdfDocument) {
|
||||
console.log('Number of pages: ' + pdfDocument.numPages);
|
||||
});
|
||||
};
|
||||
reader.readAsDataURL(files[0]);
|
||||
|
||||
|
||||
this.createImage(files[0]);
|
||||
},
|
||||
createImage(file) {
|
||||
|
Loading…
Reference in New Issue
Block a user