u
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import { pdfToText, splitPdfPages } from 'pdfconvert-wasm';
|
||||
|
||||
export async function extractPdfText(pdfSource, options = { layout: true }) {
|
||||
const { pdfToText } = await import('pdfconvert-wasm');
|
||||
return pdfToText(pdfSource, options);
|
||||
}
|
||||
|
||||
export { pdfToText, splitPdfPages };
|
||||
export async function splitPdfPages(pdfSource) {
|
||||
const { splitPdfPages: split } = await import('pdfconvert-wasm');
|
||||
return split(pdfSource);
|
||||
}
|
||||
|
||||
export async function pdfToText(pdfSource, options) {
|
||||
const { pdfToText: toText } = await import('pdfconvert-wasm');
|
||||
return toText(pdfSource, options);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { pdfToPng } from 'pdfconvert-wasm';
|
||||
|
||||
export async function generatePdfThumbnail(pdfSource, targetWidth = 200) {
|
||||
const { pdfToPng } = await import('pdfconvert-wasm');
|
||||
const images = await pdfToPng(pdfSource, {
|
||||
firstPage: 1,
|
||||
singleFile: true,
|
||||
|
||||
Reference in New Issue
Block a user