Skip to content

Commit 8f99d59

Browse files
committed
v1.0: bugfix and upgrade to gs v10.
1 parent 2dfe3f2 commit 8f99d59

File tree

17 files changed

+367
-8682
lines changed

17 files changed

+367
-8682
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*.zip
22
*.crx
33

4-
extension/scr1.png
5-
extension/scr2.png
4+
ghostscript-*
5+
test
6+
extension
7+
8+
.DS_Store

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Changelog
2+
3+
## v1.0 - June 2025
4+
5+
### Updates
6+
7+
* Fixed a bug that prevented gzips from being unzipped correctly.
8+
* Upgrading to Ghostscript 10.
9+
* Added a script for compiling from ghostscript source.
10+
* Cleaning up git repo.
11+
12+
## v0.31 - May 2023
13+
14+
### Updates
15+
* Making manifest file compatible with Chrome's v3 standard.
16+
17+
## v0.21 - May 2020
18+
19+
### Updates
20+
* Fixed manifest file.
21+
22+
## v0.2 - August 2019
23+
24+
### Updates
25+
26+
* Large files now supported.
27+
* PDF files can now be saved.
28+
* Improved URL and title display.

README.md

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,32 @@
1-
PS-WASM: Rendering PostScript in browsers using GhostScript.
1+
# PS-WASM: Rendering PostScript in browsers using Ghostscript.
22

3-
This little wrapper allows GhostScript to be run with WebAssembly in browser,
3+
This little wrapper allows Ghostscript to be run with WebAssembly in browser,
44
and thus allows PostScript files to be opened with modern browsers directly.
55

6-
Currently only Chrome is supported.
6+
## Usage
77

8-
------
8+
1. Set up the EMScripten environmen following [this tutorial](https://webassembly.org/getting-started/developers-guide/).
99

10-
August 2019: v0.2 updates:
10+
2. If compiling from latest git repo: set up `git`, `autoconf` and `automake`.
1111

12-
* Large files are now supported.
13-
* PDF files can now be saved.
14-
* Improved URL and title display.
12+
3. Run `./compile.sh` with the following parameters:
1513

16-
------
14+
```
15+
./compile.sh (--version=[latest|version.number]) (--browser=[chrome]) (--debug) (--skip_compile)
16+
```
17+
where the parameters are as follows:
18+
* `--version`: specify `latest` to compile from latest [git source](https://github.com/ArtifexSoftware/ghostpdl), or a specific version number such as `10.05.0`.
19+
* Note: some versions (such as `10.05.1`) do compile but have bugs that prevent the program from running on certain files. Commit `dedddcb` of the git repo is the version used for the web store version of `v0.4` of this extension.
20+
* `--browser`: specify the target browser. Currently only `chrome` is supported.
21+
* `--debug`: compile the debug version, which prints a lot more info to the console.
22+
* `--skip_compile`: tell the script to assume the `.wasm` and `.js` files are already there and just pack the plugin. Useful for debugging.
1723

18-
Note on cross-compilation:
24+
4. The plugin is then located at `extension/(browser)/ps-wasm`.
1925

20-
Cross-compiling ghostscript was the nontrivial part of this project.
26+
## License
2127

22-
After obtaining the source code from the [source repository](https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs926/ghostscript-9.26.tar.gz), one needs to copy files in the "code_patch" folder into their respective places.
28+
Ocha 2025. Code licensed under AGPLv3.
2329

24-
One also needs to have the EMScripten environment set up; see [here](https://webassembly.org/getting-started/developers-guide/) for a tutorial.
25-
26-
Then one can run the following command for setting up configure:
27-
28-
`emconfigure ./configure --disable-threading --disable-cups --disable-dbus --disable-gtk --with-drivers=PS CC=emcc CCAUX=gcc --with-arch_h=~/ghostscript-9.26/arch/wasm.h`
29-
30-
Followed by the following "make" command:
31-
32-
`emmake make XE=".html" GS_LDFLAGS="-s ALLOW_MEMORY_GROWTH=1 -s EXIT_RUNTIME=1"`
33-
34-
And one needs to copy everything from the "bin" folder to the extension folder.
35-
36-
To include debugging information, instead use the following command, and look for results in "debugbin" (make sure you also copy the map files into the extension folder):
37-
38-
`emmake make debug XE=".html" GS_LDFLAGS="-s ALLOW_MEMORY_GROWTH=1 -s EXIT_RUNTIME=1 -s ASSERTIONS=2 -g4"`
39-
40-
------
41-
42-
Ocha 2019. Code licensed under AGPLv3.
43-
44-
GhostScript is released by Artifex under AGPLv3 and can be found [here](https://www.ghostscript.com/).
30+
Ghostscript is released by Artifex under AGPLv3 and can be found [here](https://www.ghostscript.com/).
4531

4632
Pako is written by Andrey Tupitsin and Vitaly Puzrin and can found [here](https://github.com/nodeca/pako).

0 commit comments

Comments
 (0)