更新
This commit is contained in:
13
.obsidian/plugins/obsidian-extract-pdf-0.0.7/patches/@opendocsg+pdf2md+0.1.16 2.patch
vendored
Normal file
13
.obsidian/plugins/obsidian-extract-pdf-0.0.7/patches/@opendocsg+pdf2md+0.1.16 2.patch
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/node_modules/@opendocsg/pdf2md/lib/util/pdf.js b/node_modules/@opendocsg/pdf2md/lib/util/pdf.js
|
||||
index 0ed1512..e491a0b 100644
|
||||
--- a/node_modules/@opendocsg/pdf2md/lib/util/pdf.js
|
||||
+++ b/node_modules/@opendocsg/pdf2md/lib/util/pdf.js
|
||||
@@ -42,7 +42,7 @@ exports.parse = async function parse (docOptions, callbacks) {
|
||||
}
|
||||
}
|
||||
|
||||
- let pageNum = firstPage.pageNum
|
||||
+ let pageNum = 0; // firstPage.pageNum
|
||||
for (let j = 1; j <= pdfDocument.numPages; j++) {
|
||||
const page = await pdfDocument.getPage(j)
|
||||
|
||||
43
.obsidian/plugins/obsidian-extract-pdf-0.0.7/patches/@opendocsg+pdf2md+0.1.16.patch
vendored
Normal file
43
.obsidian/plugins/obsidian-extract-pdf-0.0.7/patches/@opendocsg+pdf2md+0.1.16.patch
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
diff --git a/node_modules/@opendocsg/pdf2md/lib/util/pdf.js b/node_modules/@opendocsg/pdf2md/lib/util/pdf.js
|
||||
index 0ed1512..2cf8408 100644
|
||||
--- a/node_modules/@opendocsg/pdf2md/lib/util/pdf.js
|
||||
+++ b/node_modules/@opendocsg/pdf2md/lib/util/pdf.js
|
||||
@@ -5,7 +5,8 @@ const Page = require('../models/Page')
|
||||
|
||||
const NO_OP = () => {}
|
||||
|
||||
-exports.parse = async function parse (docOptions, callbacks) {
|
||||
+exports.parse = async function parse (pdfDocument, callbacks) {
|
||||
+
|
||||
const { metadataParsed, pageParsed, fontParsed, documentParsed } = {
|
||||
metadataParsed: NO_OP,
|
||||
pageParsed: NO_OP,
|
||||
@@ -13,10 +14,9 @@ exports.parse = async function parse (docOptions, callbacks) {
|
||||
documentParsed: NO_OP,
|
||||
...(callbacks || {}),
|
||||
}
|
||||
- const pdfDocument = await pdfjs.getDocument(docOptions).promise
|
||||
+
|
||||
const metadata = await pdfDocument.getMetadata()
|
||||
metadataParsed(metadata)
|
||||
-
|
||||
const pages = [...Array(pdfDocument.numPages).keys()].map(
|
||||
index => new Page({ index })
|
||||
)
|
||||
@@ -42,7 +42,7 @@ exports.parse = async function parse (docOptions, callbacks) {
|
||||
}
|
||||
}
|
||||
|
||||
- let pageNum = firstPage.pageNum
|
||||
+ let pageNum = 0 // firstPage.pageNum
|
||||
for (let j = 1; j <= pdfDocument.numPages; j++) {
|
||||
const page = await pdfDocument.getPage(j)
|
||||
|
||||
@@ -90,6 +90,7 @@ exports.parse = async function parse (docOptions, callbacks) {
|
||||
fontParsed(fonts)
|
||||
}
|
||||
}
|
||||
+
|
||||
}
|
||||
return {
|
||||
fonts,
|
||||
Reference in New Issue
Block a user