diff --git "a/tests/cli_tests/hwp5proc.txt" "b/tests/cli_tests/hwp5proc.txt" new file mode 100644--- /dev/null +++ "b/tests/cli_tests/hwp5proc.txt" @@ -0,0 +1,2808 @@ +프로그램 설명 및 사용법을 간단하게 표시한다:: + + $ hwp5proc --help + usage: hwp5proc [-h] [--loglevel LOGLEVEL] [--logfile LOGFILE] + {version,header,summaryinfo,ls,cat,unpack,records,models,find,xml,rawunz,diststream} + ... + + Do various operations on HWPv5 files. + + optional arguments: + -h, --help show this help message and exit + --loglevel LOGLEVEL Set log level. + --logfile LOGFILE Set log file. + + subcommands: + valid subcommands + + {version,header,summaryinfo,ls,cat,unpack,records,models,find,xml,rawunz,diststream} + version Print the file format version of .hwp files. + header Print file headers of .hwp files. + summaryinfo Print summary informations of .hwp files. + ls List streams in .hwp files. + cat Extract out internal streams of .hwp files + unpack Extract out internal streams of .hwp files into a + directory. + records Print the record structure of .hwp file record + streams. + models Print parsed binary models of .hwp file record + streams. + find Find record models with specified predicates. + xml Transform .hwp files into an XML. + rawunz Deflate an headerless zlib-compressed stream + diststream Decode a distribute document stream. + +hwp5proc 은 여러 하위 명령으로 이루어져 있다. + +------------ +version 명령 +------------ + +사용법:: + + $ hwp5proc version --help + usage: hwp5proc version [-h] + + Print the file format version of . + + positional arguments: + .hwp file to analyze + + optional arguments: + -h, --help show this help message and exit + +HWPv5 파일의 파일 포맷 버젼을 확인한다:: + + $ hwp5proc version samples/sample-5017.hwp + 5.0.1.7 + +----------- +header 명령 +----------- + +사용법:: + + $ hwp5proc header --help + usage: hwp5proc header [-h] + + Print the file header of . + + positional arguments: + .hwp file to analyze + + optional arguments: + -h, --help show this help message and exit + + $ hwp5proc header samples/sample-5017.hwp + 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 + + +---------------- +summaryinfo 명령 +---------------- + +사용법:: + + $ hwp5proc summaryinfo --help + usage: hwp5proc summaryinfo [-h] + + Print the summary information of . + + positional arguments: + .hwp file to analyze + + optional arguments: + -h, --help show this help message and exit + + $ hwp5proc summaryinfo samples/sample-5017.hwp + Title: 제목입니다. + Subject: 주제입니다. + Author: 지은이입니다. + Keywords: 키워드입니다. + Comments: 기타입니다. + Last saved by: mete0r + Revision Number: 6, 7, 9, 1053 WIN6 + Last Printed at: 1601-01-01 00:00:00 + Created at: 2010-07-02 03:36:13.540000 + Last saved at: 2011-06-14 12:54:58.775000 + Number of pages: 2 + Date: 2010년 7월 2일 금요일 오후 12:36:13 + Number of paragraphs: 26 + +------- +ls 명령 +------- + +사용법:: + + $ hwp5proc ls --help + usage: hwp5proc ls [-h] [--vstreams | --ole] + + List streams in the . + + positional arguments: + .hwp file to analyze + + optional arguments: + -h, --help show this help message and exit + --vstreams Process with virtual streams (i.e. parsed/converted form of real + streams) + --ole Treat as an OLE Compound File. As a result, some + streams will be presented as-is. (i.e. not decompressed) + + $ hwp5proc ls samples/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 + + $ hwp5proc ls --vstreams samples/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 + +-------- +cat 명령 +-------- + + $ hwp5proc cat --help + usage: hwp5proc cat [-h] [--vstreams | --ole] + + Extract out the specified stream in the to the standard output. + + positional arguments: + .hwp file to analyze + Internal path of a stream to extract + + optional arguments: + -h, --help show this help message and exit + --vstreams Process with virtual streams (i.e. parsed/converted form of real + streams) + --ole Treat as an OLE Compound File. As a result, some + streams will be presented as-is. (i.e. not decompressed) + + $ hwp5proc cat samples/sample-5017.hwp BinData/BIN0002.jpg | file --mime-type - + /dev/stdin: image/jpeg + + $ 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 --vstreams samples/sample-5017.hwp $(printf '\005HwpSummaryInformation.txt') + - ByteOrder: 0xfffe + - Version: 0 + - SystemIdentifier: 0x00020105 + - CLSID: 9fa2b660-1061-11d4-b4c6-006097c09d8c + + - 00000030: Property Set 9fa2b660-1061-11d4-b4c6-006097c09d8c + ------------------------------------------------- + - 000000a8: PIDSI_TITLE(=0x00000002): 제목입니다. + - 000000c0: PIDSI_SUBJECT(=0x00000003): 주제입니다. + - 000000d8: PIDSI_AUTHOR(=0x00000004): 지은이입니다. + - 000000f0: HWPPIDSI_DATE_STR(=0x00000014): 2010년 7월 2일 금요일 오후 12:36:13 + - 00000130: PIDSI_KEYWORDS(=0x00000005): 키워드입니다. + - 00000148: PIDSI_COMMENTS(=0x00000006): 기타입니다. + - 00000160: PIDSI_LASTAUTHOR(=0x00000008): mete0r + - 00000178: PIDSI_REVNUMBER(=0x00000009): 6, 7, 9, 1053 WIN6 + - 000001a8: PIDSI_CREATE_DTM(=0x0000000c): 2010-07-02 03:36:13.540000 + - 000001b4: PIDSI_LASTSAVE_DTM(=0x0000000d): 2011-06-14 12:54:58.775000 + - 000001c0: PIDSI_LASTPRINTED(=0x0000000b): 1601-01-01 00:00:00 + - 000001cc: PIDSI_PAGECOUNT(=0x0000000e): 2 + - 000001d4: HWPPIDSI_PARACOUNT(=0x00000015): 26 + - 000001dc: PID_DICTIONARY(=0x00000000): + - 0: + + $ hwp5proc cat samples/sample-5017.hwp BodyText/Section0 | sha1sum + 0c66f772894487ba06cd225ebc4871f552e07cf8 - + + +unpack 명령 +----------- + + $ hwp5proc unpack --help + usage: hwp5proc unpack [-h] [--vstreams | --ole] [] + + Extract out streams in the specified to a directory. + + positional arguments: + .hwp file to analyze + Output directory + + optional arguments: + -h, --help show this help message and exit + --vstreams Process with virtual streams (i.e. parsed/converted form of + real streams) + --ole Treat as an OLE Compound File. As a result, some + streams will be presented as-is. (i.e. not decompressed) + + $ rm -rf sample-5017 + $ hwp5proc unpack samples/sample-5017.hwp + $ find sample-5017 -type f | sort --dictionary | xargs sha1sum + 25233fb7d96f387fbe07eadae65c7ba3cdccaab1 sample-5017/_05HwpSummaryInformation + a651496e95dd70a7a5c3ae08f8829cecd5e6ed7b sample-5017/BinData/BIN0002.jpg + e0f44117bf675d77297a86a322bd9eaa96543c37 sample-5017/BinData/BIN0002.png + e0f44117bf675d77297a86a322bd9eaa96543c37 sample-5017/BinData/BIN0003.png + 0c66f772894487ba06cd225ebc4871f552e07cf8 sample-5017/BodyText/Section0 + f282704d3298c75c74ebf628d69fecb68663b132 sample-5017/DocInfo + 7ccb9514dbb7cc874feef4cc131af0d64a8e52be sample-5017/DocOptions/_LinkDoc + 33108a5790f0f9ce5147ec8c421ef6d2ecde6e3d sample-5017/FileHeader + 6199556b9c4961b6f5a7c8e330c1f3f54c42f85f sample-5017/PrvImage + 23302ee8ea7ddf4b1b7bfb8f6c307df589eeea4f sample-5017/PrvText + e40fe23054d2df479a06947174be594ff4c80497 sample-5017/Scripts/DefaultJScript + 3da89ee273be13437e7ecf760f3fbd4dc0e8d1fe sample-5017/Scripts/JScriptVersion + + $ rm -rf sample-5017 + $ hwp5proc unpack --vstreams samples/sample-5017.hwp + $ find sample-5017 -type f | sort --dictionary + sample-5017/_05HwpSummaryInformation + sample-5017/_05HwpSummaryInformation.txt + sample-5017/BinData/BIN0002.jpg + sample-5017/BinData/BIN0002.png + sample-5017/BinData/BIN0003.png + sample-5017/BodyText/Section0 + sample-5017/BodyText/Section0.models + sample-5017/BodyText/Section0.records + sample-5017/BodyText/Section0.xml + sample-5017/BodyText.xml + sample-5017/DocInfo + sample-5017/DocInfo.models + sample-5017/DocInfo.records + sample-5017/DocInfo.xml + sample-5017/DocOptions/_LinkDoc + sample-5017/FileHeader + sample-5017/FileHeader.txt + sample-5017/PrvImage + sample-5017/PrvText + sample-5017/PrvText.utf8 + sample-5017/Scripts/DefaultJScript + sample-5017/Scripts/JScriptVersion + + +rawunz 명�� +----------- + + $ hwp5proc rawunz --help + usage: hwp5proc rawunz [-h] + + Deflate an headerless zlib-compressed stream + + optional arguments: + -h, --help show this help message and exit + + $ rm -f Section0 Section0.rawz + $ hwp5proc cat --ole samples/sample-5017.hwp BodyText/Section0 > Section0.rawz + $ sha1sum Section0.rawz + 1d2293ddee9f584b2294ee042b9587c12c071011 Section0.rawz + $ hwp5proc rawunz < Section0.rawz > Section0 + $ sha1sum Section0 + 0c66f772894487ba06cd225ebc4871f552e07cf8 Section0 + + +diststream 명령 +--------------- + + $ hwp5proc diststream --help + usage: hwp5proc diststream [-h] [--sha1 | --key] [--raw] + + Decode a distribute document stream. + + optional arguments: + -h, --help show this help message and exit + --sha1 Print SHA-1 value for decryption. + --key Print decrypted key. + --raw Print raw binary objects as is. + + $ rm -f Section0 Section.zraw Section0.zraw.aes128ecb + $ hwp5proc cat --ole samples/viewtext.hwp ViewText/Section0 > Section0.zraw.aes128ecb + $ sha1sum Section0.zraw.aes128ecb + afb6223d49748dec0f1fb3ccf720918ea1a31ec5 Section0.zraw.aes128ecb + $ hwp5proc diststream < Section0.zraw.aes128ecb > Section0.zraw 2>/dev/null + $ sha1sum Section0.zraw + 77150206051a11c68ec61353b9d7cf3a0dd63ec8 Section0.zraw + $ hwp5proc rawunz < Section0.zraw > Section0 + $ sha1sum Section0 + 75d6750ad7ad45edc9c1abae2060b8d1c404f6df Section0 + $ hwp5proc diststream --sha1 < Section0.zraw.aes128ecb #=> --regex ^8cb2237d0679ca88db6464eac60da96345513964$ + $ hwp5proc diststream --key < Section0.zraw.aes128ecb #=> --regex ^38004300420032003200330037004400$ + +records 명령 +------------ + + $ hwp5proc records --help + usage: hwp5proc records [-h] + [--simple | --json | --raw | --raw-header | --raw-payload] + [--range | --treegroup ] + [] [] + + Print the record structure of the specified stream. + + positional arguments: + .hwp file to analyze + Record-structured internal streams. (e.g. DocInfo, + BodyText/*) + + optional arguments: + -h, --help show this help message and exit + --simple Print records as simple tree + --json Print records as json + --raw Print records as is + --raw-header Print record headers as is + --raw-payload Print record payloads as is + --range Specifies the range of the records. N-M means "from + the record N to M-1 (excluding M)" N means just the + record N + --treegroup + Specifies the N-th subtree of the record structure. + + $ hwp5proc records samples/sample-5017.hwp DocInfo | jq .[66] + { + "level": 1, + "payload": [ + "02 00 54 ba a8 ba 04 00 4d 00 65 00 6d 00 6f 00", + "00 0d 12 04 00 00 04 00 00 00" + ], + "seqno": 66, + "size": 26, + "tagid": 26, + "tagname": "HWPTAG_STYLE" + } + + $ hwp5proc records --simple samples/sample-5017.hwp DocInfo --range=0-2 + 0000 HWPTAG_DOCUMENT_PROPERTIES + 0001 HWPTAG_ID_MAPPINGS + + $ hwp5proc records --raw samples/sample-5017.hwp DocInfo --range=0-2 | sha1sum + 3004547bd45ca213d5d7963fb95bcb082fa0ae3b - + + $ hwp5proc records --json samples/sample-5017.hwp DocInfo --range=1 | jq . + [ + { + "level": 0, + "payload": [ + "02 00 00 00 02 00 00 00 02 00 00 00 02 00 00 00", + "02 00 00 00 02 00 00 00 02 00 00 00 02 00 00 00", + "06 00 00 00 0a 00 00 00 03 00 00 00 01 00 00 00", + "00 00 00 00 0f 00 00 00 0e 00 00 00 00 00 00 00" + ], + "seqno": 1, + "size": 64, + "tagid": 17, + "tagname": "HWPTAG_ID_MAPPINGS" + } + ] + +models 명령 +----------- + + $ hwp5proc models --help + usage: hwp5proc models [-h] [--file-format-version ] + [--simple | --json | --format | --events] + [--treegroup | --seqno ] + [] [] + + Print parsed binary models in the specified . + + positional arguments: + .hwp file to analyze + Record-structured internal streams. (e.g. DocInfo, + BodyText/*) + + optional arguments: + -h, --help show this help message and exit + --file-format-version , -V + Specifies HWPv5 file format version of the standard + input stream + --simple Print records as simple tree + --json Print records as json + --format Print records formatted + --events Print records as events + --treegroup + Specifies the N-th subtree of the record structure. + --seqno Print a model of -th record + + $ hwp5proc models samples/sample-5017.hwp DocInfo | jq .[66] + { + "content": { + "charshape_id": 4, + "flags": 0, + "lang_id": 1042, + "local_name": "메모", + "name": "Memo", + "next_style_id": 13, + "parashape_id": 0, + "unknown": 0 + }, + "level": 1, + "payload": [ + "02 00 54 ba a8 ba 04 00 4d 00 65 00 6d 00 6f 00", + "00 0d 12 04 00 00 04 00 00 00" + ], + "seqno": 66, + "size": 26, + "tagid": 26, + "tagname": "HWPTAG_STYLE", + "type": "Style" + } + + $ hwp5proc models samples/sample-5017.hwp docinfo | jq .[66] + { + "content": { + "charshape_id": 4, + "flags": 0, + "lang_id": 1042, + "local_name": "메모", + "name": "Memo", + "next_style_id": 13, + "parashape_id": 0, + "unknown": 0 + }, + "level": 1, + "payload": [ + "02 00 54 ba a8 ba 04 00 4d 00 65 00 6d 00 6f 00", + "00 0d 12 04 00 00 04 00 00 00" + ], + "seqno": 66, + "size": 26, + "tagid": 26, + "tagname": "HWPTAG_STYLE", + "type": "Style" + } + + $ hwp5proc models samples/sample-5017.hwp BodyText/Section0 | jq .[0] + { + "content": { + "charshapes": 5, + "controlmask": 4, + "instance_id": 0, + "linesegs": 1, + "parashape_id": 0, + "rangetags": 0, + "split": 3, + "style_id": 0, + "text": 34 + }, + "level": 0, + "payload": [ + "22 00 00 00 04 00 00 00 00 00 00 03 05 00 00 00", + "01 00 00 00 00 00" + ], + "seqno": 0, + "size": 22, + "tagid": 66, + "tagname": "HWPTAG_PARA_HEADER", + "type": "Paragraph" + } + + $ hwp5proc models samples/sample-5017.hwp bodytext/0 | jq .[127] + { + "content": { + "border": { + "color": 0, + "flags": 3221225472, + "width": 0 + }, + "clip": { + "bottom": 1200, + "left": 0, + "right": 1200, + "top": 0 + }, + "padding": { + "bottom": 0, + "left": 0, + "right": 0, + "top": 0 + }, + "picture": { + "bindata_id": 2, + "brightness": 0, + "contrast": 0, + "effect": 0 + }, + "rect": { + "p0": { + "x": 0, + "y": 0 + }, + "p1": { + "x": 1614, + "y": 0 + }, + "p2": { + "x": 1614, + "y": 1614 + }, + "p3": { + "x": 0, + "y": 1614 + } + } + }, + "level": 3, + "payload": [ + "00 00 00 00 00 00 00 00 00 00 00 c0 00 00 00 00", + "00 00 00 00 4e 06 00 00 00 00 00 00 4e 06 00 00", + "4e 06 00 00 00 00 00 00 4e 06 00 00 00 00 00 00", + "00 00 00 00 b0 04 00 00 b0 04 00 00 00 00 00 00", + "00 00 00 00 00 00 00 02 00" + ], + "seqno": 127, + "size": 73, + "tagid": 85, + "tagname": "HWPTAG_SHAPE_COMPONENT_PICTURE", + "type": "ShapePicture" + } + + $ hwp5proc models samples/sample-5017.hwp bodytext/0 --seqno=4 | jq . + [ + { + "content": { + "chid": "secd", + "columnspacing": 1134, + "defaultTabStops": 8000, + "flags": 0, + "grid_horizontal": 0, + "grid_vertical": 0, + "numbering_shape_id": 1, + "starting_equationnum": 0, + "starting_pagenum": 0, + "starting_picturenum": 0, + "starting_tablenum": 0, + "unknown1": 0, + "unknown2": 0 + }, + "level": 1, + "payload": [ + "64 63 65 73 00 00 00 00 6e 04 00 00 00 00 40 1f", + "00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00", + "00 00 00 00" + ], + "seqno": 4, + "size": 36, + "tagid": 71, + "tagname": "HWPTAG_CTRL_HEADER", + "type": "SectionDef" + } + ] + + $ hwp5proc models --simple samples/sample-5017.hwp bodytext/0 + 0000 Paragraph + 0001 ParaText + 0002 ParaCharShape + 0003 ParaLineSeg + 0004 SectionDef + 0005 PageDef + 0006 FootnoteShape + 0007 FootnoteShape + 0008 PageBorderFill + 0009 PageBorderFill + 0010 PageBorderFill + 0011 ColumnsDef + 0012 Paragraph + 0013 ParaCharShape + 0014 ParaLineSeg + 0015 Paragraph + 0016 ParaText + 0017 ParaCharShape + 0018 ParaLineSeg + 0019 Paragraph + 0020 ParaCharShape + 0021 ParaLineSeg + 0022 Paragraph + 0023 ParaText + 0024 ParaCharShape + 0025 ParaLineSeg + 0026 Paragraph + 0027 ParaText + 0028 ParaCharShape + 0029 ParaLineSeg + 0030 TableControl + 0031 TableBody + 0032 TableCell + 0033 Paragraph + 0034 ParaText + 0035 ParaCharShape + 0036 ParaLineSeg + 0037 TableCell + 0038 Paragraph + 0039 ParaText + 0040 ParaCharShape + 0041 ParaLineSeg + 0042 TableCell + 0043 Paragraph + 0044 ParaText + 0045 ParaCharShape + 0046 ParaLineSeg + 0047 TableCell + 0048 Paragraph + 0049 ParaText + 0050 ParaCharShape + 0051 ParaLineSeg + 0052 Paragraph + 0053 ParaText + 0054 ParaCharShape + 0055 ParaLineSeg + 0056 TableControl + 0057 TableBody + 0058 TableCell + 0059 Paragraph + 0060 ParaText + 0061 ParaCharShape + 0062 ParaLineSeg + 0063 Paragraph + 0064 ParaText + 0065 ParaCharShape + 0066 ParaLineSeg + 0067 TableControl + 0068 TableCaption + 0069 Paragraph + 0070 ParaText + 0071 ParaCharShape + 0072 ParaLineSeg + 0073 AutoNumbering + 0074 Paragraph + 0075 ParaText + 0076 ParaCharShape + 0077 ParaLineSeg + 0078 TableBody + 0079 TableCell + 0080 Paragraph + 0081 ParaCharShape + 0082 ParaLineSeg + 0083 TableCell + 0084 Paragraph + 0085 ParaCharShape + 0086 ParaLineSeg + 0087 TableCell + 0088 Paragraph + 0089 ParaCharShape + 0090 ParaLineSeg + 0091 TableCell + 0092 Paragraph + 0093 ParaCharShape + 0094 ParaLineSeg + 0095 Paragraph + 0096 ParaText + 0097 ParaCharShape + 0098 ParaLineSeg + 0099 Paragraph + 0100 ParaCharShape + 0101 ParaLineSeg + 0102 Paragraph + 0103 ParaText + 0104 ParaCharShape + 0105 ParaLineSeg + 0106 Paragraph + 0107 ParaText + 0108 ParaCharShape + 0109 ParaLineSeg + 0110 GShapeObjectControl + 0111 ShapeComponent + 0112 ShapePicture + 0113 Paragraph + 0114 ParaText + 0115 ParaCharShape + 0116 ParaLineSeg + 0117 Paragraph + 0118 ParaText + 0119 ParaCharShape + 0120 ParaLineSeg + 0121 Paragraph + 0122 ParaText + 0123 ParaCharShape + 0124 ParaLineSeg + 0125 GShapeObjectControl + 0126 ShapeComponent + 0127 ShapePicture + + $ hwp5proc models --treegroup=0 --simple samples/sample-5017.hwp bodytext/0 + 0000 Paragraph + 0001 ParaText + 0002 ParaCharShape + 0003 ParaLineSeg + 0004 SectionDef + 0005 PageDef + 0006 FootnoteShape + 0007 FootnoteShape + 0008 PageBorderFill + 0009 PageBorderFill + 0010 PageBorderFill + 0011 ColumnsDef + + $ hwp5proc models --treegroup=5 --simple samples/sample-5017.hwp bodytext/0 + 0026 Paragraph + 0027 ParaText + 0028 ParaCharShape + 0029 ParaLineSeg + 0030 TableControl + 0031 TableBody + 0032 TableCell + 0033 Paragraph + 0034 ParaText + 0035 ParaCharShape + 0036 ParaLineSeg + 0037 TableCell + 0038 Paragraph + 0039 ParaText + 0040 ParaCharShape + 0041 ParaLineSeg + 0042 TableCell + 0043 Paragraph + 0044 ParaText + 0045 ParaCharShape + 0046 ParaLineSeg + 0047 TableCell + 0048 Paragraph + 0049 ParaText + 0050 ParaCharShape + 0051 ParaLineSeg + 0052 Paragraph + 0053 ParaText + 0054 ParaCharShape + 0055 ParaLineSeg + 0056 TableControl + 0057 TableBody + 0058 TableCell + 0059 Paragraph + 0060 ParaText + 0061 ParaCharShape + 0062 ParaLineSeg + + $ hwp5proc models samples/sample-5017.hwp bodytext/0 --treegroup=0 --format='%(seqno)s %(level)s %(tagname)s\n' + 0 0 HWPTAG_PARA_HEADER + 1 1 HWPTAG_PARA_TEXT + 2 1 HWPTAG_PARA_CHAR_SHAPE + 3 1 HWPTAG_PARA_LINE_SEG + 4 1 HWPTAG_CTRL_HEADER + 5 2 HWPTAG_PAGE_DEF + 6 2 HWPTAG_FOOTNOTE_SHAPE + 7 2 HWPTAG_FOOTNOTE_SHAPE + 8 2 HWPTAG_PAGE_BORDER_FILL + 9 2 HWPTAG_PAGE_BORDER_FILL + 10 2 HWPTAG_PAGE_BORDER_FILL + 11 1 HWPTAG_CTRL_HEADER + + $ hwp5proc cat samples/sample-5017.hwp BodyText/Section0 | hwp5proc models --simple -V 5.0.1.7 --treegroup=13 + 0121 Paragraph + 0122 ParaText + 0123 ParaCharShape + 0124 ParaLineSeg + 0125 GShapeObjectControl + 0126 ShapeComponent + 0127 ShapePicture + +find 명령 +--------- + + $ hwp5proc find --help + usage: hwp5proc find [-h] [--from-stdin] + [--model | --tag ] [--incomplete] + [--format ] [--dump] + [ ...] + + Find record models with specified predicates. + + positional arguments: + .hwp files to analyze + + optional arguments: + -h, --help show this help message and exit + --from-stdin get filenames from stdin + --model filter with record model name + --tag filter with record HWPTAG + --incomplete filter with incompletely parsed content + --format record output format + --dump dump record + + $ hwp5proc find --model=Paragraph samples/charshape.hwp samples/parashape.hwp + samples/charshape.hwp BodyText/Section0 0 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 12 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 16 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 20 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 24 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 28 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 32 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 0 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 12 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 16 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 20 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 24 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 28 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 32 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 36 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 40 HWPTAG_PARA_HEADER Paragraph + + $ hwp5proc find --tag=HWPTAG_PARA_HEADER samples/charshape.hwp samples/parashape.hwp + samples/charshape.hwp BodyText/Section0 0 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 12 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 16 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 20 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 24 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 28 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 32 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 0 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 12 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 16 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 20 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 24 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 28 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 32 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 36 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 40 HWPTAG_PARA_HEADER Paragraph + + $ hwp5proc find --tag=66 samples/charshape.hwp samples/parashape.hwp + samples/charshape.hwp BodyText/Section0 0 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 12 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 16 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 20 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 24 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 28 HWPTAG_PARA_HEADER Paragraph + samples/charshape.hwp BodyText/Section0 32 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 0 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 12 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 16 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 20 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 24 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 28 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 32 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 36 HWPTAG_PARA_HEADER Paragraph + samples/parashape.hwp BodyText/Section0 40 HWPTAG_PARA_HEADER Paragraph + + $ hwp5proc find --incomplete samples/shapeline.hwp + samples/shapeline.hwp DocInfo 16 HWPTAG_BORDER_FILL BorderFill + samples/shapeline.hwp BodyText/Section0 13 HWPTAG_SHAPE_COMPONENT ShapeComponent + samples/shapeline.hwp BodyText/Section0 14 HWPTAG_SHAPE_COMPONENT_LINE ShapeLine + samples/shapeline.hwp BodyText/Section0 16 HWPTAG_SHAPE_COMPONENT ShapeComponent + samples/shapeline.hwp BodyText/Section0 17 HWPTAG_SHAPE_COMPONENT_LINE ShapeLine + + $ hwp5proc find --incomplete --dump samples/shapeline.hwp | grep 'STARTEVENT' + STARTEVENT: BorderFill + STARTEVENT: Border 'left' + STARTEVENT: Border 'right' + STARTEVENT: Border 'top' + STARTEVENT: Border 'bottom' + STARTEVENT: Border 'diagonal' + STARTEVENT: FillColorPattern 'fill_colorpattern' + STARTEVENT: ShapeComponent + STARTEVENT: Coord 'rotation_center' + STARTEVENT: Matrix 'translation' + STARTEVENT: ARRAY(ScaleRotationMatrix, 'scalerotations_count') 'scalerotations' + STARTEVENT: ScaleRotationMatrix + STARTEVENT: Matrix 'scaler' + STARTEVENT: Matrix 'rotator' + STARTEVENT: BorderLine 'line' + STARTEVENT: ShapeLine + STARTEVENT: Coord 'p0' + STARTEVENT: Coord 'p1' + STARTEVENT: ShapeComponent + STARTEVENT: Coord 'rotation_center' + STARTEVENT: Matrix 'translation' + STARTEVENT: ARRAY(ScaleRotationMatrix, 'scalerotations_count') 'scalerotations' + STARTEVENT: ScaleRotationMatrix + STARTEVENT: Matrix 'scaler' + STARTEVENT: Matrix 'rotator' + STARTEVENT: BorderLine 'line' + STARTEVENT: ShapeLine + STARTEVENT: Coord 'p0' + STARTEVENT: Coord 'p1' + + $ echo samples/sample-5017.hwp | hwp5proc find --from-stdin + samples/sample-5017.hwp DocInfo 0 HWPTAG_DOCUMENT_PROPERTIES DocumentProperties + samples/sample-5017.hwp DocInfo 1 HWPTAG_ID_MAPPINGS IdMappings + samples/sample-5017.hwp DocInfo 2 HWPTAG_BIN_DATA BinData + samples/sample-5017.hwp DocInfo 3 HWPTAG_BIN_DATA BinData + samples/sample-5017.hwp DocInfo 4 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 5 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 6 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 7 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 8 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 9 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 10 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 11 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 12 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 13 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 14 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 15 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 16 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 17 HWPTAG_FACE_NAME FaceName + samples/sample-5017.hwp DocInfo 18 HWPTAG_BORDER_FILL BorderFill + samples/sample-5017.hwp DocInfo 19 HWPTAG_BORDER_FILL BorderFill + samples/sample-5017.hwp DocInfo 20 HWPTAG_BORDER_FILL BorderFill + samples/sample-5017.hwp DocInfo 21 HWPTAG_BORDER_FILL BorderFill + samples/sample-5017.hwp DocInfo 22 HWPTAG_BORDER_FILL BorderFill + samples/sample-5017.hwp DocInfo 23 HWPTAG_BORDER_FILL BorderFill + samples/sample-5017.hwp DocInfo 24 HWPTAG_CHAR_SHAPE CharShape + samples/sample-5017.hwp DocInfo 25 HWPTAG_CHAR_SHAPE CharShape + samples/sample-5017.hwp DocInfo 26 HWPTAG_CHAR_SHAPE CharShape + samples/sample-5017.hwp DocInfo 27 HWPTAG_CHAR_SHAPE CharShape + samples/sample-5017.hwp DocInfo 28 HWPTAG_CHAR_SHAPE CharShape + samples/sample-5017.hwp DocInfo 29 HWPTAG_CHAR_SHAPE CharShape + samples/sample-5017.hwp DocInfo 30 HWPTAG_CHAR_SHAPE CharShape + samples/sample-5017.hwp DocInfo 31 HWPTAG_CHAR_SHAPE CharShape + samples/sample-5017.hwp DocInfo 32 HWPTAG_CHAR_SHAPE CharShape + samples/sample-5017.hwp DocInfo 33 HWPTAG_CHAR_SHAPE CharShape + samples/sample-5017.hwp DocInfo 34 HWPTAG_TAB_DEF TabDef + samples/sample-5017.hwp DocInfo 35 HWPTAG_TAB_DEF TabDef + samples/sample-5017.hwp DocInfo 36 HWPTAG_TAB_DEF TabDef + samples/sample-5017.hwp DocInfo 37 HWPTAG_NUMBERING Numbering + samples/sample-5017.hwp DocInfo 38 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 39 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 40 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 41 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 42 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 43 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 44 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 45 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 46 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 47 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 48 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 49 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 50 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 51 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 52 HWPTAG_PARA_SHAPE ParaShape + samples/sample-5017.hwp DocInfo 53 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 54 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 55 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 56 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 57 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 58 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 59 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 60 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 61 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 62 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 63 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 64 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 65 HWPTAG_STYLE Style + samples/sample-5017.hwp DocInfo 66 HWPTAG_STYLE Style + samples/sample-5017.hwp BodyText/Section0 0 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 1 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 2 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 3 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 4 HWPTAG_CTRL_HEADER SectionDef + samples/sample-5017.hwp BodyText/Section0 5 HWPTAG_PAGE_DEF PageDef + samples/sample-5017.hwp BodyText/Section0 6 HWPTAG_FOOTNOTE_SHAPE FootnoteShape + samples/sample-5017.hwp BodyText/Section0 7 HWPTAG_FOOTNOTE_SHAPE FootnoteShape + samples/sample-5017.hwp BodyText/Section0 8 HWPTAG_PAGE_BORDER_FILL PageBorderFill + samples/sample-5017.hwp BodyText/Section0 9 HWPTAG_PAGE_BORDER_FILL PageBorderFill + samples/sample-5017.hwp BodyText/Section0 10 HWPTAG_PAGE_BORDER_FILL PageBorderFill + samples/sample-5017.hwp BodyText/Section0 11 HWPTAG_CTRL_HEADER ColumnsDef + samples/sample-5017.hwp BodyText/Section0 12 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 13 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 14 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 15 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 16 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 17 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 18 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 19 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 20 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 21 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 22 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 23 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 24 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 25 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 26 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 27 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 28 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 29 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 30 HWPTAG_CTRL_HEADER TableControl + samples/sample-5017.hwp BodyText/Section0 31 HWPTAG_TABLE TableBody + samples/sample-5017.hwp BodyText/Section0 32 HWPTAG_LIST_HEADER TableCell + samples/sample-5017.hwp BodyText/Section0 33 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 34 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 35 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 36 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 37 HWPTAG_LIST_HEADER TableCell + samples/sample-5017.hwp BodyText/Section0 38 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 39 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 40 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 41 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 42 HWPTAG_LIST_HEADER TableCell + samples/sample-5017.hwp BodyText/Section0 43 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 44 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 45 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 46 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 47 HWPTAG_LIST_HEADER TableCell + samples/sample-5017.hwp BodyText/Section0 48 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 49 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 50 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 51 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 52 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 53 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 54 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 55 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 56 HWPTAG_CTRL_HEADER TableControl + samples/sample-5017.hwp BodyText/Section0 57 HWPTAG_TABLE TableBody + samples/sample-5017.hwp BodyText/Section0 58 HWPTAG_LIST_HEADER TableCell + samples/sample-5017.hwp BodyText/Section0 59 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 60 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 61 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 62 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 63 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 64 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 65 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 66 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 67 HWPTAG_CTRL_HEADER TableControl + samples/sample-5017.hwp BodyText/Section0 68 HWPTAG_LIST_HEADER TableCaption + samples/sample-5017.hwp BodyText/Section0 69 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 70 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 71 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 72 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 73 HWPTAG_CTRL_HEADER AutoNumbering + samples/sample-5017.hwp BodyText/Section0 74 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 75 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 76 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 77 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 78 HWPTAG_TABLE TableBody + samples/sample-5017.hwp BodyText/Section0 79 HWPTAG_LIST_HEADER TableCell + samples/sample-5017.hwp BodyText/Section0 80 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 81 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 82 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 83 HWPTAG_LIST_HEADER TableCell + samples/sample-5017.hwp BodyText/Section0 84 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 85 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 86 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 87 HWPTAG_LIST_HEADER TableCell + samples/sample-5017.hwp BodyText/Section0 88 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 89 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 90 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 91 HWPTAG_LIST_HEADER TableCell + samples/sample-5017.hwp BodyText/Section0 92 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 93 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 94 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 95 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 96 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 97 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 98 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 99 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 100 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 101 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 102 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 103 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 104 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 105 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 106 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 107 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 108 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 109 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 110 HWPTAG_CTRL_HEADER GShapeObjectControl + samples/sample-5017.hwp BodyText/Section0 111 HWPTAG_SHAPE_COMPONENT ShapeComponent + samples/sample-5017.hwp BodyText/Section0 112 HWPTAG_SHAPE_COMPONENT_PICTURE ShapePicture + samples/sample-5017.hwp BodyText/Section0 113 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 114 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 115 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 116 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 117 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 118 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 119 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 120 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 121 HWPTAG_PARA_HEADER Paragraph + samples/sample-5017.hwp BodyText/Section0 122 HWPTAG_PARA_TEXT ParaText + samples/sample-5017.hwp BodyText/Section0 123 HWPTAG_PARA_CHAR_SHAPE ParaCharShape + samples/sample-5017.hwp BodyText/Section0 124 HWPTAG_PARA_LINE_SEG ParaLineSeg + samples/sample-5017.hwp BodyText/Section0 125 HWPTAG_CTRL_HEADER GShapeObjectControl + samples/sample-5017.hwp BodyText/Section0 126 HWPTAG_SHAPE_COMPONENT ShapeComponent + samples/sample-5017.hwp BodyText/Section0 127 HWPTAG_SHAPE_COMPONENT_PICTURE ShapePicture + + $ hwp5proc find --format='%(stream)s %(seqno)s %(size)s' samples/sample-5017.hwp 2> /dev/null + DocInfo 0 26 + DocInfo 1 64 + DocInfo 2 12 + DocInfo 3 12 + DocInfo 4 29 + DocInfo 5 31 + DocInfo 6 29 + DocInfo 7 31 + DocInfo 8 29 + DocInfo 9 31 + DocInfo 10 29 + DocInfo 11 31 + DocInfo 12 29 + DocInfo 13 31 + DocInfo 14 29 + DocInfo 15 31 + DocInfo 16 29 + DocInfo 17 31 + DocInfo 18 40 + DocInfo 19 52 + DocInfo 20 40 + DocInfo 21 40 + DocInfo 22 52 + DocInfo 23 70 + DocInfo 24 68 + DocInfo 25 68 + DocInfo 26 68 + DocInfo 27 68 + DocInfo 28 68 + DocInfo 29 68 + DocInfo 30 68 + DocInfo 31 68 + DocInfo 32 68 + DocInfo 33 68 + DocInfo 34 8 + DocInfo 35 8 + DocInfo 36 8 + DocInfo 37 144 + DocInfo 38 46 + DocInfo 39 46 + DocInfo 40 46 + DocInfo 41 46 + DocInfo 42 46 + DocInfo 43 46 + DocInfo 44 46 + DocInfo 45 46 + DocInfo 46 46 + DocInfo 47 46 + DocInfo 48 46 + DocInfo 49 46 + DocInfo 50 46 + DocInfo 51 46 + DocInfo 52 46 + DocInfo 53 32 + DocInfo 54 26 + DocInfo 55 40 + DocInfo 56 40 + DocInfo 57 40 + DocInfo 58 40 + DocInfo 59 40 + DocInfo 60 40 + DocInfo 61 40 + DocInfo 62 44 + DocInfo 63 32 + DocInfo 64 34 + DocInfo 65 32 + DocInfo 66 26 + BodyText/Section0 0 22 + BodyText/Section0 1 68 + BodyText/Section0 2 40 + BodyText/Section0 3 36 + BodyText/Section0 4 36 + BodyText/Section0 5 40 + BodyText/Section0 6 28 + BodyText/Section0 7 28 + BodyText/Section0 8 14 + BodyText/Section0 9 14 + BodyText/Section0 10 14 + BodyText/Section0 11 16 + BodyText/Section0 12 22 + BodyText/Section0 13 8 + BodyText/Section0 14 36 + BodyText/Section0 15 22 + BodyText/Section0 16 14 + BodyText/Section0 17 8 + BodyText/Section0 18 36 + BodyText/Section0 19 22 + BodyText/Section0 20 8 + BodyText/Section0 21 36 + BodyText/Section0 22 22 + BodyText/Section0 23 224 + BodyText/Section0 24 24 + BodyText/Section0 25 108 + BodyText/Section0 26 22 + BodyText/Section0 27 40 + BodyText/Section0 28 16 + BodyText/Section0 29 144 + BodyText/Section0 30 44 + BodyText/Section0 31 26 + BodyText/Section0 32 38 + BodyText/Section0 33 22 + BodyText/Section0 34 6 + BodyText/Section0 35 8 + BodyText/Section0 36 36 + BodyText/Section0 37 38 + BodyText/Section0 38 22 + BodyText/Section0 39 6 + BodyText/Section0 40 8 + BodyText/Section0 41 36 + BodyText/Section0 42 38 + BodyText/Section0 43 22 + BodyText/Section0 44 6 + BodyText/Section0 45 8 + BodyText/Section0 46 36 + BodyText/Section0 47 38 + BodyText/Section0 48 22 + BodyText/Section0 49 8 + BodyText/Section0 50 8 + BodyText/Section0 51 36 + BodyText/Section0 52 22 + BodyText/Section0 53 8 + BodyText/Section0 54 8 + BodyText/Section0 55 36 + BodyText/Section0 56 44 + BodyText/Section0 57 24 + BodyText/Section0 58 38 + BodyText/Section0 59 22 + BodyText/Section0 60 14 + BodyText/Section0 61 8 + BodyText/Section0 62 36 + BodyText/Section0 63 22 + BodyText/Section0 64 18 + BodyText/Section0 65 8 + BodyText/Section0 66 36 + BodyText/Section0 67 44 + BodyText/Section0 68 22 + BodyText/Section0 69 22 + BodyText/Section0 70 36 + BodyText/Section0 71 8 + BodyText/Section0 72 36 + BodyText/Section0 73 16 + BodyText/Section0 74 22 + BodyText/Section0 75 8 + BodyText/Section0 76 8 + BodyText/Section0 77 36 + BodyText/Section0 78 26 + BodyText/Section0 79 38 + BodyText/Section0 80 22 + BodyText/Section0 81 8 + BodyText/Section0 82 36 + BodyText/Section0 83 38 + BodyText/Section0 84 22 + BodyText/Section0 85 8 + BodyText/Section0 86 36 + BodyText/Section0 87 38 + BodyText/Section0 88 22 + BodyText/Section0 89 8 + BodyText/Section0 90 36 + BodyText/Section0 91 38 + BodyText/Section0 92 22 + BodyText/Section0 93 8 + BodyText/Section0 94 36 + BodyText/Section0 95 22 + BodyText/Section0 96 12 + BodyText/Section0 97 8 + BodyText/Section0 98 36 + BodyText/Section0 99 22 + BodyText/Section0 100 8 + BodyText/Section0 101 36 + BodyText/Section0 102 22 + BodyText/Section0 103 264 + BodyText/Section0 104 24 + BodyText/Section0 105 108 + BodyText/Section0 106 22 + BodyText/Section0 107 18 + BodyText/Section0 108 8 + BodyText/Section0 109 36 + BodyText/Section0 110 44 + BodyText/Section0 111 196 + BodyText/Section0 112 73 + BodyText/Section0 113 22 + BodyText/Section0 114 14 + BodyText/Section0 115 8 + BodyText/Section0 116 36 + BodyText/Section0 117 22 + BodyText/Section0 118 20 + BodyText/Section0 119 8 + BodyText/Section0 120 36 + BodyText/Section0 121 22 + BodyText/Section0 122 30 + BodyText/Section0 123 8 + BodyText/Section0 124 36 + BodyText/Section0 125 44 + BodyText/Section0 126 196 + BodyText/Section0 127 73 + +xml 명령 +-------- + + $ hwp5proc xml --help + usage: hwp5proc xml [-h] [--embedbin] [--no-xml-decl] [--output ] + [--format ] [--no-validate-wellformed] + + + Transform into an XML. + + positional arguments: + .hwp file to analyze + + optional arguments: + -h, --help show this help message and exit + --embedbin Embed BinData/* streams in the output XML. + --no-xml-decl Do not output XML declaration. + --output Output filename. + --format "flat", "nested" (default: "nested") + --no-validate-wellformed + Do not validate well-formedness of output. + + $ hwp5proc xml samples/sample-5017.hwp | xmllint --format - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +