-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup guide for nextjs? #7
Comments
I generated a repo using |
holy fuck, that works. also thanks a fuckton for building this library, and even replying to my query. <3 i got it workin on my next app, but im having few doubts. await scribe.init({ ocr: true, font: true });
scribe.opt.displayMode = "invis";
await scribe.importFiles(
files,
);
await scribe.recognize({
mode: "quality",
langs: ["eng"],
modeAdv: "combined",
vanillaMode: true,
combineMode: "data",
});
const data = await scribe.exportData("pdf");
const blob = new Blob([data], { type: "application/pdf" });
const file = new File([blob], "test.pdf", {
type: "application/pdf",
});
return [file]; or am i doing something wrong, the docs seems a bit hard to understand. regarding the options i passed in for each, its just something that worked for me when i was playing around with https://scribeocr.com . am i doing something wrong? |
Yes, this code looks fine at a glance. Several of the arguments specified won't do anything (e.g.
The scribeocr.com website uses scribe.js directly as a submodule, so there should not be any difference in performance for the same document. Additionally, the runtime observed in the example Next.js repo I linked to above seemed to be roughly comparable to the scribeocr.com site, so I don't think using Next.js should change things. Therefore, if you are noticing large disparities, the troubleshooting steps I would take are below.
|
used the thanks. |
I checked that the Next.js demo I linked has runtime similar to scribeocr.com, and it looks like it does, so I think any disparity is caused by something specific to your project.
The scribeocr.com website is simply one user of the scribe.js package--everything it does can be implemented by other users. While not all of the features it uses are fully documented, you can check that codebase to see how specific features work. In this case the relevant code for incrementing a progress bar after each page is here. |
You're right, that improved a lot in prod-setting, and getting super-close results. Thanks for building this <3 |
Hi there! I'm trying this with nextjs app dir, when setting the next config to set process as undefined I am no longer able to get environment variables, for example, from a middleware.
Is there any other solution? |
hey, anyone managed to get it working in nextjs pages dir?
heres what ive tried:
imported as:
i see error saying:
i updated my next.config to pass custom webpack configs similar to the one in the example app, but it doesnt work.
also tried passing it in. also tried nextjs
serverComponentsExternalPackages
in next.config, which doesnt work either.tesseract seems to have a
createWorker
method, which is used in the client-side, maybe is it possible to expose something similar?.any help is appreciated thanks.
The text was updated successfully, but these errors were encountered: