Skip to content

Commit

Permalink
update readme and fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
ading2210 committed Feb 2, 2025
1 parent fd76d31 commit 9d6ff29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Try it here: [linux.pdf](https://linux.doompdf.dev/linux.pdf)

https://github.com/user-attachments/assets/7e992dd1-41a5-4d32-87cc-878b395e3d92

See also: [DoomPDF](https://github.com/ading2210/doompdf)

## Explanation

This works in a very similar way to my previous [DoomPDF](https://github.com/ading2210/doompdf) project.
Expand All @@ -18,7 +20,7 @@ C code can be compiled to run within a PDF using an old version of Emscripten th

The largest problem here is with the emulator's performance. For example, the Linux kernel takes about 30-60 seconds to boot up within the PDF, which over 100x slower than normal. Unfortunately, there's no way to fix this, since the version of V8 that Chrome's PDF engine uses has its [JIT compiler disabled](https://source.chromium.org/chromium/_/pdfium/pdfium/+/012fe571c9fe430da68dbcd2f5ba21758db0ae15:fpdfsdk/fpdf_view.cpp;l=1211-1214;drc=b69783fd189976dd4625c7dcd9c07921b94d4a3c;bpv=0;bpt=0), destroying its performance.

For the root filesystem, there are both 64 and 32 bit versions possible. The default is a 32 bit buildroot system (which was prebuilt and taken from the original TinyEMU examples), and also a 64 bit Alpine Linux system. The 64 bit emulator is about as twice slow however, so it's normally not used.
For the root filesystem, there are both 64 and 32 bit versions possible. The default is a 32 bit buildroot system (which was prebuilt and taken from the original TinyEMU examples), and also a 64 bit Alpine Linux system. The 64 bit emulator is about twice as slow however, so it's normally not used.

## Build Instructions

Expand Down
4 changes: 3 additions & 1 deletion gen_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def create_keys_row(keys, x, y, width, height, gap):
new_x = x + i * (width + gap)
button = create_button(name, new_x, y, width, height, key.upper())
button.AA = PdfDict()
if key == "'":
key = "\\'"
button.AA.D = create_script(f"button_down('{key}')")
button.AA.U = create_script(f"button_up('{key}')")
buttons.append(button)
Expand Down Expand Up @@ -134,7 +136,7 @@ def create_keys_row(keys, x, y, width, height, gap):
dict(key="Enter", x=542, y=108, width=58, height=16),

dict(key="Shift", x=220, y=88, width=44, height=16, toggle=True),
dict(key="Shift", x=530, y=88, width=70, height=16),
dict(key="RShift", x=530, y=88, width=70, height=16),

dict(key="Ctrl", x=220, y=68, width=36, height=16, toggle=True),
dict(key="Alt", x=260, y=68, width=36, height=16, toggle=True),
Expand Down

0 comments on commit 9d6ff29

Please sign in to comment.