Add `scale` option to toPdf({ vectorInk: true }) for preview-size exports
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- api
Direzione di ricerca
Start with ToPdfOptions and the vector-ink path, then compare its handling with the raster toImage({ scale }) path at src/conversion.ts:197. Add coverage for scale, upscale, page dimensions, searchable output, and vector coordinates, then run the relevant tests and add the scale: 2 versus scale: 1 measurement to tests/pdf-vector.bench.ts using the sticker, caligraphy, and turkish fixtures.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up to #101 (see plans/profile-vector-pdf.md).
Context
Profiling #101 showed toPdf({ vectorInk: true }) is not meaningfully slower than the raster path — the dominant cost is the background PNG embed + pdfDoc.save(), both shared with raster; the vector-ink-specific drawSvgPath cost is only 27–148 ms per fixture. So no optimization of the default path is warranted for v0.6.0.
This issue tracks the one piece of #101's step 3 that's a user-facing feature, not an optimization: a scale option for vector-ink PDF previews.
Proposal
ToPdfOptions already has upscale. Add a scale option (positive integer, default 1) that runs the same decodeAtScale / coordinate-shrink path the raster toImage({ scale }) option already uses (src/conversion.ts:197), so a vector-ink preview export of a dense note produces both smaller background geometry and smaller vector geometry — useful for thumbnails, web previews, and anything where a full-resolution vector PDF is overkill.
toPdf(note, { vectorInk: true, scale: 2 }); // half-resolution vector + background
Why it's worth it even though the default path is fine
#101's point 4 names this explicitly. It's a knob, not a default change, so it carries none of the risk the step-3 optimizations (contour simplification, worker parallelism) would — it just lets a caller trade vector fidelity for size when they don't need the crispness vectorInk exists for.
Acceptance criteria
toPdf(note, { vectorInk: true, scale: n })produces a valid, searchable PDF whose page dimensions and vector coordinates are1/nof the default, for integern >= 1.- Output bytes scale down meaningfully with
scaleon the dense fixtures (sticker / caligraphy / turkish from #101). - Combines with
upscalethe same way the raster path does. - New test + a bench entry in
tests/pdf-vector.bench.tsshowing the size/time reduction atscale: 2vsscale: 1.
Non-goals
- Not changing default behavior (
scaledefaults to 1). - Not contour simplification (separate, not warranted per #101 profile).
- Lingua principale
- TypeScript
- Stelle
- 42
- Fork
- 9
- Merge medio
- 30m
- PR unite (30g)
- 2
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 philips/supernote-typescript
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
philips/supernote-typescript#122 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
philips/supernote-typescript#100 ·
I maintainer di solito rispondono entro 1 giorno
-
Add automated visual diff for vectorInk PDF outputForse già presa @philips-clanker l’ha presa 69 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
philips/supernote-typescript#99 ·
I maintainer di solito rispondono entro 1 giorno
-
Characterize the stroke-record tail (unk_17, unk_22, Section3/Section4) and its four length variantsAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
philips/supernote-typescript#74 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
philips/supernote-typescript#73 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di philips/supernote-typescript
Issue simili
-
Add: ON Phim Viet SDApertacheck:passed streams:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Subagent progress token count ignores usage.iterations and swings on multi-iteration responsesApertaarea:agents area:cost bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
anthropics/claude-code#105375 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
galaxyproject/loom#616 ·
I maintainer di solito rispondono entro 1 giorno
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
redhat-developer/rhdh-plugin-export-overlays#4580 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno