Skip to content

Commit

Permalink
fix: pdf cmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
rabyeoljji committed Dec 23, 2024
1 parent 03a699d commit 8752e1d
Show file tree
Hide file tree
Showing 171 changed files with 56 additions and 1 deletion.
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"words": [
"autodocs",
"classname",
"cmaps",
"customise",
"hanmail",
"kakao",
Expand Down
Binary file added public/cmaps/78-EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/78-EUC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/78-H.bcmap
Binary file not shown.
Binary file added public/cmaps/78-RKSJ-H.bcmap
Binary file not shown.
Binary file added public/cmaps/78-RKSJ-V.bcmap
Binary file not shown.
Binary file added public/cmaps/78-V.bcmap
Binary file not shown.
Binary file added public/cmaps/78ms-RKSJ-H.bcmap
Binary file not shown.
Binary file added public/cmaps/78ms-RKSJ-V.bcmap
Binary file not shown.
Binary file added public/cmaps/83pv-RKSJ-H.bcmap
Binary file not shown.
Binary file added public/cmaps/90ms-RKSJ-H.bcmap
Binary file not shown.
Binary file added public/cmaps/90ms-RKSJ-V.bcmap
Binary file not shown.
Binary file added public/cmaps/90msp-RKSJ-H.bcmap
Binary file not shown.
Binary file added public/cmaps/90msp-RKSJ-V.bcmap
Binary file not shown.
Binary file added public/cmaps/90pv-RKSJ-H.bcmap
Binary file not shown.
Binary file added public/cmaps/90pv-RKSJ-V.bcmap
Binary file not shown.
Binary file added public/cmaps/Add-H.bcmap
Binary file not shown.
Binary file added public/cmaps/Add-RKSJ-H.bcmap
Binary file not shown.
Binary file added public/cmaps/Add-RKSJ-V.bcmap
Binary file not shown.
Binary file added public/cmaps/Add-V.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-CNS1-0.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-CNS1-1.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-CNS1-2.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-CNS1-3.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-CNS1-4.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-CNS1-5.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-CNS1-6.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-CNS1-UCS2.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-GB1-0.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-GB1-1.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-GB1-2.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-GB1-3.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-GB1-4.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-GB1-5.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-GB1-UCS2.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Japan1-0.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Japan1-1.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Japan1-2.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Japan1-3.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Japan1-4.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Japan1-5.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Japan1-6.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Japan1-UCS2.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Korea1-0.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Korea1-1.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Korea1-2.bcmap
Binary file not shown.
Binary file added public/cmaps/Adobe-Korea1-UCS2.bcmap
Binary file not shown.
Binary file added public/cmaps/B5-H.bcmap
Binary file not shown.
Binary file added public/cmaps/B5-V.bcmap
Binary file not shown.
Binary file added public/cmaps/B5pc-H.bcmap
Binary file not shown.
Binary file added public/cmaps/B5pc-V.bcmap
Binary file not shown.
Binary file added public/cmaps/CNS-EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/CNS-EUC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/CNS1-H.bcmap
Binary file not shown.
Binary file added public/cmaps/CNS1-V.bcmap
Binary file not shown.
Binary file added public/cmaps/CNS2-H.bcmap
Binary file not shown.
3 changes: 3 additions & 0 deletions public/cmaps/CNS2-V.bcmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
�RCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSE�CNS2-H
Binary file added public/cmaps/ETHK-B5-H.bcmap
Binary file not shown.
Binary file added public/cmaps/ETHK-B5-V.bcmap
Binary file not shown.
Binary file added public/cmaps/ETen-B5-H.bcmap
Binary file not shown.
Binary file added public/cmaps/ETen-B5-V.bcmap
Binary file not shown.
3 changes: 3 additions & 0 deletions public/cmaps/ETenms-B5-H.bcmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
�RCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSE� ETen-B5-H` ^
Binary file added public/cmaps/ETenms-B5-V.bcmap
Binary file not shown.
Binary file added public/cmaps/EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/EUC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/Ext-H.bcmap
Binary file not shown.
Binary file added public/cmaps/Ext-RKSJ-H.bcmap
Binary file not shown.
Binary file added public/cmaps/Ext-RKSJ-V.bcmap
Binary file not shown.
Binary file added public/cmaps/Ext-V.bcmap
Binary file not shown.
Binary file added public/cmaps/GB-EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/GB-EUC-V.bcmap
Binary file not shown.
4 changes: 4 additions & 0 deletions public/cmaps/GB-H.bcmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
�RCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSE!!��]aX!!]`�21�> �p �z�$]��"R�d�-U�7�*�4�%�+ �Z �{�/�%�<�9K�b�1]�.�"� �`]�,�"]�
�"]�h�"]�F�"]�$�"]��"]�`�"]�>�"]��"]�z�"]�X�"]�6�"]��"]�r�"]�P�"]�.�"]� �"]�j�"]�H�"]�&�"]��"]�b�"]�@�"]��"]�|�"]�Z�"]�8�"]��"]�t�"]�R�"]�0�"]��"]�l�"]�J�"]�(�"]��"]�d�"]�B�"]� �"X�~�']�W�"]�5�"]��"]�q�"]�O�"]�-�"]� �"]�i�"]�G�"]�%�"]��"]�a�"]�?�"]��"]�{�"]�Y�"]�7�"]��"]�s�"]�Q�"]�/�"]��"]�k�"]�I�"]�'�"]��"]�c�"]�A�"]��"]�}�"]�[�"]�9
Expand Down
Binary file added public/cmaps/GB-V.bcmap
Binary file not shown.
Binary file added public/cmaps/GBK-EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/GBK-EUC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/GBK2K-H.bcmap
Binary file not shown.
Binary file added public/cmaps/GBK2K-V.bcmap
Binary file not shown.
Binary file added public/cmaps/GBKp-EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/GBKp-EUC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/GBT-EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/GBT-EUC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/GBT-H.bcmap
Binary file not shown.
Binary file added public/cmaps/GBT-V.bcmap
Binary file not shown.
Binary file added public/cmaps/GBTpc-EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/GBTpc-EUC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/GBpc-EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/GBpc-EUC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/H.bcmap
Binary file not shown.
Binary file added public/cmaps/HKdla-B5-H.bcmap
Binary file not shown.
Binary file added public/cmaps/HKdla-B5-V.bcmap
Binary file not shown.
Binary file added public/cmaps/HKdlb-B5-H.bcmap
Binary file not shown.
Binary file added public/cmaps/HKdlb-B5-V.bcmap
Binary file not shown.
Binary file added public/cmaps/HKgccs-B5-H.bcmap
Binary file not shown.
Binary file added public/cmaps/HKgccs-B5-V.bcmap
Binary file not shown.
Binary file added public/cmaps/HKm314-B5-H.bcmap
Binary file not shown.
Binary file added public/cmaps/HKm314-B5-V.bcmap
Binary file not shown.
Binary file added public/cmaps/HKm471-B5-H.bcmap
Binary file not shown.
Binary file added public/cmaps/HKm471-B5-V.bcmap
Binary file not shown.
Binary file added public/cmaps/HKscs-B5-H.bcmap
Binary file not shown.
Binary file added public/cmaps/HKscs-B5-V.bcmap
Binary file not shown.
Binary file added public/cmaps/Hankaku.bcmap
Binary file not shown.
Binary file added public/cmaps/Hiragana.bcmap
Binary file not shown.
Binary file added public/cmaps/KSC-EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/KSC-EUC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/KSC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/KSC-Johab-H.bcmap
Binary file not shown.
Binary file added public/cmaps/KSC-Johab-V.bcmap
Binary file not shown.
Binary file added public/cmaps/KSC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/KSCms-UHC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/KSCms-UHC-HW-H.bcmap
Binary file not shown.
Binary file added public/cmaps/KSCms-UHC-HW-V.bcmap
Binary file not shown.
Binary file added public/cmaps/KSCms-UHC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/KSCpc-EUC-H.bcmap
Binary file not shown.
Binary file added public/cmaps/KSCpc-EUC-V.bcmap
Binary file not shown.
Binary file added public/cmaps/Katakana.bcmap
Binary file not shown.
36 changes: 36 additions & 0 deletions public/cmaps/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
%%Copyright: -----------------------------------------------------------
%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.
%%Copyright: All rights reserved.
%%Copyright:
%%Copyright: Redistribution and use in source and binary forms, with or
%%Copyright: without modification, are permitted provided that the
%%Copyright: following conditions are met:
%%Copyright:
%%Copyright: Redistributions of source code must retain the above
%%Copyright: copyright notice, this list of conditions and the following
%%Copyright: disclaimer.
%%Copyright:
%%Copyright: Redistributions in binary form must reproduce the above
%%Copyright: copyright notice, this list of conditions and the following
%%Copyright: disclaimer in the documentation and/or other materials
%%Copyright: provided with the distribution.
%%Copyright:
%%Copyright: Neither the name of Adobe Systems Incorporated nor the names
%%Copyright: of its contributors may be used to endorse or promote
%%Copyright: products derived from this software without specific prior
%%Copyright: written permission.
%%Copyright:
%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
%%Copyright: CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%%Copyright: -----------------------------------------------------------
Binary file added public/cmaps/NWP-H.bcmap
Binary file not shown.
Binary file added public/cmaps/NWP-V.bcmap
Binary file not shown.
Binary file added public/cmaps/RKSJ-H.bcmap
Binary file not shown.
Binary file added public/cmaps/RKSJ-V.bcmap
Binary file not shown.
Binary file added public/cmaps/Roman.bcmap
Binary file not shown.
Binary file added public/cmaps/UniCNS-UCS2-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniCNS-UCS2-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniCNS-UTF16-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniCNS-UTF16-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniCNS-UTF32-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniCNS-UTF32-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniCNS-UTF8-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniCNS-UTF8-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniGB-UCS2-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniGB-UCS2-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniGB-UTF16-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniGB-UTF16-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniGB-UTF32-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniGB-UTF32-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniGB-UTF8-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniGB-UTF8-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS-UCS2-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS-UCS2-HW-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS-UCS2-HW-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS-UCS2-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS-UTF16-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS-UTF16-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS-UTF32-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS-UTF32-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS-UTF8-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS-UTF8-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS2004-UTF16-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS2004-UTF16-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS2004-UTF32-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS2004-UTF32-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS2004-UTF8-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJIS2004-UTF8-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJISPro-UCS2-HW-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJISPro-UCS2-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJISPro-UTF8-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJISX0213-UTF32-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJISX0213-UTF32-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJISX02132004-UTF32-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniJISX02132004-UTF32-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniKS-UCS2-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniKS-UCS2-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniKS-UTF16-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniKS-UTF16-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniKS-UTF32-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniKS-UTF32-V.bcmap
Binary file not shown.
Binary file added public/cmaps/UniKS-UTF8-H.bcmap
Binary file not shown.
Binary file added public/cmaps/UniKS-UTF8-V.bcmap
Binary file not shown.
Binary file added public/cmaps/V.bcmap
Binary file not shown.
Binary file added public/cmaps/WP-Symbol.bcmap
Binary file not shown.
10 changes: 9 additions & 1 deletion src/features/document/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ const Y_COORDINATE_THRESHOLD = 20
// pdf 핸들러
const handlePdfFile = async (file: File): Promise<string> => {
const fileBuffer = await file.arrayBuffer()
const pdf = await pdfjs.getDocument({ data: fileBuffer }).promise

// CMap 설정 추가
const loadingTask = pdfjs.getDocument({
data: fileBuffer,
cMapUrl: '/cmaps/', // public 폴더 내의 cmaps 경로
cMapPacked: true,
})

const pdf = await loadingTask.promise
let markdown = ''

for (let pageNum = 1; pageNum <= pdf.numPages; pageNum++) {
Expand Down

0 comments on commit 8752e1d

Please sign in to comment.