Skip to content

superpilot69/pdf-trad-to-simp-preserve-layout-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Traditional-to-Simplified Chinese Layout-Preserve Kit

中文说明

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.

Included Files

  • pdfs/CZ_original_traditional.pdf: the original traditional Chinese PDF
  • pdfs/CZ_simplified_preserved_layout.pdf: the simplified Chinese PDF with preserved layout and replaced cover
  • cover/replacement_cover.png: the cover image used for the final cover replacement step
  • skill/: the Codex skill with the scripts, references, and prompt metadata needed to reuse the workflow

Skill Contents

Inside skill/:

  • SKILL.md: trigger guidance and workflow instructions
  • scripts/install_deps.sh: create a local virtualenv and install dependencies
  • scripts/convert_pdf_t2s_preserve_layout.py: convert text-layer PDF pages from traditional to simplified Chinese
  • scripts/replace_pdf_cover.py: replace an image-only cover page without disturbing the rest of the PDF
  • scripts/extract_ttc_font.py: extract a usable font face from a .ttc collection such as Songti.ttc
  • references/workflow.md: troubleshooting notes and verification steps

Quick Start

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 light

If 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.png

Install As A Codex Skill

Copy 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"

License Notes

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.

About

PDF traditional-to-simplified Chinese conversion kit with layout-preserving scripts, Codex skill, and example source/output PDFs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors