Added experimental ghostscript wasm conversion using zero config #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Experimental: Zero-Config Internal Rendering (WASM + SVG)
Summary
This draft PR introduces a major architectural shift to make the extension "Zero Config". It eliminates the requirement for users to manually install Ghostscript and Poppler by bundling a WebAssembly (WASM) version of Ghostscript and using
pdf.jsfor client-side rendering.Key Changes
child_processcalls to system binaries (ps2pdf,pdftocairo) with@jspawn/ghostscript-wasm.pdf.jsSVGGraphics.svg-pan-zoomfor infinite, crisp vector zooming without pixelation.postscript-preview.path.*settings as they are no longer needed.extension.tscommand handlers to avoid potential Marketplace flagging for long-running async activations.Benefits
Concerns & Open Questions
1. Extension Size (Critical)
The VSIX package size has increased from ~200KB to ~30MB.
ghostscript.wasmbinary and its snapshot.2. Startup Performance
Initializing the WASM environment might incur a slight startup penalty compared to spawning a native process, though subsequent operations should be fast.
3. Licensing
ghostscript-wasmis AGPL-licensed. While the extension logic is MIT, bundling AGPL components may have implications for distribution.Testing
.psand.epsfiles.svg-pan-zoomworks with validviewBoxscaling.