Angular (21+) Integration
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Documentazione
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Stack tecnologico
- angular, typescript, vite, wasm
- Ambito
- build-system, documentation
Direzione di ricerca
The issue is an integration report rather than a scoped task. Start from the @embedpdf/angular package and the docs describing the epdf-viewer/epdf-stage component hierarchy, then inspect createEngine()'s worker and assetsUrl handling; the reporter serves embedpdf.wasm, embedpdf.browser.js and encoder-worker.js from /public/embedpdf/ and builds a Blob worker URL. Confirm with the maintainer whether the outcome is clearer docs (defining 'wrapped'/'subtree') or a Vite fix so worker and wasm resolve without hand-copying.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi Bob,
First of all let me congratulate you on your sterling work.
I appreciate that you are still working on Version 3 of the Embedded PDF Viewer in general and the Angular version in particular. I have, however, successfully incorporated the '@embedpdf/angular' library into an Angular (22.1) web app. I thought it would be useful to share some of my experiences in doing so.
-
Firstly, I confess to rushing into it as usual, without reading the documentation in detail. Mea culpa. It took me a while to fully appreciate the the need to structure the UI as a component hierarchy and that the parent component that includes must indeed be separate from the child component that includes . Without this separation, of course, Angular fails to locate the injected Engine and Kernel Host. Compared to most packages you error messages are excellent, but it would help to be more specific about he terms 'wrapped' and 'subtree'.
-
Secondly, and this is a genuine issue, the new Vite bundler does not handle the Web Worker and the location of the Web Assembly 'embedpdf.wasm' as you intend it to. With vital assistance from Claude (Opus 5), I did manage to find a workaround. I can provide you with a full explanation if you want. To summarize, here are the steps I took:
A. Rewrite createEngine(). Here as a method on an injectable service class:
private workerUrl?: string;
public createEngine(): Engine
{
// The Web Worker allocates when the engine boots not at construction.
this.workerUrl ??= URL.createObjectURL(new Blob([workerSource], { type: 'text/javascript' }));
return createLocalEngineWithWorker(
{
worker: (): Worker => new Worker(this.workerUrl!, { type: 'module' }),
assetsUrl: '/embedpdf/',
});
}
B. Copy the following files to /public/embedpdf/
embedpdf.browser.js
embedpdf.node.cjs
embedpdf.node.js
embedpdf.wasm
encoder-worker.js
This has certainly done the trick (see attached screenshot). I will be incorporating EmbedPdf (@embedpdf/angular and @embedpdf/engine) into my SaaS Angular client app as the PDF Viewer and, during development, using the viewer to test and refine PdfPig's layout analysis.
Don't hesitate to get back to me if you have any questions, and reach out if you need any help with the Angular integration.
Regards,
Nico Aspinall
- Lingua principale
- TypeScript
- Stelle
- 4.5k
- Fork
- 317
- Merge medio
- 10h 16m
- PR unite (30g)
- 174
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di embedpdf/embed-pdf-viewer
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
embedpdf/embed-pdf-viewer#1098 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
embedpdf/embed-pdf-viewer#921 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
embedpdf/embed-pdf-viewer#889 ·
I maintainer di solito rispondono entro 1 giorno
-
[v2] TaskQueue: equal-priority tasks can run out of order when a randomUUID id starts with digitsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
embedpdf/embed-pdf-viewer#874 ·
I maintainer di solito rispondono entro 1 giorno
-
Free text stays scrolled to the caret after editing endsForse già presa @chahore l’ha presa 36 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
embedpdf/embed-pdf-viewer#861 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di embedpdf/embed-pdf-viewer
Issue simili
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
lingdojo/kana-dojo#34223 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
mastra-ai/mastra#30587 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:web p2 product:business triage:active type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cuadrao-ai/argus#2228 ·
I maintainer di solito rispondono entro 1 giorno
-
.Needs Triage .Team/Metabot Priority:P3 Type:Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
metabase/metabase#87252 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
NuGet registry builds every URL from ROOT_URL, ignoring the host the client usedForse già presa @gritse l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno