Skip to content

Commit

Permalink
Merge pull request #84 from paulocoutinhox/pdfium-5609
Browse files Browse the repository at this point in the history
update pdfium to 5609
  • Loading branch information
paulocoutinhox authored Feb 21, 2023
2 parents 33a3dc4 + 240a588 commit 8509e05
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docker/android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ WORKDIR /build
RUN gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git
RUN gclient sync
WORKDIR /build/pdfium
RUN git checkout 48c36d4bcd42d780011dbea76409261c84956469
RUN git checkout bad2c6c8f9549ac9bb0ec4e9e18e7cd2fc9f8d53

RUN ln -s /usr/bin/python3 /usr/bin/python
RUN ln -s /usr/bin/pip3 /usr/bin/pip
Expand Down
6 changes: 3 additions & 3 deletions docker/wasm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ WORKDIR /build
RUN gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git
RUN gclient sync
WORKDIR /build/pdfium
RUN git checkout 48c36d4bcd42d780011dbea76409261c84956469
RUN git checkout bad2c6c8f9549ac9bb0ec4e9e18e7cd2fc9f8d53

RUN ln -s /usr/bin/python3 /usr/bin/python
RUN ln -s /usr/bin/pip3 /usr/bin/pip
Expand All @@ -60,8 +60,8 @@ RUN pip3 install setuptools docopt pygemstones
RUN mkdir /emsdk
WORKDIR /emsdk
RUN git clone https://github.com/emscripten-core/emsdk.git .
RUN ./emsdk install 3.1.31
RUN ./emsdk activate 3.1.31
RUN ./emsdk install 3.1.32
RUN ./emsdk activate 3.1.32
ENV PATH="${PATH}:/emsdk:/emsdk/upstream/emscripten"

# cache system libraries
Expand Down
12 changes: 6 additions & 6 deletions extras/wasm/template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@

getRender(i = 0, w, h) {
const flag = FPDF.REVERSE_BYTE_ORDER | FPDF.ANNOT;
const heap = Module._malloc(w * h * C);
const heap = Module.asm.malloc(w * h * C);

for (let i = 0; i < w * h * C; i++) {
Module.HEAPU8[heap + i] = 0;
Expand All @@ -170,7 +170,7 @@
pageRenderData.push(Module.HEAPU8[pageRenderPtr + v]);
}

Module._free(pageRenderPtr);
Module.asm.free(pageRenderPtr);

return pageRenderData;
}
Expand Down Expand Up @@ -255,7 +255,7 @@
page.render();

if (index === doc.pages.length - 1) {
Module._free(wasmBuffer);
Module.asm.free(wasmBuffer);

FPDF.CloseDocument(wasm);
FPDF.DestroyLibrary();
Expand Down Expand Up @@ -375,7 +375,7 @@
// load document to memory
console.log('Loading data to buffer...');

let wasmBuffer = Module._malloc(fileSize);
let wasmBuffer = Module.asm.malloc(fileSize);
Module.HEAPU8.set(fileByteArray, wasmBuffer);

// create document
Expand Down Expand Up @@ -852,8 +852,8 @@
case Float32Array: E = Module.HEAPF32; break;
case Float64Array: E = Module.HEAPF64; break;
}
const Z = J.BYTES_PER_ELEMENT; const m = Module._malloc(s * Z);
const a = Array(1 + s); a[0] = ({ s, J, Z, E, m, free: () => Module._free(m) });
const Z = J.BYTES_PER_ELEMENT; const m = Module.asm.malloc(s * Z);
const a = Array(1 + s); a[0] = ({ s, J, Z, E, m, free: () => Module.asm.free(m) });
for (let i = 0; i < s; i++) a[i + 1] = ({ p: m + (i * Z), get v() { return E[m / Z + i]; } });
return a;
};
Expand Down
8 changes: 4 additions & 4 deletions modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
task = ""

# pdfium
pdfium_git_branch = "5584"
pdfium_git_commit = "48c36d4bcd42d780011dbea76409261c84956469"
# ^ ref: https://pdfium.googlesource.com/pdfium/+/refs/heads/chromium/5584
pdfium_git_branch = "5609"
pdfium_git_commit = "bad2c6c8f9549ac9bb0ec4e9e18e7cd2fc9f8d53"
# ^ ref: https://pdfium.googlesource.com/pdfium/+/refs/heads/chromium/5609
# OBS 1: don't forget change in android docker file (docker/android/Dockerfile)
# OBS 2: don't forget change in wasm docker file (docker/wasm/Dockerfile)

# emsdk
emsdk_version = "3.1.31"
emsdk_version = "3.1.32"
# OBS 1: don't forget change in wasm docker file (docker/wasm/Dockerfile)

# macos
Expand Down

0 comments on commit 8509e05

Please sign in to comment.