본문
hwp5proc: HWPv5 processor
Do various operations on HWPv5 files.
Usage:
hwp5proc [options] version <hwp5file>
hwp5proc [options] header <hwp5file>
hwp5proc [options] summaryinfo <hwp5file>
hwp5proc [options] ls [--vstreams | --ole] <hwp5file>
hwp5proc [options] cat [--vstreams | --ole] <hwp5file> <stream>
hwp5proc [options] unpack [--vstreams | --ole] <hwp5file> [<out-directory>]
hwp5proc [options] records [--simple | --json | --raw] [--treegroup=<treegroup> | --range=<range>] [<hwp5file> <record-stream>]
hwp5proc [options] models [--simple | --json] [--treegroup=<treegroup>] [<hwp5file> <record-stream> | -V <version>]
hwp5proc [options] find [--model=<model-name> | --tag=<hwptag>] [--incomplete] [--dump] <hwp5files>...
hwp5proc [options] xml [--embedbin] <hwp5file>
hwp5proc [options] rawunz
hwp5proc -h | --help
hwp5proc --version
Options:
-h --help Show this screen
--version Show version
--loglevel=<level> Set log level.
--logfile=<file> Set log file.
--vstreams Process with virtual streams (i.e. parsed/converted form
of real streams)
--ole Treat <hwpfile> as an OLE Compound File. As a result,
some streams will be presented as-is. (i.e. not decompressed)
--simple print records as simple tree
--json print records as json
--raw print records as is
--model=<model-name> filter with record model name
--tag=<hwptag> filter with record HWPTAG
--incomplete filter with incompletely parsed content
--dump dump record
-V HWPv5 format version [default: 5.0.0.0]
hwp5proc ls
List streams in the <hwp5file>.
Example: List without virtual streams:
$ hwp5proc ls sample/sample-5017.hwp
\x05HwpSummaryInformation
BinData/BIN0002.jpg
BinData/BIN0002.png
BinData/BIN0003.png
BodyText/Section0
DocInfo
DocOptions/_LinkDoc
FileHeader
PrvImage
PrvText
Scripts/DefaultJScript
Scripts/JScriptVersion
Example: List virtual streams too:
$ hwp5proc ls --vstreams sample/sample-5017.hwp
\x05HwpSummaryInformation
\x05HwpSummaryInformation.txt
BinData/BIN0002.jpg
BinData/BIN0002.png
BinData/BIN0003.png
BodyText/Section0
BodyText/Section0.models
BodyText/Section0.records
BodyText/Section0.xml
BodyText.xml
DocInfo
DocInfo.models
DocInfo.records
DocInfo.xml
DocOptions/_LinkDoc
FileHeader
FileHeader.txt
PrvImage
PrvText
PrvText.utf8
Scripts/DefaultJScript
Scripts/JScriptVersion
hwp5proc cat
Extract out the specified stream in the <hwp5file> to the standard output.
Example:
$ hwp5proc cat --vstreams samples/sample-5017.hwp FileHeader.txt
ccl: 0
cert_drm: 0
cert_encrypted: 0
cert_signature_extra: 0
cert_signed: 0
compressed: 1
distributable: 0
drm: 0
history: 0
password: 0
script: 0
signature: HWP Document File
version: 5.0.1.7
xmltemplate_storage: 0
$ hwp5proc cat samples/sample-5017.hwp BinData/BIN0002.jpg > BIN0002.jpg
hwp5proc unpack
Extract out streams in the specified <hwp5file> to a directory.
Example:
$ hwp5proc unpack samples/sample-5017.hwp
$ ls sample-5017
Example:
$ hwp5proc unpack --vstreams samples/sample-5017.hwp
$ cat sample-5017/PrvText.utf8
hwp5proc records
Print records in the specified <record-stream>.
Example:
$ hwp5proc records samples/sample-5017.hwp DocInfo
Example:
$ hwp5proc records samples/sample-5017.hwp DocInfo 0-2
Example:
$ hwp5proc records --raw samples/sample-5017.hwp DocInfo 0-2 > tmp.rec
$ hwp5proc records < tmp.rec
Example:
$ hwp5proc unpack samples/sample-5017.hwp
$ hwp5proc records < sample-5017/DocInfo
hwp5proc models
Print parsed binary models in the specified <record-stream>.
Example:
$ hwp5proc models --tree samples/sample-5017.hwp BodyText/Section0
Example:
$ hwp5proc models samples/sample-5017.hwp BodyText/Section0
Example:
$ hwp5proc cat samples/sample-5017.hwp BodyText/Section0 > Section0.bin
$ hwp5proc models < Section0.bin
$ hwp5proc models -V 5.0.1.7 < Section0.bin
hwp5proc find
Find models with specified predicates.
Example: Find paragraphs:
$ hwp5proc find --model=Paragraph samples/*.hwp
$ hwp5proc find --tag=HWPTAG_PARA_TEXT samples/*.hwp
$ hwp5proc find --tag=66 samples/*.hwp
Example: Find and dump records of HWPTAG_LIST_HEADER which is parsed incompletely:
$ hwp5proc find --tag=HWPTAG_LIST_HEADER --incomplete --dump samples/*.hwp
hwp5proc xml
Transform <hwp5file> into an XML.
Example:
$ hwp5proc xml samples/sample-5017.hwp > sample-5017.xml
$ xmllint --format sample-5017.xml
With --embedbin option, you can embed base64-encoded BinData/ files in the output XML.
Example:
$ hwp5proc xml --embedbin samples/sample-5017.hwp > sample-5017.xml
$ xmllint --format sample-5017.xml
관련링크
댓글목록
등록된 댓글이 없습니다.