Skip to content

레거시 DOC, XLS, PPT를 OOXML로 변환

Office Oxide는 Word 97–2003(.doc), Excel 97–2003(.xls), PowerPoint 97–2003(.ppt)을 읽고 그리고 그에 대응하는 모던 OOXML을 쓸 수 있는 유일한 Rust/Python 라이브러리입니다 — JVM(Apache Tika), 외부 변환기(LibreOffice headless), 상용 라이선스(Aspose) 없이.

save_as가 한 번의 호출로 변환을 합니다. 레거시 파일을 열고 모던 확장자로 저장하세요; Office Oxide가 IR을 통해 새 OOXML 컨테이너로 씁니다.

한 줄로

Rust

use office_oxide::Document;

Document::open("old.doc")?.save_as("modern.docx")?;
Document::open("old.xls")?.save_as("modern.xlsx")?;
Document::open("old.ppt")?.save_as("modern.pptx")?;

Python

from office_oxide import Document

with Document.open("old.doc") as doc:
    doc.save_as("modern.docx")

with Document.open("old.xls") as doc:
    doc.save_as("modern.xlsx")

with Document.open("old.ppt") as doc:
    doc.save_as("modern.pptx")

JavaScript

import { Document } from 'office-oxide';

using doc = Document.open('old.xls');
doc.saveAs('modern.xlsx');

Go

doc, _ := officeoxide.Open("old.xls")
defer doc.Close()
doc.SaveAs("modern.xlsx")

C#

using var doc = Document.Open("old.xls");
doc.SaveAs("modern.xlsx");

일괄 마이그레이션

코퍼스를 한 줄로 마이그레이션.

Python

from pathlib import Path
from office_oxide import Document

for src in Path("legacy").rglob("*"):
    if src.suffix.lower() in {".doc", ".xls", ".ppt"}:
        new_ext = {".doc": ".docx", ".xls": ".xlsx", ".ppt": ".pptx"}[src.suffix.lower()]
        dst = Path("modern") / src.relative_to("legacy").with_suffix(new_ext)
        dst.parent.mkdir(parents=True, exist_ok=True)
        with Document.open(src) as doc:
            doc.save_as(dst)
        print(f"{src}{dst}")

Rust

use office_oxide::Document;
use std::path::Path;

fn migrate(src: &Path, dst: &Path) -> office_oxide::Result<()> {
    Document::open(src)?.save_as(dst)?;
    Ok(())
}

대규모 코퍼스를 병렬로 마이그레이션하려면 루프를 rayon으로 감싸세요.

Shell — CLI 사용

find legacy/ -iname '*.doc' | parallel \
  'office-oxide convert {} modern/{/.}.docx'

find legacy/ -iname '*.xls' | parallel \
  'office-oxide convert {} modern/{/.}.xlsx'

find legacy/ -iname '*.ppt' | parallel \
  'office-oxide convert {} modern/{/.}.pptx'

라운드트립에서 살아남는 것

Office Oxide는 콘텐츠의 형태 — 단락, 표, 셀, 슬라이드, 목록, 제목 — 과 그 안의 값을 보존합니다. 몇몇 범주는 레거시 형식이 IR이 모델링하지 않는 독자 구조에 인코딩하기 때문에 넘어오지 않습니다:

범주 보존 비고
단락 텍스트 bold/italic/underline run 포함
목록 순서 + 비순서
셀, 행 순서, 헤더 행
XLSX 셀 값(string, number, bool)
시트 이름
슬라이드 제목 + 본문
하이퍼링크
이미지 부분 DOC/PPT는 인라인 이미지 보존; XLS 이미지 앵커는 누락
코멘트 / 리비전 Tracked changes는 평탄화
수식(XLS) 값만 캐시된 수식 결과는 살아남고, 수식 표현식은 라운드트립 안 됨
WordArt, SmartArt, 차트 필요하면 대상 형식에서 다시 렌더
암호화 레거시 파일을 먼저 복호화(예: LibreOffice)

대부분의 LLM, 인덱싱, 아카이빙 사례에서 중요한 건 콘텐츠 수준의 충실도입니다 — 그리고 Office Oxide는 밀리초 안에 완전히 편집 가능한 DOCX/XLSX/PPTX를 돌려줍니다.

성능

파일당 변환은 텍스트 추출과 같은 차수입니다. 일반적인 Word 97 .doc에서는 end-to-end로 단자리 밀리초를 기대하세요.

더 보기