This repository packages a real-world PDF conversion workflow for turning a traditional Chinese PDF into simplified Chinese while preserving page size, images, selectable text, and overall layout as much as possible.
pdfs/CZ_original_traditional.pdf: the original traditional Chinese PDFpdfs/CZ_simplified_preserved_layout.pdf: the simplified Chinese PDF with preserved layout and replaced covercover/replacement_cover.png: the cover image used for the final cover replacement stepskill/: the Codex skill with the scripts, references, and prompt metadata needed to reuse the workflow
Inside skill/:
SKILL.md: trigger guidance and workflow instructionsscripts/install_deps.sh: create a local virtualenv and install dependenciesscripts/convert_pdf_t2s_preserve_layout.py: convert text-layer PDF pages from traditional to simplified Chinesescripts/replace_pdf_cover.py: replace an image-only cover page without disturbing the rest of the PDFscripts/extract_ttc_font.py: extract a usable font face from a.ttccollection such asSongti.ttcreferences/workflow.md: troubleshooting notes and verification steps
cd skill
./scripts/install_deps.sh
source .venv/bin/activate
python scripts/convert_pdf_t2s_preserve_layout.py \
../pdfs/CZ_original_traditional.pdf \
../pdfs/CZ_simplified_preserved_layout_regenerated.pdf \
--font-style lightIf the cover page is image-only, replace it separately:
python scripts/replace_pdf_cover.py \
../pdfs/CZ_simplified_preserved_layout_regenerated.pdf \
../pdfs/CZ_simplified_preserved_layout_with_new_cover.pdf \
../cover/replacement_cover.pngCopy the skill/ folder into your Codex skills directory and keep the folder name as pdf-trad-to-simp-preserve-layout.
Example:
mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
cp -R skill "${CODEX_HOME:-$HOME/.codex}/skills/pdf-trad-to-simp-preserve-layout"The code and documentation in this repository are released under the MIT License.
The included PDF files and cover image are example materials distributed in this repository based on the uploader's stated authorization. They are not automatically relicensed under MIT unless you independently have rights to reuse them.