<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>(주)이파피루스 블로그</title>
    <link>https://epapyrus.tistory.com/</link>
    <description>문서 AI 전문 기업, 이파피루스의 블로그입니다</description>
    <language>ko</language>
    <pubDate>Sat, 11 Apr 2026 23:42:38 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>이파피루스</managingEditor>
    <image>
      <title>(주)이파피루스 블로그</title>
      <url>https://tistory1.daumcdn.net/tistory/846285/attach/9a0e4611363742ffa124217b1830954f</url>
      <link>https://epapyrus.tistory.com</link>
    </image>
    <item>
      <title>50% 더 빨라진 OCR과 AI 답변의 '근거'를 찾는 법</title>
      <link>https://epapyrus.tistory.com/459</link>
      <description>&lt;p data-path-to-node=&quot;3&quot; data-ke-size=&quot;size16&quot;&gt;안녕하세요, 이파피루스 마케팅입니다.&lt;/p&gt;
&lt;p data-path-to-node=&quot;4&quot; data-ke-size=&quot;size16&quot;&gt;최근 LLM(거대언어모델)을 활용한 문서 AI 구축이 기업들의 핵심 과제로 떠오르고 있습니다. 하지만 정작 AI가 읽어야 할 문서의 상태가 제각각이라 데이터 추출 단계에서 어려움을 겪는 경우가 많죠.&lt;/p&gt;
&lt;p data-path-to-node=&quot;5&quot; data-ke-size=&quot;size16&quot;&gt;이파피루스는 이러한 고민을 해결하기 위해, 글로벌 다운로드 1억 2천만 건을 자랑하는 &lt;b data-index-in-node=&quot;48&quot; data-path-to-node=&quot;5&quot;&gt;PyMuPDF Pro&lt;/b&gt;와 웹 기반 PDF SDK인 &lt;b data-index-in-node=&quot;75&quot; data-path-to-node=&quot;5&quot;&gt;MuPDF Web Viewer&lt;/b&gt;의 대규모 업데이트를 진행했습니다. &quot;&lt;b&gt;더 빠르게, 더 정확하게, 그리고 더 믿을 수 있게&lt;/b&gt;&quot; 변모한 주요 기능을 소개합니다.&lt;/p&gt;
&lt;h3 data-path-to-node=&quot;7&quot; data-ke-size=&quot;size23&quot;&gt;&lt;u&gt;하이브리드 OCR : &quot;모든 페이지를 이미지로 변환하던 시대는 끝났습니다&quot;&lt;/u&gt;&lt;/h3&gt;
&lt;p data-path-to-node=&quot;8&quot; data-ke-size=&quot;size16&quot;&gt;기존의 OCR 방식은 텍스트가 이미 포함된 디지털 PDF조차 전체를 이미지로 굽고 다시 읽어내는 비효율적인 과정을 거쳤습니다. 이는 속도를 늦출 뿐만 아니라 원본 데이터의 품질을 떨어뜨리기도 합니다.&lt;/p&gt;
&lt;p data-path-to-node=&quot;9&quot; data-ke-size=&quot;size16&quot;&gt;이번에 업데이트 된 &lt;b&gt;하이브리드 OCR(Hybrid OCR)&lt;/b&gt;은 더욱 똑똑해 졌습니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-path-to-node=&quot;10&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;
&lt;div&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;10,0,1,0&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;10,0,1,0&quot;&gt;스마트 감지&lt;/b&gt;: 페이지 분석기가 이미지, 손상된 폰트, 벡터 캐릭터 등 '진짜 OCR이 필요한 영역'만 골라냅니다&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;10,0,1,1&quot;&gt;&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;10,0,1,2&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;10,1,1,0&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;10,1,1,0&quot;&gt;선택적 판독&lt;/b&gt;: 읽을 수 있는 텍스트는 그대로 유지하고, 문제가 있는 영역만 OCR 엔진으로 전달합니다&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;10,1,1,1&quot;&gt;&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;10,1,1,2&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li id=&quot;p-rc_229c1cda23ed651f-112&quot; data-path-to-node=&quot;10,2,1&quot;&gt;&lt;span data-path-to-node=&quot;10,2,1,0&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;10,2,1,0&quot;&gt;&lt;span&gt;놀라운 결과&lt;/span&gt;&lt;/b&gt;&lt;span&gt;: 덕분에 기존 방식보다 &lt;/span&gt;&lt;b data-index-in-node=&quot;20&quot; data-path-to-node=&quot;10,2,1,0&quot;&gt;&lt;span&gt;처리 속도가 약 50% 향상&lt;/span&gt;&lt;/b&gt;&lt;span&gt;되었으며, &lt;b&gt;원본의 레이아웃과 폰트 스타일을 100% 보존&lt;/b&gt;하면서도 &lt;b&gt;완벽한 텍스트 추출이 가능&lt;/b&gt;해졌습니다&lt;/span&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;10,2,1,1&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;10,2,1,2&quot;&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;하이브리드OCR.webp&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;607&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bkrOVy/dJMcabjvBsc/06XKsn39wfdXD11HWffQCK/img.webp&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bkrOVy/dJMcabjvBsc/06XKsn39wfdXD11HWffQCK/img.webp&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bkrOVy/dJMcabjvBsc/06XKsn39wfdXD11HWffQCK/img.webp&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbkrOVy%2FdJMcabjvBsc%2F06XKsn39wfdXD11HWffQCK%2Fimg.webp&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;607&quot; data-filename=&quot;하이브리드OCR.webp&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;607&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-path-to-node=&quot;12&quot; data-ke-size=&quot;size23&quot;&gt;&lt;u&gt;AI 답변의 근거를 찾아서: &lt;span style=&quot;color: #333333; text-align: start;&quot;&gt;AI&lt;span&gt; 출처 확인&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; text-align: start;&quot;&gt;&lt;span&gt;(AI Citation)&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/h3&gt;
&lt;p data-path-to-node=&quot;13&quot; data-ke-size=&quot;size16&quot;&gt;AI가 문서 내용을 요약하거나 질문에 답할 때, 가장 큰 걱정은 바로 &lt;b data-index-in-node=&quot;39&quot; data-path-to-node=&quot;13&quot;&gt;'환각(Hallucination)'&lt;/b&gt; 현상입니다. &quot;AI가 그렇게 말하긴 하는데, 문서 어디에 그런 내용이 있죠?&quot;라는 질문에 이제는 시각적으로 답할 수 있습니다.&lt;/p&gt;
&lt;p data-path-to-node=&quot;14&quot; data-ke-size=&quot;size16&quot;&gt;신규 기능인 &lt;b&gt;AI 출처확인&lt;/b&gt;은 text.locateSource() API를 통해 혁신적인 경험을 제공합니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-path-to-node=&quot;15&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;
&lt;div&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;15,0,1,0&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;15,0,1,0&quot;&gt;Claim-to-Source&lt;/b&gt;: AI 답변의 근거가 되는 원문의 좌표(페이지, 위치)를 정확히 찾아냅니다&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;15,0,1,1&quot;&gt;&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;15,0,1,2&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;15,1,1,0&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;15,1,1,0&quot;&gt;시각적 하이라이트&lt;/b&gt;: 답변 내 인용구를 클릭하면 원문 위치로 즉시 스크롤되어 하이라이트 표시됩니다&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;15,1,1,1&quot;&gt;&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;15,1,1,2&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span data-path-to-node=&quot;15,2,1,0&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;15,2,1,0&quot;&gt;&lt;span&gt;신뢰도 극대화&lt;/span&gt;&lt;/b&gt;&lt;span&gt;: 법률, 금융 문서처럼 정확성이 생명인 업무에서 AI 답변을 일일이 대조할 필요 없이 눈으로 즉시 검증할 수 있습니다&lt;/span&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;15,2,1,1&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;15,2,1,2&quot;&gt;.&lt;/span&gt;&lt;span data-path-to-node=&quot;15,2,1,2&quot;&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;15,2,1,2&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;MuPDF WebViewer_AI출처확인.png&quot; data-origin-width=&quot;2533&quot; data-origin-height=&quot;1333&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/b9oUNP/dJMcabw1dm6/3wYcVzPdX3LlWfhrKlcKq1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/b9oUNP/dJMcabw1dm6/3wYcVzPdX3LlWfhrKlcKq1/img.png&quot; data-alt=&quot;AI출처확인 기능으로 오른쪽에 질문에 대해 정확하게 답변의 근거 페이지를 표시하고 해당내용을 하일라이팅&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/b9oUNP/dJMcabw1dm6/3wYcVzPdX3LlWfhrKlcKq1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb9oUNP%2FdJMcabw1dm6%2F3wYcVzPdX3LlWfhrKlcKq1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;2533&quot; height=&quot;1333&quot; data-filename=&quot;MuPDF WebViewer_AI출처확인.png&quot; data-origin-width=&quot;2533&quot; data-origin-height=&quot;1333&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;AI출처확인 기능으로 오른쪽에 질문에 대해 정확하게 답변의 근거 페이지를 표시하고 해당내용을 하일라이팅&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-path-to-node=&quot;17&quot; data-ke-size=&quot;size23&quot;&gt;&lt;u&gt;문맥을 이해하는 지능형 검색과 추출&lt;/u&gt;&lt;/h3&gt;
&lt;p data-path-to-node=&quot;18&quot; data-ke-size=&quot;size16&quot;&gt;MuPDF Web Viewer는 이제 단순한 '뷰어'를 넘어 '문서 지능 솔루션'으로 진화했습니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-path-to-node=&quot;19&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;
&lt;div&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;19,0,1,0&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;19,0,1,0&quot;&gt;시맨틱 서치(Semantic Search)&lt;/b&gt;: 키워드가 정확히 일치하지 않아도 문맥과 의미를 파악해 가장 적절한 정보를 찾아줍니다&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;19,0,1,1&quot;&gt;&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;19,0,1,2&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span data-path-to-node=&quot;19,1,1,0&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;19,1,1,0&quot;&gt;&lt;span&gt;스마트 추출 및 문서 이해&lt;/span&gt;&lt;/b&gt;&lt;span&gt;: 복잡한 표 구조나 비정형 레이아웃에서도 핵심 데이터만 정교하게 뽑아내어 AI 시스템에서 바로 활용할 수 있도록 돕습니다&lt;/span&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;19,1,1,1&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;19,1,1,2&quot;&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-path-to-node=&quot;21&quot; data-ke-size=&quot;size23&quot;&gt;&lt;u&gt;마치며: 문서 AI의 새로운 기준&lt;/u&gt;&lt;/h3&gt;
&lt;p data-path-to-node=&quot;22&quot; data-ke-size=&quot;size16&quot;&gt;이번 업데이트는 단순히 기능을 추가한 것을 넘어, 기업이 보유한 방대한&amp;nbsp; 문서 자산을&lt;b&gt; '가장 효율적이고 믿을 수 있는 데이터'&lt;/b&gt;로 전환하는 데 초점을 맞췄습니다.&lt;/p&gt;
&lt;p id=&quot;p-rc_229c1cda23ed651f-118&quot; data-path-to-node=&quot;23&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span data-path-to-node=&quot;23,0&quot;&gt;&lt;span&gt;누적 다운로드&lt;span&gt; 5억건&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;23,1&quot;&gt;&lt;span&gt;&amp;nbsp;이상의 글로벌 표준 기술력을 바탕으로, 이파피루스는 앞으로도 개발자분들이 더 나은 AI 서비스를 더 쉽게 만들 수 있도록 끊임없이 혁신하겠습니다&lt;/span&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;23,2&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;23,3&quot;&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;h4 data-path-to-node=&quot;24&quot; data-ke-size=&quot;size20&quot;&gt;&lt;i&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;24&quot;&gt;지금 바로 PyMuPDF Pro와 MuPDF Web Viewer의 차이를 경험해 보세요!&lt;/b&gt;&lt;/i&gt;&lt;/h4&gt;
&lt;hr data-path-to-node=&quot;25&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;p data-path-to-node=&quot;26&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;26&quot;&gt;[참고 자료]&lt;/b&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-path-to-node=&quot;27&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;
&lt;div&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;27,0,1,0&quot;&gt;&lt;a href=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;27,0,1,0&quot;&gt;PyMuPDF Pro&lt;/b&gt;&lt;/a&gt;: 전 세계 개발자가 선택한 Python 기반 데이터 추출 라이브러리&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot; data-path-to-node=&quot;27,0,1,1&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span data-path-to-node=&quot;27,1,1,0&quot;&gt;&lt;a href=&quot;https://epapyrus.com/kor/product/sdk/mupdf.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;b data-index-in-node=&quot;0&quot; data-path-to-node=&quot;27,1,1,0&quot;&gt;&lt;span&gt;MuPDF Web Viewer&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span&gt;: 코드 한 줄로 구현하는 고성능 PDF웹 뷰어 SDK&lt;/span&gt;&lt;/span&gt;&lt;span data-path-to-node=&quot;27,1,1,1&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>AI OCR</category>
      <category>AI환각방지</category>
      <category>LLM</category>
      <category>python</category>
      <category>rag</category>
      <category>근거 추적</category>
      <category>문서ai</category>
      <category>업무자동화</category>
      <category>차세대 뷰어</category>
      <category>하이브리드 OCR</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/459</guid>
      <comments>https://epapyrus.tistory.com/459#entry459comment</comments>
      <pubDate>Thu, 9 Apr 2026 10:43:24 +0900</pubDate>
    </item>
    <item>
      <title>[현장스케치] &amp;quot;AI에 진심인 편&amp;quot; 사내 AI 해커톤 뒷이야기  </title>
      <link>https://epapyrus.tistory.com/458</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;안녕하세요! 이파피루스 마케팅팀입니다. &lt;br /&gt;&lt;br /&gt;판교에 벚꽃이 만개하던 지난 4월 4일, 이파피루스 본사에서는 아주 뜨겁고 특별한 이벤트가 열렸습니다. &lt;br /&gt;바로 &amp;lsquo;2026 이파피루스 사내 AI 해커톤 대회&amp;rsquo;**인데요! &lt;br /&gt;&lt;br /&gt;단순히&amp;nbsp;업무의&amp;nbsp;연장이&amp;nbsp;아니라,&amp;nbsp;AI&amp;nbsp;기술로&amp;nbsp;일상의&amp;nbsp;문제를&amp;nbsp;해결하고&amp;nbsp;창의적인&amp;nbsp;아이디어를&amp;nbsp;자유롭게&amp;nbsp;펼쳐&amp;nbsp;보았던&amp;nbsp;이파피루스인들의&amp;nbsp;생생한&amp;nbsp;현장을&amp;nbsp;공개합니다. &lt;br /&gt;&lt;br /&gt;--- &lt;br /&gt;&lt;br /&gt;&lt;b&gt;  &quot;몰입의 즐거움, 아이디어가 현실이 되는 공간&quot; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;행사장은&amp;nbsp;시작&amp;nbsp;전부터&amp;nbsp;팽팽한&amp;nbsp;긴장감과&amp;nbsp;설렘이&amp;nbsp;가득했습니다.&amp;nbsp;이번&amp;nbsp;해커톤의&amp;nbsp;주제는&amp;nbsp;**'AI를&amp;nbsp;활용한&amp;nbsp;업무&amp;nbsp;효율화&amp;nbsp;및&amp;nbsp;서비스&amp;nbsp;혁신'**.&amp;nbsp;개발자뿐만&amp;nbsp;아니라&amp;nbsp;영업,&amp;nbsp;마케팅,&amp;nbsp;인사,&amp;nbsp;재경,&amp;nbsp;총무&amp;nbsp;등&amp;nbsp;다양한&amp;nbsp;직군의&amp;nbsp;팀원들이&amp;nbsp;섞여&amp;nbsp;머리를&amp;nbsp;맞대고&amp;nbsp;아이디어를&amp;nbsp;짜냈습니다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;20260404_181843 (1).jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/TFJd4/dJMcaflRtsx/qRjqN9uDPDPWQDelRxD1e0/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/TFJd4/dJMcaflRtsx/qRjqN9uDPDPWQDelRxD1e0/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/TFJd4/dJMcaflRtsx/qRjqN9uDPDPWQDelRxD1e0/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FTFJd4%2FdJMcaflRtsx%2FqRjqN9uDPDPWQDelRxD1e0%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;4000&quot; height=&quot;3000&quot; data-filename=&quot;20260404_181843 (1).jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;[현장 사진 팀원들이 회의실에 모여 각자 노트북을 켜고 열중하는 모습] &amp;gt; 사진 속 팀원들의 진지한 뒷모습에서 느껴지는 엄청난 열기! 이파피루스인들이 하나에 몰입했을 때 뿜어내는 에너지는 정말 대단합니다.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;  &quot;비용 걱정 없이 마음껏 쓰세요&quot; &amp;ndash; 이파피루스만의 특별한 지원 &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;이번&amp;nbsp;해커톤에서&amp;nbsp;유독&amp;nbsp;수준&amp;nbsp;높은&amp;nbsp;결과물들이&amp;nbsp;쏟아질&amp;nbsp;수&amp;nbsp;있었던&amp;nbsp;비결,&amp;nbsp;궁금하지&amp;nbsp;않으신가요?&amp;nbsp;바로&amp;nbsp;이파피루스만의&amp;nbsp;독보적인&amp;nbsp;**AI&amp;nbsp;친화적&amp;nbsp;사내&amp;nbsp;문화**&amp;nbsp;덕분입니다. &lt;br /&gt;&lt;br /&gt;이파피루스는&amp;nbsp;**전&amp;nbsp;직원에게&amp;nbsp;AI&amp;nbsp;툴&amp;nbsp;활용&amp;nbsp;비용을&amp;nbsp;'무제한'으로&amp;nbsp;지원**하고&amp;nbsp;있습니다. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;* ChatGPT Plus, Claude 3, Copilot 등 유료 AI 모델 결제 지원 &lt;/b&gt;&lt;br /&gt;&lt;b&gt;*&amp;nbsp;업무와&amp;nbsp;자기계발을&amp;nbsp;위한&amp;nbsp;AI&amp;nbsp;도구&amp;nbsp;사용&amp;nbsp;권장 &lt;/b&gt;&lt;br /&gt;&lt;b&gt;*&amp;nbsp;새로운&amp;nbsp;기술을&amp;nbsp;실험하는&amp;nbsp;데&amp;nbsp;드는&amp;nbsp;비용&amp;nbsp;전액&amp;nbsp;지원&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;&quot;비용&amp;nbsp;걱정&amp;nbsp;말고&amp;nbsp;마음껏&amp;nbsp;써보고,&amp;nbsp;실패해도&amp;nbsp;좋으니&amp;nbsp;혁신해보자&quot;는&amp;nbsp;회사의&amp;nbsp;전폭적인&amp;nbsp;지지가&amp;nbsp;있었기에,&amp;nbsp;이번&amp;nbsp;해커톤에서도&amp;nbsp;ChatGPT나&amp;nbsp;다양한&amp;nbsp;LLM을&amp;nbsp;활용한&amp;nbsp;고도화된&amp;nbsp;업무자동화&amp;nbsp;서비스들이&amp;nbsp;탄생할&amp;nbsp;수&amp;nbsp;있었습니다. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;  기술을 넘어 '문화'로 자리 잡은 AI &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;기사에서도&amp;nbsp;언급되었듯,&amp;nbsp;이번&amp;nbsp;대회는&amp;nbsp;단순히&amp;nbsp;기술력을&amp;nbsp;뽐내는&amp;nbsp;자리가&amp;nbsp;아니라&amp;nbsp;**이파피루스가&amp;nbsp;추구하는&amp;nbsp;'AI&amp;nbsp;기반&amp;nbsp;업무&amp;nbsp;혁신'의&amp;nbsp;비전을&amp;nbsp;전&amp;nbsp;직원이&amp;nbsp;체감하는&amp;nbsp;자리**였습니다. &lt;br /&gt;&lt;br /&gt;밤이&amp;nbsp;깊어가는&amp;nbsp;줄도&amp;nbsp;모르고&amp;nbsp;이어지는&amp;nbsp;토론&amp;nbsp;속에서,&amp;nbsp;서로의&amp;nbsp;기술&amp;nbsp;노하우를&amp;nbsp;공유하고&amp;nbsp;함께&amp;nbsp;성장하는&amp;nbsp;모습은&amp;nbsp;이파피루스가&amp;nbsp;왜&amp;nbsp;업계&amp;nbsp;선두를&amp;nbsp;달리고&amp;nbsp;있는지&amp;nbsp;보여주는&amp;nbsp;대목이었습니다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;20260404_203857 (1).jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/mkpwo/dJMcaaLCGs5/eY9OyGkMdx0Kebds0RSJOK/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/mkpwo/dJMcaaLCGs5/eY9OyGkMdx0Kebds0RSJOK/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/mkpwo/dJMcaaLCGs5/eY9OyGkMdx0Kebds0RSJOK/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fmkpwo%2FdJMcaaLCGs5%2FeY9OyGkMdx0Kebds0RSJOK%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;4000&quot; height=&quot;3000&quot; data-filename=&quot;20260404_203857 (1).jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;[현장 사진] &amp;gt; 파이팅 넘치는&amp;nbsp; &lt;span style=&quot;color: #333333; text-align: start;&quot;&gt;대회 종료 후&lt;span&gt; 참가자들의 단체사진&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;--- &lt;br /&gt;&lt;br /&gt;&lt;b&gt;✨ 글을 마치며&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;이파피루스는&amp;nbsp;직원&amp;nbsp;개개인이&amp;nbsp;기술의&amp;nbsp;변화에&amp;nbsp;뒤처지지&amp;nbsp;않고,&amp;nbsp;오히려&amp;nbsp;기술을&amp;nbsp;도구&amp;nbsp;삼아&amp;nbsp;더&amp;nbsp;큰&amp;nbsp;가치를&amp;nbsp;만들&amp;nbsp;수&amp;nbsp;있도록&amp;nbsp;아낌없이&amp;nbsp;지원하고&amp;nbsp;있습니다. &lt;br /&gt;&lt;br /&gt;이번&amp;nbsp;해커톤은&amp;nbsp;끝났지만,&amp;nbsp;우리가&amp;nbsp;만든&amp;nbsp;혁신의&amp;nbsp;씨앗은&amp;nbsp;이제&amp;nbsp;시작입니다.&amp;nbsp;앞으로도&amp;nbsp;AI와&amp;nbsp;함께&amp;nbsp;더&amp;nbsp;스마트하게&amp;nbsp;일하고,&amp;nbsp;더&amp;nbsp;즐겁게&amp;nbsp;소통하는&amp;nbsp;이파피루스의&amp;nbsp;문화를&amp;nbsp;기대해&amp;nbsp;주세요! &lt;br /&gt;&lt;br /&gt;--- &lt;br /&gt;&lt;br /&gt;** &amp;nbsp;관련&amp;nbsp;기사&amp;nbsp;보기:**&amp;nbsp;[이파피루스,&amp;nbsp;전직원&amp;nbsp;AI&amp;nbsp;툴&amp;nbsp;비용&amp;nbsp;전액&amp;nbsp;지원&amp;nbsp;속&amp;nbsp;&amp;lsquo;사내&amp;nbsp;AI&amp;nbsp;코딩&amp;nbsp;해커톤&amp;rsquo;&amp;nbsp;성료&amp;nbsp;(인더스트리뉴스 &lt;br /&gt;&lt;br /&gt;출처&amp;nbsp;:&amp;nbsp;[인더스트리뉴스](&lt;a href=&quot;https://www.industrynews.co.kr/news/articleView.html?idxno=79706)&quot; target=&quot;_blank&quot; rel=&quot;noopener&amp;nbsp;noreferrer&quot;&gt;https://www.industrynews.co.kr/news/articleView.html?idxno=79706)&lt;/a&gt;&lt;/p&gt;</description>
      <category>이파피루스 소식</category>
      <category>#이파피루스 #ePapyrus #사내해커톤 #AI해커톤 #기업문화 #사내복지 #AI무제한지원 #IT기업문화 #일하기좋은회사 #혁신문화 #인공지능 #LLM</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/458</guid>
      <comments>https://epapyrus.tistory.com/458#entry458comment</comments>
      <pubDate>Tue, 7 Apr 2026 13:56:27 +0900</pubDate>
    </item>
    <item>
      <title>PyMuPDF4LLM의 하이브리드 OCR</title>
      <link>https://epapyrus.tistory.com/457</link>
      <description>&lt;div style=&quot;background-color: #ffffff; color: #1d1e1f; text-align: start;&quot;&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1280&quot; data-origin-height=&quot;719&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cTLpRE/dJMcabKxTsq/zgXbOtcsfD0tA5r2bcrOf1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cTLpRE/dJMcabKxTsq/zgXbOtcsfD0tA5r2bcrOf1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cTLpRE/dJMcabKxTsq/zgXbOtcsfD0tA5r2bcrOf1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcTLpRE%2FdJMcabKxTsq%2FzgXbOtcsfD0tA5r2bcrOf1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1280&quot; height=&quot;719&quot; data-origin-width=&quot;1280&quot; data-origin-height=&quot;719&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;정확도는 더 높고 속도는 50% 더 빠릅니다. 실제 PDF 환경에 맞춰 설계되었습니다.&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PyMuPDF4LLM은 PDF 페이지의 전체 텍스트를 추출해야 할 경우에만 OCR을 적용합니다. 페이지에 이미 추출 가능한 텍스트가 충분히 포함되어 있는 경우 OCR은 완전히 건너뛰어 불필요한 작업을 방지하고 고품질 디지털 텍스트의 품질 저하 위험을 제거합니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;OCR이 필요한 경우&lt;span&gt;&amp;nbsp;&lt;/span&gt;,&lt;span&gt;&amp;nbsp;&lt;/span&gt;PyMuPDF4LLM은 런타임 환경에서 사용 가능한 OCR 플러그인 중 가장 적합한 것을 자동으로 선택하여 감지 정확도와 처리 속도 사이의 균형을 유지합니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;내장된 OCR 플러그인은&lt;span&gt;&amp;nbsp;&lt;/span&gt;하이브리드 OCR&lt;span&gt;&amp;nbsp;&lt;/span&gt;전략을 구현합니다. 즉, 추출 가능하고 읽을 수 있는 텍스트가 없는 영역만 OCR 엔진으로 전달합니다. 이러한 선택적 접근 방식은 일반적으로 OCR 처리 시간을 약 50% 단축하는 동시에 인식 정확도를 향상시킵니다. 엔진이 문제가 있는 영역에만 집중하기 때문입니다. 인식된 텍스트는 원래 페이지에 다시 병합되어 기존 디지털 콘텐츠를 손상시키지 않고 페이지를 풍부하게 만듭니다.&lt;/p&gt;
&lt;h2 id=&quot;981746cf2aab&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;하이브리드 OCR은 어떤 문제를 해결하나요?&lt;/b&gt;&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;최신 PDF 파일은 순수한 디지털 파일이나 스캔 파일인 경우가 드뭅니다. 대개 디지털 텍스트, 내장 이미지, 벡터화된 텍스트, 손상된 인코딩, 내장된 OCR 레이어 등 모든 것이 한 페이지에&lt;span&gt;&amp;nbsp;&lt;/span&gt;혼합된 문서&lt;span&gt;&amp;nbsp;&lt;/span&gt;입니다 .&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;기존 OCR 방식은 모든 페이지를 새로운 텍스트 레이어가 추가된 이미지로 변환합니다. 이로 인해 다음과 같은 문제가 발생합니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;b&gt;처리 속도 저하&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;원본 텍스트 품질 손실&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;레이아웃 왜곡&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;이미 읽을 수 있는 텍스트에 불필요한 OCR 처리&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;하이브리드 OCR은 읽을 수 있는 추출 가능한 텍스트가 없는 부분에만&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;OCR을 적용함으로써 이 문제를 해결합니다&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/p&gt;
&lt;h3 id=&quot;140291dd24d0&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;하이브리드 OCR은 전체 페이지 OCR과 어떻게 다른가&lt;/b&gt;&lt;/h3&gt;
&lt;div&gt;전체 페이지 OCR하이브리드 OCR(PyMuPDF4LLM)
&lt;table style=&quot;border-collapse: collapse; width: 100%;&quot; border=&quot;1&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OCR이 페이지 전체를 인식합니다.&lt;/td&gt;
&lt;td&gt;OCR은 추출 가능한 텍스트가 없는 영역만 인식합니다.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;원문을 대체합니다.&lt;/td&gt;
&lt;td&gt;읽을 수 있는 모든 텍스트를 보존합니다.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;더 느리게&lt;/td&gt;
&lt;td&gt;더 빠름 (OCR 작업량 감소)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;레이아웃이 왜곡될 수 있습니다&lt;/td&gt;
&lt;td&gt;원래 레이아웃을 그대로 유지합니다.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;모든 콘텐츠를 픽셀로 변환합니다.&lt;/td&gt;
&lt;td&gt;원본 콘텐츠를 모두 보존합니다.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;하이브리드 OCR은&lt;span&gt;&amp;nbsp;&lt;/span&gt;원본 텍스트와 기타 콘텐츠를 보존하는 것이 필수적인&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;혼합 PDF 에 맞게 설계되었습니다.&lt;/b&gt;&lt;/p&gt;
&lt;h3 id=&quot;f6ca0c7d92c1&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;전체 페이지 OCR과 하이브리드 OCR 벤치마킹&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;전체 페이지 OCR과 하이브리드 OCR의 차이점에 대한 일반적인 고려 사항.&lt;/p&gt;
&lt;div&gt;대본전체 페이지 OCR하이브리드 OCR
&lt;table style=&quot;border-collapse: collapse; width: 100%;&quot; border=&quot;1&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;혼합 PDF&lt;/td&gt;
&lt;td&gt;느린&lt;/td&gt;
&lt;td&gt;빠른&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;스캔 영역이 작은 디지털 PDF 파일입니다.&lt;/td&gt;
&lt;td&gt;매우 느림&lt;/td&gt;
&lt;td&gt;매우 빠름&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;추출 가능한 텍스트, 전체 페이지 이미지 등은 없습니다.&lt;/td&gt;
&lt;td&gt;속도나 품질에 차이가 없습니다.&lt;/td&gt;
&lt;td&gt;속도나 품질에 차이가 없습니다.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;정확성&lt;/td&gt;
&lt;td&gt;아래로 (텍스트를 덮어씁니다)&lt;/td&gt;
&lt;td&gt;더 높은 등급 (텍스트를 보존함)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;속도 향상을 이해하기 위해&lt;span&gt;&amp;nbsp;&lt;/span&gt;미국 양식 10K 보고서의&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;color: #f16625;&quot; href=&quot;https://d18rn0p25nwr6d.cloudfront.net/CIK-0000320193/b4266e40-1de6-4a34-9dfb-8632b8bd57e0.pdf&quot;&gt;예시 페이지(19)에 대한 측정값을 아래에 제시합니다.&lt;/a&gt;&lt;/p&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;766&quot; data-origin-height=&quot;695&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bdtZzi/dJMcah42BpW/CkyM6ZNX3JpOleYjrANABk/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bdtZzi/dJMcah42BpW/CkyM6ZNX3JpOleYjrANABk/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bdtZzi/dJMcah42BpW/CkyM6ZNX3JpOleYjrANABk/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbdtZzi%2FdJMcah42BpW%2FCkyM6ZNX3JpOleYjrANABk%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;766&quot; height=&quot;695&quot; data-origin-width=&quot;766&quot; data-origin-height=&quot;695&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;우리는 Tesseract&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;와&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;RapidOCR이라는&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;OCR 엔진을 사용하여&lt;span&gt;&amp;nbsp;&lt;/span&gt;전체 페이지 OCR 모드와 하이브리드 OCR 모드로 페이지를 처리했습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;또한&lt;span&gt;&amp;nbsp;&lt;/span&gt;두 엔진을&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;결합하여&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;RapidOCR은&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;텍스트&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;감지에만&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;사용하고 (이를 통해 높은 정밀도의 텍스트 줄 경계 상자를 얻을 수 있음)&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;Tesseract&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;는 각 경계 상자 내에서&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;텍스트를 인식하는&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;데 사용했습니다 . 이 접근 방식은&lt;span&gt;&amp;nbsp;&lt;/span&gt;RapidOCR만 사용하는 것보다&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;두 가지 장점이 있습니다. 성능이 더 우수&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;하고&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;속도가 더 빠릅니다.&lt;/p&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li&gt;Tesseract의 텍스트&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;인식 기능은&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;RapidOCR보다 성능이 뛰어나고 속도도 훨씬 빠릅니다.&lt;/li&gt;
&lt;li&gt;RapidOCR의 텍스트 인식 과정이 가장 느린 부분이므로 전반적인 속도가 향상됩니다.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;OCR 엔진전체 페이지 OCR하이브리드 OCR(PyMuPDF4LLM)속도 향상
&lt;table style=&quot;border-collapse: collapse; width: 100%;&quot; border=&quot;1&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;테서랙트&lt;/td&gt;
&lt;td&gt;1.50초&lt;/td&gt;
&lt;td&gt;0.81초&lt;/td&gt;
&lt;td&gt;&amp;uarr; 46.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RapidOCR&lt;/td&gt;
&lt;td&gt;7.24초&lt;/td&gt;
&lt;td&gt;3.70초&lt;/td&gt;
&lt;td&gt;&amp;uarr; 48.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;결합&lt;/td&gt;
&lt;td&gt;5.48초&lt;/td&gt;
&lt;td&gt;2.80초&lt;/td&gt;
&lt;td&gt;&amp;uarr; 48.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;평균&lt;/td&gt;
&lt;td&gt;4.74초&lt;/td&gt;
&lt;td&gt;2.44초&lt;/td&gt;
&lt;td&gt;약 48%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PyMuPDF4LLM은 속도와 품질을 고려하여 RapidOCR과 Tesseract 엔진을 모두 사용할 수 있는 경우 자동으로 두 엔진을 결합합니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PyMuPDF4LLM의 OCR 엔진 호출은 PyMuPDF와의 인터페이스에 필요한 코드를 포함하는 &quot;플러그인&quot;(또는 &quot;어댑터&quot;)으로 래핑됩니다.&lt;/p&gt;
&lt;h2 id=&quot;6fbca9980451&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;OCR이 자동으로 실행될 때&lt;/b&gt;&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PyMuPDF4LLM은 각 페이지를 분석하고 표준 텍스트 추출이 불완전할 경우에만 OCR을 실행합니다.&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;감지 신호는 네 가지가&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;있습니다 .&lt;/p&gt;
&lt;h3 id=&quot;8237b1811bfc&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;이미지 속 텍스트&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;텍스트는 사람이 읽을 수 있지만, 실제로는 픽셀로 구성되어 있습니다. 위 페이지의 이미지가 대표적인 예입니다.&lt;/p&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;296&quot; data-origin-height=&quot;196&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cuC2Hj/dJMcacQbElf/dcpTNkcnh9OChl5h5gceTK/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cuC2Hj/dJMcacQbElf/dcpTNkcnh9OChl5h5gceTK/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cuC2Hj/dJMcacQbElf/dcpTNkcnh9OChl5h5gceTK/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcuC2Hj%2FdJMcacQbElf%2FdcpTNkcnh9OChl5h5gceTK%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;296&quot; height=&quot;196&quot; data-origin-width=&quot;296&quot; data-origin-height=&quot;196&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;추출 결과: 없음.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;페이지 분석기는&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&quot;이미지 텍스트&quot;라는&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;신호를 보냅니다 .&lt;/p&gt;
&lt;h3 id=&quot;3dc976144d65&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;읽을 수 없는 텍스트: 대체 유니코드&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;텍스트는 사람이 읽을 수 있고, PDF 뷰어에서 마우스를 사용하여 복사 붙여넣기가 가능하며 추출도 가능하지만, 추출 결과는 &quot;����&quot;로 나타납니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이는 글꼴이 손상되었거나 글꼴의 역변환 테이블(&quot;글리프 &amp;rarr; 유니코드&quot;)이 실수로든 의도적으로든 누락되거나 불완전한 경우에 발생할 수 있습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;예를 들어, 이 텍스트를 복사하는 경우,&lt;/p&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1280&quot; data-origin-height=&quot;194&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/ATOyB/dJMcah42BpZ/kZOCjn37Ngu0TjNWkK452k/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/ATOyB/dJMcah42BpZ/kZOCjn37Ngu0TjNWkK452k/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/ATOyB/dJMcah42BpZ/kZOCjn37Ngu0TjNWkK452k/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FATOyB%2FdJMcah42BpZ%2FkZOCjn37Ngu0TjNWkK452k%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1280&quot; height=&quot;194&quot; data-origin-width=&quot;1280&quot; data-origin-height=&quot;194&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;hellip;그리고 이를 편집기에 붙여넣으면 다음과 같은 결과가 나타납니다.&lt;/p&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;893&quot; data-origin-height=&quot;52&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/NJPr3/dJMcah42Bp0/vdBolW2hJvGJeUrv6OApF0/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/NJPr3/dJMcah42Bp0/vdBolW2hJvGJeUrv6OApF0/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/NJPr3/dJMcah42Bp0/vdBolW2hJvGJeUrv6OApF0/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FNJPr3%2FdJMcah42Bp0%2FvdBolW2hJvGJeUrv6OApF0%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;893&quot; height=&quot;52&quot; data-origin-width=&quot;893&quot; data-origin-height=&quot;52&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;페이지 분석기가&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&quot;잘못된 문자&quot;를&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;표시합니다 .&lt;/p&gt;
&lt;h3 id=&quot;bfcd385c99f6&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;텍스트처럼 보이는 벡터&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;텍스트는 사람이 읽을 수 있는 형태로 보이지만, 실제로는 문자를&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;모방한&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;벡터로 구성됩니다 . 간단히 설명하자면,&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&quot;/-\|_|_&quot;&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;와 같은 선을 정교하게 그리면 &quot;ALL&quot;이라는 단어처럼 보일 수 있습니다. 예를 들어, 일부 미기재 양식(예: 송장 양식)의 수정 불가능한 텍스트, 텍스트 복사 붙여넣기 방지 등에 사용할 수 있습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이것은 이미지와 마찬가지로 텍스트를 추출하거나 마우스로 선택할 수 없지만, 확대해도 픽셀 단위로 이미지가 깨지는 현상은 나타나지 않습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;다음 예시 페이지에서 텍스트를 추출하면 선택된 부분(노란색)만 반환됩니다. &quot;Lorem ipsum ...&quot; 텍스트는 모두 벡터입니다.&lt;/p&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1280&quot; data-origin-height=&quot;138&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bAFy78/dJMcacQbEly/sBEi3vyN3tEHzpK5zqQOQ0/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bAFy78/dJMcacQbEly/sBEi3vyN3tEHzpK5zqQOQ0/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bAFy78/dJMcacQbEly/sBEi3vyN3tEHzpK5zqQOQ0/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbAFy78%2FdJMcacQbEly%2FsBEi3vyN3tEHzpK5zqQOQ0%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1280&quot; height=&quot;138&quot; data-origin-width=&quot;1280&quot; data-origin-height=&quot;138&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;페이지 분석기는&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&quot;벡터 텍스트&quot;&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;라고 표시합니다 .&lt;/p&gt;
&lt;h3 id=&quot;65358d1b83bb&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;품질이 의심스러운 기존 OCR 텍스트&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PDF 파일에 이미 OCR로 인식된 텍스트가 포함되어 있을 수 있지만, 해당 텍스트가 부정확하거나 손상되었거나 품질이 의심스럽거나 알 수 없는 경우입니다. 다음은 예시 이미지에서 OCR 품질이 좋지 않은 경우를 보여주는 예입니다. 터무니없는 경계 상자와 수많은 비텍스트성 아티팩트가 나타납니다.&lt;/p&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1161&quot; data-origin-height=&quot;771&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dj4N2b/dJMcagdZQr1/AMYx5CjzMhkifbjkcwXwkk/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dj4N2b/dJMcagdZQr1/AMYx5CjzMhkifbjkcwXwkk/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dj4N2b/dJMcagdZQr1/AMYx5CjzMhkifbjkcwXwkk/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fdj4N2b%2FdJMcagdZQr1%2FAMYx5CjzMhkifbjkcwXwkk%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1161&quot; height=&quot;771&quot; data-origin-width=&quot;1161&quot; data-origin-height=&quot;771&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;페이지 분석기가&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&quot;OCR 텍스트&quot;&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;라고 알립니다 .&lt;/p&gt;
&lt;h2 id=&quot;fbf5f85a6d18&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;보존되는 것과 새로 생성되는 것은 무엇인가?&lt;/b&gt;&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;하이브리드 OCR은 다음을 보장합니다:&lt;/p&gt;
&lt;h3 id=&quot;8d42f8203e75&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;보존됨&lt;/b&gt;&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;모든 읽기 쉬운 디지털 텍스트&lt;/li&gt;
&lt;li&gt;원래 레이아웃&lt;/li&gt;
&lt;li&gt;텍스트 글꼴, 크기, 스타일, 색상&lt;/li&gt;
&lt;li&gt;텍스트 장식(밑줄, 취소선)&lt;/li&gt;
&lt;li&gt;기타 콘텐츠(이미지, 벡터)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;22bfab5d0d4d&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;새로 생성된&lt;/b&gt;&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;읽을 수 없는 영역과 판독 불가능한 텍스트에 대한 OCR 텍스트&lt;/li&gt;
&lt;li&gt;바람직하지 않거나 품질이 낮은 OCR 레이어를 대체합니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;병합 단계는&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;원본 텍스트가 OCR 버전으로 대체되는 일이 절대 없도록&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;보장합니다 .&lt;/p&gt;
&lt;h2 id=&quot;11eb9efe1502&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;하이브리드 OCR 파이프라인&lt;/b&gt;&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;다음은 저희 페이지 예시를 사용한 단계별 안내입니다.&lt;/p&gt;
&lt;h3 id=&quot;477a6b81fb7a&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;1단계 &amp;mdash; 페이지 분석&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이 페이지에는 텍스트, 이미지 및 일부 벡터가 포함되어 있으며, 이 벡터들은 표의 격자선과 행 배경 음영을 형성합니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;페이지 분석 결과 추출 가능한 텍스트(가시성을 높이기 위해 빨간색으로 표시됨), 텍스트가 많이 포함된 이미지, 그리고 텍스트 모방 의심을 불러일으키지 않는 몇 가지 벡터가 감지되었습니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;분석기는 &quot;이미지 텍스트&quot;&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;신호를 사용하여 &quot;OCR&quot;을 권장합니다 .&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;712&quot; data-origin-height=&quot;688&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/JRCzt/dJMcacQbElc/LdGH1KATaY4H3ooZLzAs40/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/JRCzt/dJMcacQbElc/LdGH1KATaY4H3ooZLzAs40/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/JRCzt/dJMcacQbElc/LdGH1KATaY4H3ooZLzAs40/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FJRCzt%2FdJMcacQbElc%2FLdGH1KATaY4H3ooZLzAs40%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;712&quot; height=&quot;688&quot; data-origin-width=&quot;712&quot; data-origin-height=&quot;688&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;h3 id=&quot;56cf4ebfc377&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;2단계 &amp;mdash; 페이지의 임시 작업 복사본 만들기&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;선택한 플러그인/어댑터는 페이지의 임시 &quot;스크래치패드&quot; 복사본을 만들고 읽을 수 있는 모든 디지털 텍스트(기존 OCR 텍스트 포함)를 제거합니다. 이미지와 벡터는 그대로 유지됩니다. 표의 격자선과 행 음영을 확인하세요.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;그런 다음 정리된 페이지의 이미지를 생성하고 이를 선택된 OCR 엔진에 전달합니다.&lt;/p&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;708&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bMMz9K/dJMcabKxTsg/lSHPaY4yJyPZHrbD6PUCkk/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bMMz9K/dJMcabKxTsg/lSHPaY4yJyPZHrbD6PUCkk/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bMMz9K/dJMcabKxTsg/lSHPaY4yJyPZHrbD6PUCkk/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbMMz9K%2FdJMcabKxTsg%2FlSHPaY4yJyPZHrbD6PUCkk%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;708&quot; height=&quot;667&quot; data-origin-width=&quot;708&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;h3 id=&quot;5bad70bcaba9&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;3단계 &amp;mdash; 정리된 페이지 사본에 OCR 실행&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;OCR 엔진은 이미지 영역(녹색으로 표시됨)의 텍스트를 인식합니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;플러그인은 다음 단계를 위해 해당 정보를 추출하고 임시 페이지를 삭제합니다.&lt;/p&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;712&quot; data-origin-height=&quot;698&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cDS5e5/dJMcah42BpV/Z086UGLx1YhCzkr7XkNlQ1/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cDS5e5/dJMcah42BpV/Z086UGLx1YhCzkr7XkNlQ1/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cDS5e5/dJMcah42BpV/Z086UGLx1YhCzkr7XkNlQ1/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcDS5e5%2FdJMcah42BpV%2FZ086UGLx1YhCzkr7XkNlQ1%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;712&quot; height=&quot;698&quot; data-origin-width=&quot;712&quot; data-origin-height=&quot;698&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;h3 id=&quot;c2adf3f305cf&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;4단계 &amp;mdash; 원본 페이지에 OCR 텍스트 삽입&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;플러그인은 최종적으로 감지된 좌표에 OCR 텍스트를 삽입합니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;원본 페이지의 읽을 수 있는 텍스트는 그대로 유지됩니다. 특히 표는 전혀 영향을 받지 않았습니다(격자선, 행 배경 및 텍스트는 이전과 동일). 따라서 표 찾기 알고리즘이 표를 완벽하게 인식할 수 있습니다.&lt;/p&gt;
&lt;div&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;715&quot; data-origin-height=&quot;682&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/beB17H/dJMcacQbElv/mMpZ1I9MBOSsemr0lrw6fk/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/beB17H/dJMcacQbElv/mMpZ1I9MBOSsemr0lrw6fk/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/beB17H/dJMcacQbElv/mMpZ1I9MBOSsemr0lrw6fk/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbeB17H%2FdJMcacQbElv%2FmMpZ1I9MBOSsemr0lrw6fk%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;715&quot; height=&quot;682&quot; data-origin-width=&quot;715&quot; data-origin-height=&quot;682&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;마지막 페이지에는 원본 텍스트와 OCR로 인식된 텍스트가 완벽하게 조화되어 있습니다. PyMuPDF4LLM의 레이아웃 모듈과 모든 후속 처리 기능이 이 페이지를 문제없이 사용할 수 있을 것입니다.&lt;/p&gt;
&lt;h2 id=&quot;1d8ed283b770&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;OCR 엔진 선택 가이드&lt;/b&gt;&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PyMuPDF4LLM은 프로그램 초기화 시 내장 플러그인에서 지원하는 OCR 엔진의 사용 가능 여부를 확인하고 가장 적합한 플러그인(어댑터)을 선택합니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;현재 지원되는 엔진에는 Tesseract-OCR과 RapidOCR이 포함됩니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;다음은 선정 과정에서 고려되는 기준입니다.&lt;/p&gt;
&lt;h3 id=&quot;3e0b7c96554a&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;테서랙트 플러그인&lt;/b&gt;&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;라틴어 계열 언어에 대한 최상의 인식 정확도&lt;/li&gt;
&lt;li&gt;텍스트 인식을 위한 강력한 사전 지원&lt;/li&gt;
&lt;li&gt;라틴어 기반 언어의 경우 RapidOCR이나 PaddleOCR보다 훨씬 빠릅니다.&lt;/li&gt;
&lt;li&gt;스캔 품질이 낮으면 텍스트 경계 상자의 정확도가 떨어집니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;&lt;/b&gt;고속 스캔이 필요하고 고품질 스캔이 가능한&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;경우에 사용하십시오 .&lt;/b&gt;&lt;/p&gt;
&lt;h3 id=&quot;bd3f321574d7&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;RapidOCR 플러그인&lt;/b&gt;&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;고품질 텍스트 감지(바운딩 박스)&lt;/li&gt;
&lt;li&gt;강력한 아시아 언어 지원&lt;/li&gt;
&lt;li&gt;CJK가 많이 포함된 문서도 충분히 빠르게 처리할 수 있습니다.&lt;/li&gt;
&lt;li&gt;텍스트&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;인식&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;(단어 분리) 에 빈번한 문제가 발생합니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;사용 시점:&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;속도보다 탐지 정확도가 중요하지만, 인식 품질도 평가해야 할 때&lt;/p&gt;
&lt;h3 id=&quot;a0b74cdc3304&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;결합 엔진 플러그인&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;Tesseract가 설치되어 있고 RapidOCR(또는 PaddleOCR) 중 하나가 사용 가능한 경우, 두 프로그램을 함께 사용하면 적절한 속도로 최상의 품질을 얻을 수 있습니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;텍스트&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;감지&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;에는 RapidOCR 만 사용하십시오. RapidOCR은 적절한 속도로 텍스트 줄에 대한 높은 정밀도의 경계 상자를 제공합니다.&lt;/li&gt;
&lt;li&gt;각 경계 상자에 대해 Tesseract를 사용하여&lt;span&gt;&amp;nbsp;&lt;/span&gt;그 안에 있는 텍스트를&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;인식합니다 .&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;이 방법은 RapidOCR 단독 사용보다 더 나은 품질을 제공하는 동시에 25~50% 더 빠릅니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;사용 시점:&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;적절한 속도로 최상의 품질을 얻고자 할 때. 두 가지 PDF 엔진이 모두 설치된 경우 PyMuPDF4LLM에서 이 옵션을 선택합니다.&lt;/p&gt;
&lt;h2 id=&quot;1cf1f117c935&quot; style=&quot;color: #f16625;&quot; data-ke-size=&quot;size26&quot;&gt;결론&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이 글을 통해 저희 하이브리드 OCR 솔루션이 문서 처리 요구 사항에 속도와 정확성을 모두 제공하는 방법을 보여드렸기를 바랍니다. 저희는 지속적으로 솔루션을 개선하고 발전시켜 나가고 있으니, 여러분의 사용 후기를 기다리겠습니다!&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이 내용이 유용했다면&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;color: #f16625;&quot; href=&quot;https://github.com/pymupdf/pymupdf4llm&quot;&gt;GitHub에서 저희를 찾아주시고&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;, 별(⭐)이나 트윗( )을 남겨주시면 감사하겠습니다!&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>ocr</category>
      <category>pymupdf</category>
      <category>PyMuPDF4LLM</category>
      <category>텍스트 추출</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/457</guid>
      <comments>https://epapyrus.tistory.com/457#entry457comment</comments>
      <pubDate>Mon, 6 Apr 2026 14:11:54 +0900</pubDate>
    </item>
    <item>
      <title>C 엔진(C engine)의 유산을 잇고, 파이썬(Python)다운 사용성까지 챙긴 PyMuPDF Pro</title>
      <link>https://epapyrus.tistory.com/455</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;828&quot; data-origin-height=&quot;552&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/IbOvh/dJMcacWNBUv/y1alwdWpPFQOMoadmwD8r0/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/IbOvh/dJMcacWNBUv/y1alwdWpPFQOMoadmwD8r0/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/IbOvh/dJMcacWNBUv/y1alwdWpPFQOMoadmwD8r0/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FIbOvh%2FdJMcacWNBUv%2Fy1alwdWpPFQOMoadmwD8r0%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;662&quot; height=&quot;442&quot; data-origin-width=&quot;828&quot; data-origin-height=&quot;552&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;table style=&quot;border-collapse: collapse; width: 100%;&quot; border=&quot;1&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;background-color: #f4f8fc;&quot; width=&quot;653&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;PyMuPDF Pro&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;를 조금이라도 써본 개발자라면 한 번쯤 이런 생각을 했을 수 있습니다&lt;span&gt;. &amp;ldquo;&lt;/span&gt;라이브러리 이름은 &lt;span&gt;PyMuPDF Pro&lt;/span&gt;인데&lt;span&gt;, &lt;/span&gt;왜 예전에는&lt;span&gt; import fitz&lt;/span&gt;였지&lt;span&gt;?&amp;rdquo; &lt;/span&gt;이 글은 바로 그 질문에서 출발합니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span&gt;fitz&lt;/span&gt;&lt;span&gt;는 그냥 예전 이름이 아니었습니다&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;PyMuPDF Pro&lt;/span&gt;&lt;span&gt;의 중심에는 &lt;b&gt;MuPDF&lt;/b&gt;라는 &lt;b&gt;C 기반 문서 엔진(C-based document engine)&lt;/b&gt;이 있습니다. MuPDF는 Artifex가 오래 다듬어 온 엔진으로, &lt;b&gt;PDF 렌더링(PDF rendering)&lt;/b&gt;, &lt;b&gt;텍스트 추출(text extraction)&lt;/b&gt;, &lt;b&gt;주석 처리(annotation handling)&lt;/b&gt; 같은 복잡한 작업을 빠르게 처리하는 걸 강점으로 합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;여기서&lt;span&gt; `fitz`&lt;/span&gt;는&lt;span&gt; MuPDF&lt;/span&gt;의 초기 내부 프로젝트 코드명인 &lt;b&gt;&lt;span&gt;Fitz&lt;/span&gt;&lt;/b&gt;에서 나온 이름입니다&lt;span&gt;. &lt;/span&gt;나중에&lt;span&gt; MuPDF&lt;/span&gt;를 파이썬&lt;span&gt;(Python)&lt;/span&gt;에서 쓸 수 있도록 만든 바인딩이 &lt;/span&gt;&lt;span&gt;PyMuPDF Pr&lt;/span&gt;&lt;span&gt;였고&lt;span&gt;, &lt;/span&gt;그 과정에서&lt;span&gt; Python &lt;/span&gt;모듈 이름으로&lt;span&gt; `fitz`&lt;/span&gt;가 그대로 이어졌습니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;즉&lt;span&gt;, `fitz`&lt;/span&gt;는 그냥 어색한&lt;span&gt; import &lt;/span&gt;이름이 아니라&lt;span&gt; &amp;ldquo;&lt;/span&gt;지금 가져오는 이 라이브러리의 진짜 코어&lt;span&gt;(core)&lt;/span&gt;는&lt;span&gt; MuPDF&lt;/span&gt;다&lt;span&gt;&amp;rdquo;&lt;/span&gt;라는 사실을 보여주는 흔적에 가깝습니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span&gt;PyMuPDF&lt;/span&gt;&lt;span&gt; Pro&lt;/span&gt;&lt;span&gt;는 단순한&lt;span&gt; Python PDF &lt;/span&gt;라이브러리가 아닙니다&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;이 부분이 생각보다 중요합니다&lt;span&gt;. &lt;/span&gt;&lt;/span&gt;&lt;span&gt;PyMuPDF Pro&lt;/span&gt;&lt;span&gt;를 그냥&lt;span&gt; &amp;ldquo;Python&lt;/span&gt;으로 만든 &lt;b&gt;&lt;span&gt;PDF &lt;/span&gt;라이브러리&lt;span&gt;(PDF library)&lt;/span&gt;&lt;/b&gt;&lt;span&gt;&amp;rdquo; &lt;/span&gt;정도로만 보면 핵심을 놓치기 쉽습니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;PyMuPDF Pro&lt;/span&gt;&lt;span&gt;는&lt;span&gt; Python&lt;/span&gt;에서 문서 처리 기능을 새로 구현한 도구라기보다&lt;span&gt;, &lt;b&gt;MuPDF&lt;/b&gt;&lt;/span&gt;&lt;b&gt;라는 고성능&lt;span&gt; C &lt;/span&gt;엔진&lt;span&gt;(high-performance C engine)&lt;/span&gt;&lt;/b&gt;을&lt;span&gt; Python&lt;/span&gt;에서 쓰기 좋게 연결한 &lt;b&gt;바인딩&lt;/b&gt;에 더 가깝습니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;개발자는&lt;span&gt; Python &lt;/span&gt;코드로 문서를 열고&lt;span&gt;, &lt;/span&gt;페이지를 읽고&lt;span&gt;, &lt;/span&gt;텍스트를 추출하고&lt;span&gt;, &lt;/span&gt;이미지를 렌더링합니다&lt;span&gt;. &lt;/span&gt;하지만 그 뒤에서 실제로 무거운 일을 하는 건 대부분&lt;span&gt; MuPDF &lt;/span&gt;엔진입니다&lt;span&gt;. &lt;/span&gt;겉으로는 사용하기 편한 &lt;b&gt;&lt;span&gt;Python API&lt;/span&gt;&lt;/b&gt;처럼 보이지만&lt;span&gt;, &lt;/span&gt;실질적인 처리의 중심은 검증된&lt;span&gt; C &lt;/span&gt;엔진에 있는 구조라고 보면 됩니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span&gt;PyMuPDF&lt;/span&gt;&lt;span&gt; Pro&lt;/span&gt;&lt;span&gt;가 빠른 이유도 여기서 나옵니다&lt;/span&gt;&lt;/b&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;C&lt;/span&gt;&lt;span&gt;가 성능에 강하다는 건 업계에서는 거의 상식에 가깝습니다&lt;span&gt;. &lt;/span&gt;일론 머스크의 로켓이나 위성만 봐도&lt;span&gt;, &lt;/span&gt;성능이 핵심인 영역에서는 왜 이런 선택이 나오는지 꽤 직관적으로 이해할 수 있습니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;828&quot; data-origin-height=&quot;720&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/pft1r/dJMcagkA1kZ/2nKOOFPO3d9e6ywGY4t4Qk/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/pft1r/dJMcagkA1kZ/2nKOOFPO3d9e6ywGY4t4Qk/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/pft1r/dJMcagkA1kZ/2nKOOFPO3d9e6ywGY4t4Qk/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fpft1r%2FdJMcagkA1kZ%2F2nKOOFPO3d9e6ywGY4t4Qk%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;662&quot; height=&quot;576&quot; data-origin-width=&quot;828&quot; data-origin-height=&quot;720&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;PyMuPDF Pro&lt;/span&gt;&lt;span&gt;를 이야기할 때 거의 빠지지 않는 장점이 성능입니다&lt;span&gt;. &lt;/span&gt;실제로 &lt;b&gt;문서 렌더링&lt;span&gt;(document rendering)&lt;/span&gt;&lt;/b&gt;이나 &lt;b&gt;&lt;span&gt;PDF &lt;/span&gt;텍스트 추출&lt;span&gt;(PDF text extraction)&lt;/span&gt;&lt;/b&gt;&lt;span&gt; &lt;/span&gt;같은 작업에서 속도 차이를 체감하는 경우가 많습니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;이 성능은&lt;span&gt; Python &lt;/span&gt;자체에서 나오는 게 아니라 &lt;b&gt;&lt;span&gt;MuPDF&lt;/span&gt;의&lt;span&gt; C &lt;/span&gt;엔진&lt;span&gt;(C engine)&lt;/span&gt;&lt;/b&gt;에서 나옵니다&lt;span&gt;. &lt;/span&gt;페이지를 &lt;b&gt;픽스맵&lt;span&gt;(pixmap)&lt;/span&gt;&lt;/b&gt;으로 렌더링하거나&lt;span&gt;, &lt;/span&gt;좌표 정보와 함께 텍스트를 추출하거나&lt;span&gt;, &lt;/span&gt;폰트&lt;span&gt;&amp;middot;&lt;/span&gt;색상&lt;span&gt;&amp;middot;&lt;/span&gt;투명도 같은 요소를 처리하는 작업은 계산량이 적지 않습니다&lt;span&gt;. &lt;/span&gt;&lt;/span&gt;&lt;span&gt;PyMuPDF Pro&lt;/span&gt;&lt;span&gt;는 이런 부분을&lt;span&gt; Python&lt;/span&gt;으로 다시 구현하지 않고&lt;span&gt; MuPDF&lt;/span&gt;가 직접 처리하도록 설계돼 있습니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;그래서 &lt;/span&gt;&lt;span&gt;PyMuPDF Pro&lt;/span&gt;&lt;span&gt;는&lt;span&gt; &amp;ldquo;Python &lt;/span&gt;라이브러리치고 빠르다&lt;span&gt;&amp;rdquo;&lt;/span&gt;기보다&lt;span&gt;, &lt;/span&gt;&lt;b&gt;고성능&lt;span&gt; C &lt;/span&gt;엔진의 성능을&lt;span&gt; Python&lt;/span&gt;에서 거의 그대로 활용할 수 있어서 빠르다&lt;/b&gt;고 보는 편이 더 정확합니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span&gt;import pymupdf&lt;/span&gt;&lt;span&gt;로 바뀌어도 본질은 그대로입니다&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;최근에는&lt;span&gt; `import pymupdf`&lt;/span&gt;가 더 기본적인 방식으로 자리 잡고 있습니다&lt;span&gt;. &lt;/span&gt;처음 쓰는 사람 입장에서는&lt;span&gt; `fitz`&lt;/span&gt;보다 훨씬 직관적이고 이해하기 쉽기 때문입니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;이 변화는 분명 좋은 방향입니다&lt;span&gt;. &lt;/span&gt;특히 파이썬 기반&lt;span&gt; PDF &lt;/span&gt;처리&lt;span&gt;(&lt;b&gt;Python PDF processing)&lt;/b&gt;, PDF &lt;/span&gt;구조 해석&lt;b&gt;&lt;span&gt;(PDF parsing)&lt;/span&gt;&lt;/b&gt;&lt;span&gt;, &lt;/span&gt;문서 처리&lt;b&gt;&lt;span&gt;(document processing)&lt;/span&gt;&lt;/b&gt;&lt;span&gt; &lt;/span&gt;같은 키워드로&lt;span&gt; PyMuPDF&lt;/span&gt;를 처음 접하는 사람에게는 훨씬 친절한 진입점이 됩니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;다만 이름이 바뀌었다고 해서 라이브러리의 본질까지 달라진 건 아닙니다&lt;span&gt;. &lt;/span&gt;여전히&lt;span&gt; PyMuPDF&lt;/span&gt;의 핵심은&lt;span&gt; MuPDF &lt;/span&gt;엔진 위에 있고&lt;span&gt;, `fitz`&lt;/span&gt;라는 이름은 그 구조적 배경을 보여주는 역사적인 흔적으로 남아 있습니다&lt;span&gt;. &lt;/span&gt;이름은 더 친절해졌지만&lt;span&gt;, &lt;/span&gt;성능과 설계 철학은 그대로라는 뜻입니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;&lt;span&gt;이 구조를 알면 &lt;/span&gt;&lt;span&gt;PyMuPDF&lt;/span&gt;&lt;span&gt; Pro&lt;/span&gt;&lt;span&gt;를 보는 관점도 달라집니다&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;문서 처리 도구를 볼 때 보통은 예제 코드가 쉬운지&lt;span&gt;, API&lt;/span&gt;가 깔끔한지부터 보게 됩니다&lt;span&gt;. &lt;/span&gt;물론 그것도 중요합니다&lt;span&gt;. &lt;/span&gt;하지만 실제 프로젝트에서는 &lt;b&gt;속도&lt;span&gt;(performance)&lt;/span&gt;&lt;/b&gt;&lt;span&gt;, &lt;/span&gt;&lt;b&gt;정확도&lt;span&gt;(accuracy)&lt;/span&gt;&lt;/b&gt;&lt;span&gt;, &lt;/span&gt;&lt;b&gt;안정성&lt;span&gt;(stability)&lt;/span&gt;&lt;/b&gt;&lt;span&gt; &lt;/span&gt;같은 요소가 훨씬 크게 작용합니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;PDF&lt;/span&gt;&lt;span&gt;는 생각보다 단순한 포맷이 아닙니다&lt;span&gt;. &lt;/span&gt;텍스트만 읽는 문제가 아니라 레이아웃&lt;span&gt;, &lt;/span&gt;폰트&lt;span&gt;, &lt;/span&gt;이미지&lt;span&gt;, &lt;/span&gt;주석&lt;span&gt;, &lt;/span&gt;렌더링 규칙까지 복잡하게 얽혀 있습니다&lt;span&gt;. &lt;/span&gt;그래서 &lt;b&gt;&lt;span&gt;PDF&lt;/span&gt;파서&lt;span&gt;(PDF parser), &lt;/span&gt;문서엔진&lt;span&gt;(document engine), &lt;/span&gt;텍스트 추출 엔진&lt;span&gt;(text extraction engine)&lt;/span&gt;&lt;/b&gt;&lt;span&gt; &lt;/span&gt;같은 기반 기술의 완성도가 중요합니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;PyMuPDF Pro&lt;/span&gt;&lt;span&gt;의 강점은 바로 여기에 있습니다&lt;span&gt;. Python&lt;/span&gt;에서는 사용하기 쉽게 보이지만&lt;span&gt;, &lt;/span&gt;내부적으로는 실전에서 오래 다듬어진&lt;span&gt; MuPDF &lt;/span&gt;엔진을 그대로 활용합니다&lt;span&gt;. &lt;/span&gt;즉&lt;span&gt;, &lt;/span&gt;사용성은&lt;span&gt; Python&lt;/span&gt;답게 가져가고&lt;span&gt;, &lt;/span&gt;실제 처리 품질과 성능은&lt;span&gt; C &lt;/span&gt;엔진 수준으로 가져가는 구조라고 볼 수 있습니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h4 data-ke-size=&quot;size20&quot;&gt;&lt;b&gt;&lt;span&gt;마무리&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;`fitz`&lt;/span&gt;&lt;span&gt;는 단순히 예전&lt;span&gt; import &lt;/span&gt;이름이 아닙니다&lt;span&gt;. &lt;/span&gt;그 이름은 &lt;/span&gt;&lt;span&gt;PyMuPDF Pro&lt;/span&gt;&lt;span&gt;가 어디서 출발했는지&lt;span&gt;, &lt;/span&gt;그리고 왜 지금도 강력한 &lt;b&gt;문서 처리 도구&lt;span&gt;(document processing tool)&lt;/span&gt;&lt;/b&gt;로 평가받는지를 보여주는 작은 단서입니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;PyMuPDF Pro&lt;/span&gt;&lt;span&gt;의 경쟁력은 단순히&lt;span&gt; API&lt;/span&gt;가 편해서만 나오지 않습니다&lt;span&gt;. &lt;/span&gt;그 뒤에서 복잡한 문서 처리를 맡는 &lt;b&gt;&lt;span&gt;MuPDF&lt;/span&gt;의&lt;span&gt; C &lt;/span&gt;엔진&lt;/b&gt;&lt;span&gt;, &lt;/span&gt;그리고 그 엔진을&lt;span&gt; Python&lt;/span&gt;에서 자연스럽게 활용할 수 있게 만든 설계가 핵심입니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;결국 이 글이 말하는 포인트는 분명합니다&lt;span&gt;. &lt;/span&gt;&lt;/span&gt;&lt;span&gt;PyMuPDF Pro&lt;/span&gt;&lt;span&gt;는 그냥 쓰기 쉬운 파이썬&lt;span&gt; PDF &lt;/span&gt;라이브러리&lt;span&gt;(&lt;b&gt;Python PDF library)&lt;/b&gt;&lt;/span&gt;가 아니라&lt;span&gt;, &lt;/span&gt;&lt;b&gt;검증된&lt;span&gt; C &lt;/span&gt;엔진의 성능을&lt;span&gt; Python&lt;/span&gt;다운 방식으로 끌어온 문서 처리 라이브러리&lt;span&gt;(document processing library)&lt;/span&gt;&lt;/b&gt;라는 점입니다&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span&gt;&lt;a href=&quot;https://epapyrus.com/kor/support/contact.php&quot;&gt;&lt;b&gt;&lt;span&gt;&lt;span&gt;문의하기 &amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;&lt;span&gt;&lt;a href=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot;&gt;PyMuPDF Pro &lt;span&gt;&lt;span&gt;제품소개페이지&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;바로가기 &amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>C엔진</category>
      <category>pdf추출</category>
      <category>PDF파서</category>
      <category>PyMuPDFPro</category>
      <category>파이썬라이브러리</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/455</guid>
      <comments>https://epapyrus.tistory.com/455#entry455comment</comments>
      <pubDate>Thu, 26 Mar 2026 13:45:41 +0900</pubDate>
    </item>
    <item>
      <title>왜 데이터 청킹(Data Chunking)이 LLM 처리에서 필수적일까</title>
      <link>https://epapyrus.tistory.com/454</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1000&quot; data-origin-height=&quot;562&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bnL9JP/dJMcabJ7kiT/hWNnHCPkMUxgArrq0YNeR1/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bnL9JP/dJMcabJ7kiT/hWNnHCPkMUxgArrq0YNeR1/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bnL9JP/dJMcabJ7kiT/hWNnHCPkMUxgArrq0YNeR1/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbnL9JP%2FdJMcabJ7kiT%2FhWNnHCPkMUxgArrq0YNeR1%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1000&quot; height=&quot;562&quot; data-origin-width=&quot;1000&quot; data-origin-height=&quot;562&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-end=&quot;17&quot; data-start=&quot;0&quot; data-ke-size=&quot;size26&quot;&gt;컨텍스트 윈도우의 한계&lt;/h2&gt;
&lt;p data-end=&quot;187&quot; data-start=&quot;19&quot; data-ke-size=&quot;size16&quot;&gt;모든 LLM에는 한 번에 처리할 수 있는 최대 텍스트 길이, 즉 **컨텍스트 윈도우(context window)**가 존재합니다. 최신 모델들은 100,000토큰을 넘는 긴 컨텍스트를 지원하기도 하지만, 문서 전체나 데이터베이스를 그대로 모델에 입력한다고 해서 항상 좋은 결과가 나오지는 않습니다.&lt;/p&gt;
&lt;p data-end=&quot;256&quot; data-start=&quot;189&quot; data-ke-size=&quot;size16&quot;&gt;컨텍스트가 길어질수록 모델이 그 안에서 &lt;b&gt;정말 중요한 정보를 정확히 찾아내는 능력은 오히려 떨어질 수 있습니다.&lt;/b&gt;&lt;/p&gt;
&lt;p data-end=&quot;346&quot; data-start=&quot;258&quot; data-ke-size=&quot;size16&quot;&gt;이때 데이터 청킹(chunking)이 큰 역할을 합니다. 콘텐츠를 논리적인 단위로 나누면, 모델은 불필요한 정보 없이 필요한 부분만 전달받을 수 있습니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;367&quot; data-start=&quot;353&quot; data-ke-size=&quot;size26&quot;&gt;검색 정확도 향상&lt;/h2&gt;
&lt;p data-end=&quot;442&quot; data-start=&quot;369&quot; data-ke-size=&quot;size16&quot;&gt;RAG(Retrieval-Augmented Generation) 시스템에서는 청킹 방식이 검색 품질에 직접적인 영향을 미칩니다.&lt;/p&gt;
&lt;p data-end=&quot;534&quot; data-start=&quot;444&quot; data-ke-size=&quot;size16&quot;&gt;문서 전체를 임베딩하는 대신, &lt;b&gt;작고 집중된 청크 단위로 임베딩하고 인덱싱하면&lt;/b&gt;, 벡터 데이터베이스는 사용자 질문에 훨씬 더 정확하게 대응할 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;609&quot; data-start=&quot;536&quot; data-ke-size=&quot;size16&quot;&gt;예를 들어 &amp;ldquo;분기별 매출 성장&amp;rdquo;에 대한 정보를 찾는다면, 연간 보고서 전체보다 해당 내용이 담긴 청크 하나가 훨씬 효과적입니다.&lt;/p&gt;
&lt;p data-end=&quot;702&quot; data-start=&quot;611&quot; data-ke-size=&quot;size16&quot;&gt;도서관에 비유하자면, 필요한 정보를 찾을 때 매번 백과사전 전체를 뒤지는 것보다 특정 장(chapter) 단위로 정리된 자료를 검색하는 것이 훨씬 효율적입니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;741&quot; data-start=&quot;709&quot; data-ke-size=&quot;size26&quot;&gt;의미적 일관성(Semantic Coherence)&lt;/h2&gt;
&lt;p data-end=&quot;776&quot; data-start=&quot;743&quot; data-ke-size=&quot;size16&quot;&gt;좋은 청킹 전략은 콘텐츠의 자연스러운 구조를 존중합니다.&lt;/p&gt;
&lt;p data-end=&quot;846&quot; data-start=&quot;778&quot; data-ke-size=&quot;size16&quot;&gt;문단, 섹션, 주제 전환 지점과 같은 &lt;b&gt;논리적 경계&lt;/b&gt;에서 텍스트를 나누면, 각 청크 안에 의미가 온전히 보존됩니다.&lt;/p&gt;
&lt;p data-end=&quot;919&quot; data-start=&quot;848&quot; data-ke-size=&quot;size16&quot;&gt;생각이 중간에 끊기거나 서로 관련 없는 주제가 섞인 청크보다, 하나의 완결된 개념을 담은 청크가 LLM에게 훨씬 유용합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;942&quot; data-start=&quot;926&quot; data-ke-size=&quot;size26&quot;&gt;비용 및 성능 최적화&lt;/h2&gt;
&lt;p data-end=&quot;990&quot; data-start=&quot;944&quot; data-ke-size=&quot;size16&quot;&gt;청킹을 활용하면 LLM에 전달하는 데이터 범위를 선택적으로 제한할 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;1056&quot; data-start=&quot;992&quot; data-ke-size=&quot;size16&quot;&gt;예를 들어 단순한 질문에 대해 50페이지 문서 전체를 처리하는 대신, 관련된 2~3개의 청크만 전달하면 됩니다.&lt;/p&gt;
&lt;p data-end=&quot;1154&quot; data-start=&quot;1058&quot; data-ke-size=&quot;size16&quot;&gt;이 방식은 API 비용과 지연 시간을 동시에 줄여줍니다. 수천 건의 질의가 쌓이면, 이는 단순한 최적화를 넘어 &lt;b&gt;서비스의 실용성과 경제성을 좌우하는 요소&lt;/b&gt;가 됩니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;1176&quot; data-start=&quot;1161&quot; data-ke-size=&quot;size26&quot;&gt;효과적인 청킹 전략&lt;/h2&gt;
&lt;p data-end=&quot;1211&quot; data-start=&quot;1178&quot; data-ke-size=&quot;size16&quot;&gt;청킹 방식은 콘텐츠 유형과 사용 목적에 따라 달라집니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1382&quot; data-start=&quot;1213&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1266&quot; data-start=&quot;1213&quot;&gt;&lt;b&gt;고정 크기 청킹(Fixed-size chunking)&lt;/b&gt;: 구현이 간단하고 예측 가능&lt;/li&gt;
&lt;li data-end=&quot;1337&quot; data-start=&quot;1267&quot;&gt;&lt;b&gt;의미 기반 청킹(Semantic chunking)&lt;/b&gt;: 주제 변화나 의미 단위에 따라 분할하며 더 정교한 결과 제공&lt;/li&gt;
&lt;li data-end=&quot;1382&quot; data-start=&quot;1338&quot;&gt;&lt;b&gt;하이브리드 방식&lt;/b&gt;: 크기 제한과 의미 경계를 함께 고려해 균형 유지&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1458&quot; data-start=&quot;1384&quot; data-ke-size=&quot;size16&quot;&gt;가장 중요한 것은 실제 데이터에 대해 다양한 전략을 테스트하고, 사용자 요구에 얼마나 잘 부합하는지 지속적으로 확인하는 것입니다.&lt;/p&gt;
&lt;p data-end=&quot;1533&quot; data-start=&quot;1460&quot; data-ke-size=&quot;size16&quot;&gt;데이터 청킹은 눈에 띄는 작업은 아니지만, 실제 프로덕션 환경에서 LLM 애플리케이션이 제대로 동작하게 만드는 핵심 기반입니다.&lt;/p&gt;
&lt;p data-end=&quot;1533&quot; data-start=&quot;1460&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;1567&quot; data-start=&quot;1540&quot; data-ke-size=&quot;size26&quot;&gt;PyMuPDF Layout을 활용한 청킹&lt;/h2&gt;
&lt;p data-end=&quot;1660&quot; data-start=&quot;1569&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF4LLM 0.2.7 이상 버전에서 &lt;b&gt;PyMuPDF Layout&lt;/b&gt;을 사용하면 페이지 기반 청킹(page-based chunking)을 지원합니다.&lt;/p&gt;
&lt;p data-end=&quot;1709&quot; data-start=&quot;1662&quot; data-ke-size=&quot;size16&quot;&gt;페이지 단위로 분할된 각 청크는 다음 정보를 포함하는 딕셔너리 형태로 반환됩니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1802&quot; data-start=&quot;1711&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1735&quot; data-start=&quot;1711&quot;&gt;Markdown 형식의 페이지 텍스트&lt;/li&gt;
&lt;li data-end=&quot;1748&quot; data-start=&quot;1736&quot;&gt;문서 메타데이터&lt;/li&gt;
&lt;li data-end=&quot;1770&quot; data-start=&quot;1749&quot;&gt;식별된 페이지 영역(boxes)&lt;/li&gt;
&lt;li data-end=&quot;1802&quot; data-start=&quot;1771&quot;&gt;(옵션) Markdown이 아닌 일반 텍스트 버전&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1860&quot; data-start=&quot;1804&quot; data-ke-size=&quot;size16&quot;&gt;to_markdown() 대신 to_text()를 사용하면 일반 텍스트 출력도 가능합니다.&lt;/p&gt;
&lt;pre id=&quot;code_1772528881748&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;import sys
import pymupdf.layout
import pymupdf4llm
import json
from pathlib import Path
filename = sys.argv[1]
chunks = pymupdf4llm.to_markdown(
    filename,
    page_chunks=True,
    show_progress=True,
)
js = json.dumps(chunks)
Path(filename).with_suffix(&quot;.chunks.json&quot;).write_text(js)&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;1892&quot; data-start=&quot;1867&quot; data-ke-size=&quot;size26&quot;&gt;의미 기반 정보(page_boxes)&lt;/h2&gt;
&lt;p data-end=&quot;1948&quot; data-start=&quot;1894&quot; data-ke-size=&quot;size16&quot;&gt;페이지 청킹을 사용할 경우, 출력 데이터에는 page_boxes라는 추가 키가 포함됩니다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1156&quot; data-origin-height=&quot;1578&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/oHnBa/dJMb99S1YNq/GirZZe3DjmFi1HhiKLYQzK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/oHnBa/dJMb99S1YNq/GirZZe3DjmFi1HhiKLYQzK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/oHnBa/dJMb99S1YNq/GirZZe3DjmFi1HhiKLYQzK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FoHnBa%2FdJMb99S1YNq%2FGirZZe3DjmFi1HhiKLYQzK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1156&quot; height=&quot;1578&quot; data-origin-width=&quot;1156&quot; data-origin-height=&quot;1578&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-end=&quot;2000&quot; data-start=&quot;1950&quot; data-ke-size=&quot;size16&quot;&gt;이 항목에는 페이지 내에서 &lt;b&gt;의미적으로 식별된 섹션 목록&lt;/b&gt;이 담깁니다. 예를 들어:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;2053&quot; data-start=&quot;2002&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;2012&quot; data-start=&quot;2002&quot;&gt;페이지 헤더&lt;/li&gt;
&lt;li data-end=&quot;2022&quot; data-start=&quot;2013&quot;&gt;섹션 제목&lt;/li&gt;
&lt;li data-end=&quot;2029&quot; data-start=&quot;2023&quot;&gt;캡션&lt;/li&gt;
&lt;li data-end=&quot;2040&quot; data-start=&quot;2030&quot;&gt;본문 텍스트&lt;/li&gt;
&lt;li data-end=&quot;2053&quot; data-start=&quot;2041&quot;&gt;표(Table)&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2104&quot; data-start=&quot;2055&quot; data-ke-size=&quot;size16&quot;&gt;이 정보를 활용하면 LLM에 전달할 데이터 범위를 더욱 정밀하게 제어할 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;2158&quot; data-start=&quot;2106&quot; data-ke-size=&quot;size16&quot;&gt;예를 들어 특정 페이지에만 중요한 재무 정보가 있다면, 그 페이지 청크만 전달하면 됩니다.&lt;/p&gt;
&lt;p data-end=&quot;2205&quot; data-start=&quot;2160&quot; data-ke-size=&quot;size16&quot;&gt;혹은 표 데이터만 필요하다면, 해당 표 데이터만 선택적으로 보낼 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;2241&quot; data-start=&quot;2207&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;문서 전체를 보내지 말고, 필요한 청크만 보내세요.&lt;/b&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div data-message-model-slug=&quot;gpt-5-2&quot; data-message-id=&quot;1cdff46f-71b2-4dd9-bb57-6adeaeca4aa1&quot; data-message-author-role=&quot;assistant&quot;&gt;
&lt;div&gt;
&lt;div&gt;
&lt;h2 data-end=&quot;2255&quot; data-start=&quot;2248&quot; data-ke-size=&quot;size26&quot;&gt;결론&lt;/h2&gt;
&lt;p data-end=&quot;2325&quot; data-start=&quot;2257&quot; data-ke-size=&quot;size16&quot;&gt;데이터 청킹은 단순한 기술적 디테일처럼 보일 수 있지만, LLM 애플리케이션 설계에서 가장 중요한 결정 중 하나입니다.&lt;/p&gt;
&lt;p data-end=&quot;2354&quot; data-start=&quot;2327&quot; data-ke-size=&quot;size16&quot;&gt;적절한 크기와 의미 단위로 콘텐츠를 분할하면:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;2399&quot; data-start=&quot;2356&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;2369&quot; data-start=&quot;2356&quot;&gt;검색 정확도 향상&lt;/li&gt;
&lt;li data-end=&quot;2379&quot; data-start=&quot;2370&quot;&gt;의미 보존&lt;/li&gt;
&lt;li data-end=&quot;2389&quot; data-start=&quot;2380&quot;&gt;비용 절감&lt;/li&gt;
&lt;li data-end=&quot;2399&quot; data-start=&quot;2390&quot;&gt;성능 개선&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2421&quot; data-start=&quot;2401&quot; data-ke-size=&quot;size16&quot;&gt;이라는 효과를 얻을 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;2469&quot; data-start=&quot;2423&quot; data-ke-size=&quot;size16&quot;&gt;간단한 방식으로 시작해보고, 실제 결과를 측정한 뒤 점진적으로 개선해 나가세요.&lt;/p&gt;
&lt;p data-end=&quot;2535&quot; data-start=&quot;2471&quot; data-ke-size=&quot;size16&quot;&gt;그리고 기억하세요.&lt;br /&gt;&lt;b&gt;비용을 줄이고 효율을 높이려면, 문서 전체가 아니라 필요한 청크만 보내야 합니다.&lt;/b&gt;&lt;/p&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;2620&quot; data-start=&quot;2537&quot; data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://demo.pymupdf.io/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;PyMuPDF Layout 데모&lt;/a&gt;를 통해 더 많은 기능을 확인해 보세요.&lt;br /&gt;자세한 내용은 &lt;a href=&quot;https://pymupdf.readthedocs.io/en/latest/pymupdf-layout/index.html?_gl=1*93jb5p*_ga*MTU2NTUyOTIzMy4xNzcyNTI4MTU5*_ga_JZTN4VTL9M*czE3NzI1MjgxNTkkbzEkZzEkdDE3NzI1Mjg5ODIkajYwJGwwJGgw&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;PyMuPDF Layout 공식 문서&lt;/a&gt;를 참고하시기 바랍니다.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot; data-start=&quot;2439&quot; data-end=&quot;2499&quot;&gt;&lt;a href=&quot;https://epapyrus.com/kor/support/contact.php&quot;&gt;&lt;b&gt;라이브 데모 신청하러가기 &amp;gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot; data-start=&quot;2439&quot; data-end=&quot;2499&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://epapyrus.tistory.com/443&quot;&gt;PyMuPDF-Layout 가이드 자세히 보기 &amp;gt;&amp;nbsp;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot;&gt;PyMuPDF Pro 제품소개페이지 바로가기 &amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>Ai</category>
      <category>AI데이터</category>
      <category>AI학습</category>
      <category>LLM</category>
      <category>LLM데이터</category>
      <category>LLM학습</category>
      <category>PDF데이터</category>
      <category>pdf추출</category>
      <category>문서파싱</category>
      <category>파이썬라이브러리</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/454</guid>
      <comments>https://epapyrus.tistory.com/454#entry454comment</comments>
      <pubDate>Tue, 3 Mar 2026 18:11:54 +0900</pubDate>
    </item>
    <item>
      <title>PyMuPDF Layout 튜토리얼 &amp;mdash; 시작하기</title>
      <link>https://epapyrus.tistory.com/452</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;b78229852beeca9da7450a455a819104153d02d2-880x495.webp&quot; data-origin-width=&quot;828&quot; data-origin-height=&quot;466&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/eqEjER/dJMb99L3vMJ/tYaCiDpdVqpwFmlKE0y9J0/img.webp&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/eqEjER/dJMb99L3vMJ/tYaCiDpdVqpwFmlKE0y9J0/img.webp&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/eqEjER/dJMb99L3vMJ/tYaCiDpdVqpwFmlKE0y9J0/img.webp&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FeqEjER%2FdJMb99L3vMJ%2FtYaCiDpdVqpwFmlKE0y9J0%2Fimg.webp&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;828&quot; height=&quot;466&quot; data-filename=&quot;b78229852beeca9da7450a455a819104153d02d2-880x495.webp&quot; data-origin-width=&quot;828&quot; data-origin-height=&quot;466&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;안녕하세요, 이파피루스입니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이번 포스팅은 PyMuPDF Layout을 사용하는 가장 기초적인 워크플로우를 설명합니다.&lt;br /&gt;Python과 커맨드라인 사용 경험, PyPI 패키지 설치 경험이 있으면 쉽게 따라올 수 있어요.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;516&quot; data-start=&quot;505&quot; data-ke-size=&quot;size26&quot;&gt;1️⃣ 설치하기&lt;/h2&gt;
&lt;p data-end=&quot;557&quot; data-start=&quot;518&quot; data-ke-size=&quot;size16&quot;&gt;먼저 필요한 패키지를 설치합니다. 터미널에서 아래 명령어를 실행하세요:&lt;/p&gt;
&lt;pre id=&quot;code_1770878631757&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;pip install pymupdf-layout
pip install pymupdf4llm&lt;/code&gt;&lt;/pre&gt;
&lt;p data-end=&quot;771&quot; data-start=&quot;623&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Layout은 &lt;b&gt;레이아웃을 감지/분석&lt;/b&gt;하는 역할을 하고,&lt;br /&gt;PyMuPDF4LLM은 그 결과를 &lt;b&gt;Markdown, JSON, 텍스트 같은 출력 형태로 변환&lt;/b&gt;하는 역할을 합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;805&quot; data-start=&quot;778&quot; data-ke-size=&quot;size26&quot;&gt;2️⃣ PyMuPDF Layout 주요 기능&lt;/h2&gt;
&lt;p data-end=&quot;845&quot; data-start=&quot;807&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Layout으로 할 수 있는 일은 크게 두 가지입니다:&lt;/p&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-end=&quot;1043&quot; data-start=&quot;847&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li data-end=&quot;929&quot; data-start=&quot;847&quot;&gt;&lt;b&gt;문서에서 구조화된 데이터(텍스트, 표, 리스트 등)을 추출&lt;/b&gt;&lt;br /&gt;&amp;rarr; Markdown, JSON, plain text로 저장 가능&lt;/li&gt;
&lt;li data-end=&quot;1043&quot; data-start=&quot;930&quot;&gt;&lt;b&gt;문서 파싱 시 헤더와 푸터를 포함하거나 제외할 수 있음&lt;/b&gt;&lt;br /&gt;&amp;rarr; 반복적인 헤더/푸터 같은 불필요 요소도 쉽게 무시 가능&lt;/li&gt;
&lt;/ol&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;1074&quot; data-start=&quot;1050&quot; data-ke-size=&quot;size26&quot;&gt;3️⃣ Python 코드로 PDF 열기&lt;/h2&gt;
&lt;p data-end=&quot;1102&quot; data-start=&quot;1076&quot; data-ke-size=&quot;size16&quot;&gt;코드를 작성해서 실제 문서를 열어보겠습니다.&lt;/p&gt;
&lt;pre id=&quot;code_1770878715967&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;import pymupdf.layout
import pymupdf4llm
doc = pymupdf.open(&amp;ldquo;sample.pdf&amp;rdquo;)&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote data-ke-style=&quot;style2&quot;&gt;  주의: &lt;br /&gt;pymupdf.layout 은 반드시 PyMuPDF4LLM을 임포트하기 전에 먼저 불러와야 합니다.&lt;br /&gt;그렇지 않으면 레이아웃 기능이 활성화되지 않고 그냥 일반 PyMuPDF4LLM만 동작합니다.&lt;/blockquote&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;1384&quot; data-start=&quot;1364&quot; data-ke-size=&quot;size26&quot;&gt;4️⃣ 구조화된 데이터 추출하기&lt;/h2&gt;
&lt;p data-end=&quot;1530&quot; data-start=&quot;1386&quot; data-ke-size=&quot;size16&quot;&gt;라이브러리가 활성화된 상태에서 문서를 열었으면 이제 구조화 데이터를 뽑아봅시다.&lt;br /&gt;PyMuPDF Layout은 내부적으로 휴리스틱 + 머신러닝을 결합해서 더 정확한 추출 결과를 제공합니다.&lt;/p&gt;
&lt;p data-end=&quot;1552&quot; data-start=&quot;1532&quot; data-ke-size=&quot;size16&quot;&gt;  Markdown으로 추출&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;pre id=&quot;code_1770878758901&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;md = pymupdf4llm.to_markdown(doc)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;  JSON으로 추출&lt;/p&gt;
&lt;pre id=&quot;code_1770878781341&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;json = pymupdf4llm.to_json(doc)&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;⬛ Plain Text로 추출&lt;/p&gt;
&lt;pre id=&quot;code_1770878811315&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;txt = pymupdf4llm.to_text(doc)&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-end=&quot;1760&quot; data-start=&quot;1741&quot; data-ke-size=&quot;size26&quot;&gt;5️⃣ 결과를 파일로 저장하기&lt;/h2&gt;
&lt;p data-end=&quot;1821&quot; data-start=&quot;1762&quot; data-ke-size=&quot;size16&quot;&gt;추출한 데이터는 파일로 저장할 수 있습니다. 예를 들어 Markdown 포맷으로 저장하려면 이렇게 씁니다:&lt;/p&gt;
&lt;pre id=&quot;code_1770878875015&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;from pathlib import Path
suffix = &quot;.md&quot; # or &amp;ldquo;.json&amp;rdquo; or &amp;ldquo;.txt&amp;rdquo;
Path(doc.name).with_suffix(suffix).write_bytes(md.encode())&lt;/code&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2081&quot; data-start=&quot;1964&quot; data-ke-size=&quot;size16&quot;&gt;이렇게 하면 sample.pdf 옆에&lt;br /&gt;sample.md, sample.json, sample.txt 같은 파일이 생성됩니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;2105&quot; data-start=&quot;2088&quot; data-ke-size=&quot;size26&quot;&gt;6️⃣ 헤더 &amp;amp; 푸터 처리&lt;/h2&gt;
&lt;p data-end=&quot;2240&quot; data-start=&quot;2107&quot; data-ke-size=&quot;size16&quot;&gt;많은 문서에서는 &lt;b&gt;각 페이지마다 반복되는 헤더/푸터&lt;/b&gt;가 있을 수 있습니다.&lt;br /&gt;예: 문서 제목, 로고, 페이지 번호 등. 이런 요소들은 추출 시 필요 없을 때가 많죠.&lt;/p&gt;
&lt;p data-end=&quot;2318&quot; data-start=&quot;2242&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Layout은 이런 반복 요소를 &lt;b&gt;자동으로 감지&lt;/b&gt;하고 제거할 수 있습니다.&lt;br /&gt;API 호출 시 옵션으로 끌 수도 있죠:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;pre id=&quot;code_1770878921024&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;md = pymupdf4llm.to_markdown(doc, header=False, footer=False)
txt = pymupdf4llm.to_text(doc, header=False, footer=False)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote data-ke-style=&quot;style2&quot;&gt;참고: JSON 포맷은 항상 모든 페이지 데이터를 포함 하는 목적이기 때문에 헤더&amp;middot;푸터 제거 옵션이 적용되지 않습니다.&lt;/blockquote&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;2584&quot; data-start=&quot;2572&quot; data-ke-size=&quot;size26&quot;&gt;7️⃣ 추가 기능&lt;/h2&gt;
&lt;h3 data-end=&quot;2609&quot; data-start=&quot;2586&quot; data-ke-size=&quot;size23&quot;&gt;  확장: Office 문서 지원&lt;/h3&gt;
&lt;p data-end=&quot;2714&quot; data-start=&quot;2611&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro와 함께 사용하면 Office 문서(예: DOCX)도 처리할 수 있습니다.&lt;br /&gt;이 방법은 PyMuPDF Pro를 unlock 한 뒤 Layout을 활성화하면 됩니다:&lt;/p&gt;
&lt;pre id=&quot;code_1770878964551&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;import pymupdf.layout
import pymupdf.pro
import pymupdf4llm
pymupdf.pro.unlock()&lt;/code&gt;&lt;/pre&gt;
&lt;p data-end=&quot;2927&quot; data-start=&quot;2858&quot; data-ke-size=&quot;size16&quot;&gt;이제 DOCX도 Markdown으로 변환 가능합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;2947&quot; data-start=&quot;2934&quot; data-ke-size=&quot;size26&quot;&gt;8️⃣ OCR 지원&lt;/h2&gt;
&lt;p data-end=&quot;3097&quot; data-start=&quot;2949&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Layout은 &lt;b&gt;페이지에 OCR이 필요하다고 판단되면&lt;/b&gt; 자동으로 Tesseract-OCR을 실행해 처리합니다.&lt;br /&gt;만약 해당 모듈이 설치되어 있지 않으면 그 단계는 건너뜁니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;3120&quot; data-start=&quot;3104&quot; data-ke-size=&quot;size26&quot;&gt;9️⃣ 선택 페이지 추출&lt;/h2&gt;
&lt;p data-end=&quot;3251&quot; data-start=&quot;3122&quot; data-ke-size=&quot;size16&quot;&gt;기본적으로는 PDF의 &lt;b&gt;모든 페이지&lt;/b&gt;가 처리됩니다.&lt;br /&gt;다만 큰 문서의 일부 페이지만 필요할 때도 있죠.&lt;br /&gt;그럴 땐 to_markdown, to_json, to_text 호출에 pages 옵션을 줄 수 있습니다:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc; background-color: #ffffff; color: #1d1e1f; text-align: start;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;#&amp;nbsp;한&amp;nbsp;페이지만 &lt;br /&gt;pymupdf4llm.to_markdown(doc, pages=3)&lt;/li&gt;
&lt;li&gt;#&amp;nbsp;여러&amp;nbsp;페이지만 &lt;br /&gt;pymupdf4llm.to_markdown(doc,&amp;nbsp;pages=[1,&amp;nbsp;3,&amp;nbsp;5])&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;페이지 번호는 &lt;b&gt;0 기반 인덱스&lt;/b&gt;로 지정합니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 data-end=&quot;3458&quot; data-start=&quot;3447&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;마무리&lt;/b&gt;&lt;/h2&gt;
&lt;p data-end=&quot;3507&quot; data-start=&quot;3460&quot; data-ke-size=&quot;size16&quot;&gt;마지막으로 전체 프로세스를 하나의 스크립트로 묶어서 CLI에서 실행할 수도 있습니다:&lt;/p&gt;
&lt;pre id=&quot;code_1770879078969&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;import sys
from pathlib import Path

import pymupdf.layout
import pymupdf.pro
import pymupdf4llm
pymupdf.pro.unlock()

filename = sys.argv[1]
doc = pymupdf.open(filename)

md = pymupdf4llm.to_markdown(doc, header=False, footer=False)
json = pymupdf4llm.to_json(doc)
txt = pymupdf4llm.to_text(doc, header=False, footer=False)

Path(filename).with_suffix(&quot;.md&quot;).write_bytes(md.encode())
Path(filename).with_suffix(&quot;.json&quot;).write_bytes(json.encode())
Path(filename).with_suffix(&quot;.txt&quot;).write_bytes(txt.encode())&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;위 코드를 test-layout.py라는 이름으로 저장하고, 불러올 PDF 파일(sample.pdf)과 같은 폴더에 두겠습니다.&lt;br /&gt;그러면 폴더 구조는 다음과 같습니다:&lt;/p&gt;
&lt;pre class=&quot;css&quot; style=&quot;color: #444444; text-align: start;&quot;&gt;&lt;code&gt;test-layout.py
sample.pdf&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이제 위 코드를 커맨드라인(터미널)에서 실행하려면 다음과 같이 입력하면 됩니다:&lt;/p&gt;
&lt;div style=&quot;color: #1d1e1f; text-align: start;&quot;&gt;
&lt;pre class=&quot;css&quot; style=&quot;color: #444444;&quot;&gt;&lt;code&gt;python test-layout.py sample.pdf&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이&amp;nbsp;명령어는&amp;nbsp;방금&amp;nbsp;만든&amp;nbsp;Python&amp;nbsp;스크립트를&amp;nbsp;지정한&amp;nbsp;문서와&amp;nbsp;함께&amp;nbsp;실행하겠다는&amp;nbsp;뜻입니다.&lt;br /&gt;다른&amp;nbsp;문서를&amp;nbsp;처리하고&amp;nbsp;싶다면&amp;nbsp;파일명만&amp;nbsp;바꿔서&amp;nbsp;다시&amp;nbsp;실행하면&amp;nbsp;됩니다.&lt;br /&gt;&lt;br /&gt;실행이&amp;nbsp;끝나면,&amp;nbsp;폴더에는&amp;nbsp;변환된&amp;nbsp;출력&amp;nbsp;파일들이&amp;nbsp;생성되어&amp;nbsp;있고&amp;nbsp;구조는&amp;nbsp;다음과&amp;nbsp;같습니다:&lt;/p&gt;
&lt;pre class=&quot;css&quot; style=&quot;color: #444444; text-align: start;&quot;&gt;&lt;code&gt;test-layout.py
sample.pdf
sample.md
sample.json
sample.txt&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;  &lt;b&gt;Happy Coding!  &lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;앞으로,&amp;nbsp;다양하고&amp;nbsp;유익한&amp;nbsp;PyMuPDF&amp;nbsp;Pro&amp;nbsp;튜토리얼로&amp;nbsp;찾아오겠습니다.&amp;nbsp;기대해주세요!&amp;nbsp;감사합니다&amp;nbsp;:)&lt;br /&gt;&lt;a href=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot;&gt;PyMuPDF Pro 제품소개페이지 바로가기 &amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>AI학습</category>
      <category>pdf추출</category>
      <category>데이터추출</category>
      <category>데이터파싱</category>
      <category>도큐먼트AI</category>
      <category>문서ai</category>
      <category>문서파싱</category>
      <category>파이썬라이브러리</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/452</guid>
      <comments>https://epapyrus.tistory.com/452#entry452comment</comments>
      <pubDate>Thu, 12 Feb 2026 15:56:05 +0900</pubDate>
    </item>
    <item>
      <title>DocLayNet 기반 PyMuPDF-Layout 성능 분석 결과: 경쟁 제품과 비교 리포트로 한눈에 확인하세요.</title>
      <link>https://epapyrus.tistory.com/451</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;안녕하세요, 이파피루스입니다.&lt;/p&gt;
&lt;p data-end=&quot;488&quot; data-start=&quot;304&quot; data-ke-size=&quot;size16&quot;&gt;이 포스팅에서는 DocLayNet 데이터셋에서 &lt;b&gt;PyMuPDF-Layout&lt;/b&gt;을 &lt;b&gt;Docling&lt;/b&gt;과 비교한 벤치마크 결과를 정리한 리포트를 소개해드립니다. IoU 기반 지표로 레이아웃 탐지 정확도를 비교하고, 모델 효율성(파라미터 수, GPU 의존성 등)도 함께 살펴봅니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;515&quot; data-start=&quot;495&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;실험방법:&lt;/b&gt;&lt;/h2&gt;
&lt;h3 data-end=&quot;561&quot; data-start=&quot;517&quot; data-ke-size=&quot;size23&quot;&gt;데이터셋: DocLayNet (Pfitzmann et al., 2022)&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;887&quot; data-start=&quot;562&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;597&quot; data-start=&quot;562&quot;&gt;&lt;b&gt;학습(Training) 세트:&lt;/b&gt; 69,000 페이지&lt;/li&gt;
&lt;li data-end=&quot;634&quot; data-start=&quot;598&quot;&gt;&lt;b&gt;검증(Validation) 세트:&lt;/b&gt; 6,480 페이지&lt;/li&gt;
&lt;li data-end=&quot;706&quot; data-start=&quot;635&quot;&gt;&lt;b&gt;문서 카테고리:&lt;/b&gt; 재무 보고서, 과학 논문, 특허, 매뉴얼, 법률 문서, 입찰 문서(tender documents)&lt;/li&gt;
&lt;li data-end=&quot;887&quot; data-start=&quot;707&quot;&gt;&lt;b&gt;어노테이션 스키마:&lt;/b&gt; 11개 클래스 라벨&lt;br /&gt;(caption, footnote, formula, list-item, page-footer, page-header, picture, section-header, table, text, title)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;898&quot; data-start=&quot;889&quot; data-ke-size=&quot;size23&quot;&gt;베이스라인&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;968&quot; data-start=&quot;899&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;968&quot; data-start=&quot;899&quot;&gt;&lt;b&gt;Docling v2 (RT-DETR 아키텍처)&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;979&quot; data-start=&quot;970&quot; data-ke-size=&quot;size23&quot;&gt;평가 지표&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1070&quot; data-start=&quot;980&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1070&quot; data-start=&quot;980&quot;&gt;&lt;b&gt;IoU 임계값 0.6&lt;/b&gt;에서 precision/recall로 계산한 &lt;b&gt;F1 스코어&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;1103&quot; data-start=&quot;1072&quot; data-ke-size=&quot;size23&quot;&gt;클래스 정합(Class harmonization)&lt;/h3&gt;
&lt;p data-end=&quot;1202&quot; data-start=&quot;1104&quot; data-ke-size=&quot;size16&quot;&gt;Docling과 DocLayNet 사이에 분류 체계(택소노미) 차이가 있어서, 아래처럼 매핑을 적용했습니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1402&quot; data-start=&quot;1204&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1262&quot; data-start=&quot;1204&quot;&gt;Docling의 document-index, form &amp;rarr; DocLayNet의 table&lt;/li&gt;
&lt;li data-end=&quot;1402&quot; data-start=&quot;1263&quot;&gt;Docling의 key-value-region, code, checkbox-selected, checkbox-unselected &amp;rarr; DocLayNet의 text&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote data-end=&quot;1421&quot; data-start=&quot;1404&quot; data-ke-style=&quot;style2&quot;&gt;Note&amp;nbsp;&lt;br /&gt;Docling의 분류 체계에서는 &lt;b&gt;모든 title 요소가 section-header로 매핑&lt;/b&gt;됩니다. 그 결과 DocLayNet의 title 클래스에 대해서는 &lt;b&gt;커버리지가 0&lt;/b&gt;이 됩니다(= title을 못 잡는 것으로 계산됨).&lt;/blockquote&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;1634&quot; data-start=&quot;1603&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;실험 결과 :&lt;/b&gt;&lt;/h2&gt;
&lt;h3 data-end=&quot;1672&quot; data-start=&quot;1636&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;실험 1: PDF-based features&lt;/b&gt;&lt;/h3&gt;
&lt;p data-end=&quot;1780&quot; data-start=&quot;1673&quot; data-ke-size=&quot;size16&quot;&gt;첫 번째 모델 변형은 &lt;b&gt;이미지 렌더링 없이&lt;/b&gt;, PDF 내부 정보(PDF internals)에서 추출한 피처만 사용합니다.&lt;/p&gt;
&lt;div&gt;
&lt;table style=&quot;border-collapse: collapse; width: 100%;&quot; border=&quot;1&quot; data-end=&quot;2356&quot; data-start=&quot;1782&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Class&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt; &lt;span style=&quot;background-color: #ffffff; color: #1d1e1f; text-align: left;&quot;&gt;Docling F1&lt;/span&gt; &lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt; &lt;span style=&quot;background-color: #ffffff; color: #1d1e1f; text-align: left;&quot;&gt;PyMuPDF-Layout F1&lt;/span&gt; &lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt; &lt;span style=&quot;background-color: #ffffff; color: #1d1e1f; text-align: left;&quot;&gt;&amp;Delta;&lt;/span&gt; &lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;1889&quot; data-start=&quot;1850&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1860&quot; data-start=&quot;1850&quot;&gt;caption&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1869&quot; data-start=&quot;1860&quot;&gt;0.8594&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1878&quot; data-start=&quot;1869&quot;&gt;0.8157&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1889&quot; data-start=&quot;1878&quot;&gt;-0.0437&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;1930&quot; data-start=&quot;1890&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1901&quot; data-start=&quot;1890&quot;&gt;footnote&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1910&quot; data-start=&quot;1901&quot;&gt;0.4827&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1919&quot; data-start=&quot;1910&quot;&gt;0.7217&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1930&quot; data-start=&quot;1919&quot;&gt;+0.2390&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;1970&quot; data-start=&quot;1931&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1941&quot; data-start=&quot;1931&quot;&gt;formula&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1950&quot; data-start=&quot;1941&quot;&gt;0.7416&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1959&quot; data-start=&quot;1950&quot;&gt;0.7370&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1970&quot; data-start=&quot;1959&quot;&gt;-0.0046&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;2012&quot; data-start=&quot;1971&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1983&quot; data-start=&quot;1971&quot;&gt;list-item&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;1992&quot; data-start=&quot;1983&quot;&gt;0.7955&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2001&quot; data-start=&quot;1992&quot;&gt;0.8737&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2012&quot; data-start=&quot;2001&quot;&gt;+0.0782&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;2056&quot; data-start=&quot;2013&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2027&quot; data-start=&quot;2013&quot;&gt;page-footer&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2036&quot; data-start=&quot;2027&quot;&gt;0.7937&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2045&quot; data-start=&quot;2036&quot;&gt;0.7973&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2056&quot; data-start=&quot;2045&quot;&gt;+0.0036&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;2100&quot; data-start=&quot;2057&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2071&quot; data-start=&quot;2057&quot;&gt;page-header&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2080&quot; data-start=&quot;2071&quot;&gt;0.8218&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2089&quot; data-start=&quot;2080&quot;&gt;0.8387&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2100&quot; data-start=&quot;2089&quot;&gt;+0.0169&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;2140&quot; data-start=&quot;2101&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2111&quot; data-start=&quot;2101&quot;&gt;picture&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2120&quot; data-start=&quot;2111&quot;&gt;0.6314&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2129&quot; data-start=&quot;2120&quot;&gt;0.2462&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2140&quot; data-start=&quot;2129&quot;&gt;-0.3852&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;2187&quot; data-start=&quot;2141&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2158&quot; data-start=&quot;2141&quot;&gt;section-header&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2167&quot; data-start=&quot;2158&quot;&gt;0.8732&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2176&quot; data-start=&quot;2167&quot;&gt;0.7823&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2187&quot; data-start=&quot;2176&quot;&gt;-0.0909&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;2225&quot; data-start=&quot;2188&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2196&quot; data-start=&quot;2188&quot;&gt;table&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2205&quot; data-start=&quot;2196&quot;&gt;0.7977&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2214&quot; data-start=&quot;2205&quot;&gt;0.6886&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2225&quot; data-start=&quot;2214&quot;&gt;-0.1091&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;2262&quot; data-start=&quot;2226&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2233&quot; data-start=&quot;2226&quot;&gt;text&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2242&quot; data-start=&quot;2233&quot;&gt;0.8146&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2251&quot; data-start=&quot;2242&quot;&gt;0.8675&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2262&quot; data-start=&quot;2251&quot;&gt;+0.0529&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;2300&quot; data-start=&quot;2263&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2271&quot; data-start=&quot;2263&quot;&gt;title&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2280&quot; data-start=&quot;2271&quot;&gt;0.0000&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2289&quot; data-start=&quot;2280&quot;&gt;0.7672&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2300&quot; data-start=&quot;2289&quot;&gt;+0.7672&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;2356&quot; data-start=&quot;2301&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2315&quot; data-start=&quot;2301&quot;&gt;&lt;b&gt;Overall&lt;/b&gt;&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2328&quot; data-start=&quot;2315&quot;&gt;&lt;b&gt;0.8102&lt;/b&gt;&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2341&quot; data-start=&quot;2328&quot;&gt;&lt;b&gt;0.8270&lt;/b&gt;&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;2356&quot; data-start=&quot;2341&quot;&gt;&lt;b&gt;+0.0168&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-end=&quot;2466&quot; data-start=&quot;2358&quot; data-ke-size=&quot;size16&quot;&gt;모델 특성: Docling(RT-DETR) &lt;b&gt;20M 파라미터&lt;/b&gt; vs PyMuPDF-Layout &lt;b&gt;1.3M 파라미터&lt;/b&gt;&lt;/p&gt;
&lt;p data-end=&quot;2485&quot; data-start=&quot;2468&quot; data-ke-size=&quot;size16&quot;&gt;관찰된 성능 패턴(원문 요약):&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;2860&quot; data-start=&quot;2486&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;2602&quot; data-start=&quot;2486&quot;&gt;구조화된 요소에서 강함: footnotes(+0.239), list-items(+0.078), text blocks(+0.053)&lt;/li&gt;
&lt;li data-end=&quot;2679&quot; data-start=&quot;2603&quot;&gt;시각적 요소에서 성능 저하: pictures(-0.385)&lt;/li&gt;
&lt;li data-end=&quot;2792&quot; data-start=&quot;2680&quot;&gt;문서 전체 문맥이 필요한 요소에서 상대적으로 낮음: tables(-0.109), section-headers(-0.091)&lt;/li&gt;
&lt;li data-end=&quot;2860&quot; data-start=&quot;2793&quot;&gt;title 탐지에서 큰 개선(+0.767)&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 data-end=&quot;2929&quot; data-start=&quot;2867&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;실험 2: Fusion features (PDF + global image context)&lt;/b&gt;&lt;/h3&gt;
&lt;p data-end=&quot;3080&quot; data-start=&quot;2930&quot; data-ke-size=&quot;size16&quot;&gt;두 번째 모델 변형은 PDF 피처에 더해, &lt;b&gt;저해상도 페이지 이미지에서 추출한 글로벌 문서 피처&lt;/b&gt;를 추가합니다. 이때 &lt;b&gt;가벼운 CNN 백본&lt;/b&gt;을 사용하며 &lt;b&gt;파라미터가 0.5M 추가&lt;/b&gt;됩니다.&lt;/p&gt;
&lt;div&gt;
&lt;table style=&quot;border-collapse: collapse; width: 100%;&quot; border=&quot;1&quot; data-end=&quot;3656&quot; data-start=&quot;3082&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Class&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;Docling F1&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;MuPDF-Layout F1&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt; &amp;Delta; &lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3189&quot; data-start=&quot;3150&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3160&quot; data-start=&quot;3150&quot;&gt;caption&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3169&quot; data-start=&quot;3160&quot;&gt;0.8594&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3178&quot; data-start=&quot;3169&quot;&gt;0.8613&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3189&quot; data-start=&quot;3178&quot;&gt;+0.0019&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3230&quot; data-start=&quot;3190&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3201&quot; data-start=&quot;3190&quot;&gt;footnote&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3210&quot; data-start=&quot;3201&quot;&gt;0.4827&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3219&quot; data-start=&quot;3210&quot;&gt;0.7584&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3230&quot; data-start=&quot;3219&quot;&gt;+0.2757&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3270&quot; data-start=&quot;3231&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3241&quot; data-start=&quot;3231&quot;&gt;formula&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3250&quot; data-start=&quot;3241&quot;&gt;0.7416&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3259&quot; data-start=&quot;3250&quot;&gt;0.7666&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3270&quot; data-start=&quot;3259&quot;&gt;+0.0250&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3312&quot; data-start=&quot;3271&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3283&quot; data-start=&quot;3271&quot;&gt;list-item&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3292&quot; data-start=&quot;3283&quot;&gt;0.7955&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3301&quot; data-start=&quot;3292&quot;&gt;0.8676&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3312&quot; data-start=&quot;3301&quot;&gt;+0.0721&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3356&quot; data-start=&quot;3313&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3327&quot; data-start=&quot;3313&quot;&gt;page-footer&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3336&quot; data-start=&quot;3327&quot;&gt;0.7937&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3345&quot; data-start=&quot;3336&quot;&gt;0.9277&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3356&quot; data-start=&quot;3345&quot;&gt;+0.1340&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3400&quot; data-start=&quot;3357&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3371&quot; data-start=&quot;3357&quot;&gt;page-header&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3380&quot; data-start=&quot;3371&quot;&gt;0.8218&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3389&quot; data-start=&quot;3380&quot;&gt;0.7953&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3400&quot; data-start=&quot;3389&quot;&gt;-0.0265&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3440&quot; data-start=&quot;3401&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3411&quot; data-start=&quot;3401&quot;&gt;picture&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3420&quot; data-start=&quot;3411&quot;&gt;0.6314&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3429&quot; data-start=&quot;3420&quot;&gt;0.2885&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3440&quot; data-start=&quot;3429&quot;&gt;-0.3429&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3487&quot; data-start=&quot;3441&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3458&quot; data-start=&quot;3441&quot;&gt;section-header&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3467&quot; data-start=&quot;3458&quot;&gt;0.8732&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3476&quot; data-start=&quot;3467&quot;&gt;0.8389&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3487&quot; data-start=&quot;3476&quot;&gt;-0.0343&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3525&quot; data-start=&quot;3488&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3496&quot; data-start=&quot;3488&quot;&gt;table&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3505&quot; data-start=&quot;3496&quot;&gt;0.7977&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3514&quot; data-start=&quot;3505&quot;&gt;0.7966&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3525&quot; data-start=&quot;3514&quot;&gt;-0.0011&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3562&quot; data-start=&quot;3526&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3533&quot; data-start=&quot;3526&quot;&gt;text&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3542&quot; data-start=&quot;3533&quot;&gt;0.8146&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3551&quot; data-start=&quot;3542&quot;&gt;0.8489&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3562&quot; data-start=&quot;3551&quot;&gt;+0.0343&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3600&quot; data-start=&quot;3563&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3571&quot; data-start=&quot;3563&quot;&gt;title&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3580&quot; data-start=&quot;3571&quot;&gt;0.0000&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3589&quot; data-start=&quot;3580&quot;&gt;0.7189&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3600&quot; data-start=&quot;3589&quot;&gt;+0.7189&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;3656&quot; data-start=&quot;3601&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3615&quot; data-start=&quot;3601&quot;&gt;&lt;b&gt;Overall&lt;/b&gt;&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3628&quot; data-start=&quot;3615&quot;&gt;&lt;b&gt;0.8102&lt;/b&gt;&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3641&quot; data-start=&quot;3628&quot;&gt;&lt;b&gt;0.8356&lt;/b&gt;&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;3656&quot; data-start=&quot;3641&quot;&gt;&lt;b&gt;+0.0254&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-end=&quot;3770&quot; data-start=&quot;3658&quot; data-ke-size=&quot;size16&quot;&gt;모델 특성: Docling(RT-DETR) &lt;b&gt;20M 파라미터&lt;/b&gt; vs PyMuPDF-Layout(퓨전) &lt;b&gt;1.8M 파라미터&lt;/b&gt;&lt;/p&gt;
&lt;p data-end=&quot;3795&quot; data-start=&quot;3772&quot; data-ke-size=&quot;size16&quot;&gt;글로벌 컨텍스트 추가의 효과(원문 요약):&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;4115&quot; data-start=&quot;3796&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;3869&quot; data-start=&quot;3796&quot;&gt;page-footer 성능이 크게 개선(+0.134)&lt;/li&gt;
&lt;li data-end=&quot;3952&quot; data-start=&quot;3870&quot;&gt;table 성능 격차가 거의 사라짐(&amp;Delta; -0.011 &amp;rarr; -0.001)&lt;/li&gt;
&lt;li data-end=&quot;4042&quot; data-start=&quot;3953&quot;&gt;picture는 여전히 약하지만, 하락 폭은 줄어듦(-0.385 &amp;rarr; -0.343)&lt;/li&gt;
&lt;li data-end=&quot;4115&quot; data-start=&quot;4043&quot;&gt;PDF-only 대비 전체 F1이 +0.025 상승&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;4158&quot; data-start=&quot;4122&quot; data-ke-size=&quot;size23&quot;&gt;&amp;nbsp;&lt;/h3&gt;
&lt;h3 data-end=&quot;4158&quot; data-start=&quot;4122&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;계산 효율&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;구현 방식파라미터 수F1 점수GPU 필요 여부&lt;/p&gt;
&lt;table style=&quot;border-collapse: collapse; width: 100%;&quot; border=&quot;1&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;구현방식&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;파라미터 수&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;F1 점수&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;b&gt;GPU 필요여부&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Docling (RT-DETR)&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;2,000만 개&lt;/td&gt;
&lt;td&gt;0.8102&lt;/td&gt;
&lt;td&gt;필요&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;PyMuPDF-Layout (PDF features)&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;130만 개&lt;/td&gt;
&lt;td&gt;0.8270&lt;/td&gt;
&lt;td&gt;불필요&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;PyMuPDF-Layout (Fusion features)&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;180만 개&lt;/td&gt;
&lt;td&gt;0.8356&lt;/td&gt;
&lt;td&gt;불필요&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p data-end=&quot;4571&quot; data-start=&quot;4406&quot; data-ke-size=&quot;size16&quot;&gt;PDF 피처 버전은 &lt;b&gt;파라미터를 15.4배 줄이면서도&lt;/b&gt; 유사한 정확도를 달성했고, 퓨전 버전은 &lt;b&gt;11.1배 적은 파라미터&lt;/b&gt;로 &lt;b&gt;F1을 +2.5%p 개선&lt;/b&gt;했습니다. 두 버전 모두 &lt;b&gt;GPU 가속 없이 동작&lt;/b&gt;합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;4596&quot; data-start=&quot;4578&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;결과 해석 및 시사점&lt;/b&gt;&lt;/h2&gt;
&lt;p data-end=&quot;4753&quot; data-start=&quot;4598&quot; data-ke-size=&quot;size16&quot;&gt;이 결과는 &lt;b&gt;구조화된 PDF 피처로 학습한 레이아웃 탐지 모델&lt;/b&gt;이, &lt;b&gt;비전 기반 모델과 동급(performance parity)&lt;/b&gt; 수준의 성능을 내면서도 계산 비용을 크게 줄일 수 있음을 보여줍니다.&lt;/p&gt;
&lt;p data-end=&quot;4782&quot; data-start=&quot;4755&quot; data-ke-size=&quot;size16&quot;&gt;또한 이 접근은 강점과 한계가 비교적 명확합니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;4933&quot; data-start=&quot;4783&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;4856&quot; data-start=&quot;4783&quot;&gt;&lt;b&gt;강점:&lt;/b&gt; 구조화된 텍스트 요소, 문서 메타데이터&lt;/li&gt;
&lt;li data-end=&quot;4933&quot; data-start=&quot;4857&quot;&gt;&lt;b&gt;한계:&lt;/b&gt; 시각적 요소(picture), 복잡한 테이블&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;5071&quot; data-start=&quot;4935&quot; data-ke-size=&quot;size16&quot;&gt;퓨전 방식은 글로벌 컨텍스트 부족 문제를 일부 보완하면서도 효율성을 유지하지만, &lt;b&gt;picture 분류는 PDF 기반 피처 추출의 구조적 한계로 남아 있다&lt;/b&gt;고 설명합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 data-end=&quot;5100&quot; data-start=&quot;5078&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;다음 단계 ✈️&lt;/b&gt;&lt;/h2&gt;
&lt;p data-end=&quot;5293&quot; data-start=&quot;5102&quot; data-ke-size=&quot;size16&quot;&gt;추가 벤치마크는 다른 데이터셋/평가 프레임워크로 확장해 진행할 예정이며, 새로운 베이스라인이 나오면 성능 지표를 계속 업데이트할 예정입니다 :)&lt;br /&gt;(벤치마크 마지막 업데이트: 2025년 10월)&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-style=&quot;style5&quot; data-ke-type=&quot;horizontalRule&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;  &lt;b&gt;Happy Coding!  &lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;앞으로,&amp;nbsp;다양하고&amp;nbsp;유익한&amp;nbsp;PyMuPDF&amp;nbsp;Pro&amp;nbsp;튜토리얼로&amp;nbsp;찾아오겠습니다.&amp;nbsp;기대해주세요!&amp;nbsp;감사합니다&amp;nbsp;:)&lt;br /&gt;&lt;a href=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot;&gt;PyMuPDF Pro 제품소개페이지 바로가기 &amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>Docling</category>
      <category>pdf추출</category>
      <category>pdf파싱</category>
      <category>데이터추출</category>
      <category>데이터파싱</category>
      <category>문서ai</category>
      <category>문서추출</category>
      <category>문서파싱</category>
      <category>파싱</category>
      <category>파이썬라이브러리</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/451</guid>
      <comments>https://epapyrus.tistory.com/451#entry451comment</comments>
      <pubDate>Wed, 11 Feb 2026 16:53:06 +0900</pubDate>
    </item>
    <item>
      <title>2026 이파피루스 사업 발표회 현장을 소개합니다✨</title>
      <link>https://epapyrus.tistory.com/450</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;안녕하세요, 이파피루스입니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;2026년을 맞아 어김없이! 이파피루스의 모든 임직원분들을 모시고 작년 한 해를 돌아보고 새로운 2026년의 계획을 나누는 이파피루스의 신년회를 진행했는데요,&lt;br /&gt;이번 신년회는 더욱 특별히 대표님까지 참석해주셨습니다. 앞으로 한국의 이파피루스와 미국의 아티펙스를 비롯한 전세계의 자회사까지 아우르는 '이파피루스 그룹'의 비전을 발표해주셨습니다!   또, 작년 한 해 열심히 달려온 임직원분들의 사기 충전을 위한 빵빵한 포상까지!&amp;nbsp;&lt;br /&gt;뜻 깊었던 2026 이파피루스 신년회를 사진과 함께 만나보시죠!&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;20260206_130228.jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dYauLv/dJMcahDjE6C/nPSBB7qpBvCyT8RLHruCl1/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dYauLv/dJMcahDjE6C/nPSBB7qpBvCyT8RLHruCl1/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dYauLv/dJMcahDjE6C/nPSBB7qpBvCyT8RLHruCl1/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdYauLv%2FdJMcahDjE6C%2FnPSBB7qpBvCyT8RLHruCl1%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;4000&quot; height=&quot;3000&quot; data-filename=&quot;20260206_130228.jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;오랜만에 모든 부서가 함께 모여 앉아계신 모습✨ 화기애애합니다 &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;20260206_130425.jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bSho34/dJMcabXpFDP/KUenILxsbBOIdpLvvc9wp0/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bSho34/dJMcabXpFDP/KUenILxsbBOIdpLvvc9wp0/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bSho34/dJMcabXpFDP/KUenILxsbBOIdpLvvc9wp0/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbSho34%2FdJMcabXpFDP%2FKUenILxsbBOIdpLvvc9wp0%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;4000&quot; height=&quot;3000&quot; data-filename=&quot;20260206_130425.jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;2025년도 각 부서별 성과를 공유하고 회고하는 시간, 사업발표의 첫 시작은 김정아 부사장님이 열어주셨습니다.&lt;br /&gt;작년 한 해 바쁘게 달려온 이파피루스의 성과를 모든 구성원과 함께 나누며 행사를 시작했습니다 :)&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;20260206_133723.jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/AXc4c/dJMcaaxscoI/O44nUGdbwER5g2NN2bTKZK/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/AXc4c/dJMcaaxscoI/O44nUGdbwER5g2NN2bTKZK/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/AXc4c/dJMcaaxscoI/O44nUGdbwER5g2NN2bTKZK/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FAXc4c%2FdJMcaaxscoI%2FO44nUGdbwER5g2NN2bTKZK%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;4000&quot; height=&quot;3000&quot; data-filename=&quot;20260206_133723.jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;20260206_135926.jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bdQLlT/dJMcabXpFD5/TfQF1Mekm5GLT0yJTBQ4iK/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bdQLlT/dJMcabXpFD5/TfQF1Mekm5GLT0yJTBQ4iK/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bdQLlT/dJMcabXpFD5/TfQF1Mekm5GLT0yJTBQ4iK/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbdQLlT%2FdJMcabXpFD5%2FTfQF1Mekm5GLT0yJTBQ4iK%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;4000&quot; height=&quot;3000&quot; data-filename=&quot;20260206_135926.jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이어지는 순서로는, 미국에서 날아오신✈️ 대표님께서 직접 진행해주셨는데요,&lt;br /&gt;급변하는 IT 시장과 하루가 다르게 발전하는 AI 기술 속에서 이파피루스만의 강점✨을 살릴 수 있는 미래전략을 아주 임팩트있게 발표해주셨습니다.&lt;br /&gt;비전을 공유하며 이파피루스의 모든 구성원들이 다시한번 공감하는 아주 유익한 시간이었습니다 &lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imagegridblock&quot;&gt;
  &lt;div class=&quot;image-container&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/vL2z0/dJMb99ZC7V9/bbsIHMkD8KQxKKmy3AgYqk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/vL2z0/dJMb99ZC7V9/bbsIHMkD8KQxKKmy3AgYqk/img.png&quot; data-origin-width=&quot;3000&quot; data-origin-height=&quot;2250&quot; data-is-animation=&quot;false&quot; data-filename=&quot;blob&quot; data-widthpercent=&quot;50&quot; style=&quot;width: 49.4186%; margin-right: 10px;&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/vL2z0/dJMb99ZC7V9/bbsIHMkD8KQxKKmy3AgYqk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FvL2z0%2FdJMb99ZC7V9%2FbbsIHMkD8KQxKKmy3AgYqk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;3000&quot; height=&quot;2250&quot;/&gt;&lt;/span&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/yqIfV/dJMcagqSVCI/1QxPHxqYvs88N9xYk45F9k/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/yqIfV/dJMcagqSVCI/1QxPHxqYvs88N9xYk45F9k/img.jpg&quot; data-origin-width=&quot;4000&quot; data-origin-height=&quot;3000&quot; data-is-animation=&quot;false&quot; data-filename=&quot;20260206_161124.jpg&quot; style=&quot;width: 49.4186%;&quot; data-widthpercent=&quot;50&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/yqIfV/dJMcagqSVCI/1QxPHxqYvs88N9xYk45F9k/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FyqIfV%2FdJMcagqSVCI%2F1QxPHxqYvs88N9xYk45F9k%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;4000&quot; height=&quot;3000&quot;/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;그리고, 모두의 얼굴에 웃음꽃이 핀 시간!&lt;br /&gt;우수사원 포상을 대표님께서 직접 수여해주셨는데요.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;한 해 동안 열심히 노력해주시는 노고가 보상받는 시간, 수상자들의 무척 환한 미소가 블러를 뚫고 나옵니다  모두 수고 많으셨습니다! 26년에도 잘 부탁드립니다!&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imagegridblock&quot;&gt;
  &lt;div class=&quot;image-container&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/DlUBi/dJMcabXpFUm/91D90kT936Sae8z0ee8o41/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/DlUBi/dJMcabXpFUm/91D90kT936Sae8z0ee8o41/img.png&quot; data-origin-width=&quot;733&quot; data-origin-height=&quot;564&quot; data-is-animation=&quot;false&quot; data-filename=&quot;blob&quot; style=&quot;width: 31.2777%; margin-right: 10px;&quot; data-widthpercent=&quot;32.02&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/DlUBi/dJMcabXpFUm/91D90kT936Sae8z0ee8o41/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FDlUBi%2FdJMcabXpFUm%2F91D90kT936Sae8z0ee8o41%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;733&quot; height=&quot;564&quot;/&gt;&lt;/span&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bUNAu3/dJMcaibbPul/pyMYnVohLPwXSNgvJZQtt0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bUNAu3/dJMcaibbPul/pyMYnVohLPwXSNgvJZQtt0/img.png&quot; data-origin-width=&quot;782&quot; data-origin-height=&quot;510&quot; data-is-animation=&quot;false&quot; data-filename=&quot;blob&quot; data-widthpercent=&quot;37.78&quot; style=&quot;width: 36.9017%; margin-right: 10px;&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bUNAu3/dJMcaibbPul/pyMYnVohLPwXSNgvJZQtt0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbUNAu3%2FdJMcaibbPul%2FpyMYnVohLPwXSNgvJZQtt0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;782&quot; height=&quot;510&quot;/&gt;&lt;/span&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/tcBs5/dJMcadgCW23/nuRIn6AxoZjeIzezOgW3lk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/tcBs5/dJMcadgCW23/nuRIn6AxoZjeIzezOgW3lk/img.png&quot; data-origin-width=&quot;690&quot; data-origin-height=&quot;563&quot; data-is-animation=&quot;false&quot; data-filename=&quot;blob&quot; style=&quot;width: 29.4951%;&quot; data-widthpercent=&quot;30.2&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/tcBs5/dJMcadgCW23/nuRIn6AxoZjeIzezOgW3lk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FtcBs5%2FdJMcadgCW23%2FnuRIn6AxoZjeIzezOgW3lk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;690&quot; height=&quot;563&quot;/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;그리고.. 개인적으로 너무나 부러웠던 근속 포상의 시간&lt;br /&gt;10년 이상 이파피루스와 함께 해주신 임직원분들께는 특별히 골드바✨가 수여되었습니다.&lt;br /&gt;앞으로 20년까지 함께 해 봐요~!  &lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이상으로, 대표님과 함께 해 더욱 특별했던 이파피루스의 2026년 사업계획 발표회 및 신년회 소식을 전해드렸습니다.&lt;br /&gt;26년에도 훌륭한 임직원분들과 함께 더욱 노력하는 문서 AI 기업이 되겠습니다. 지켜봐주세요 &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;감사합니다 :)&lt;/p&gt;</description>
      <category>이파피루스 소식</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/450</guid>
      <comments>https://epapyrus.tistory.com/450#entry450comment</comments>
      <pubDate>Wed, 11 Feb 2026 14:52:30 +0900</pubDate>
    </item>
    <item>
      <title>이파피루스, '파이뮤PDF 프로'로 글로벌 영토 확장&amp;hellip;금융&amp;middot;회계 '빅네임' 연달아 수주</title>
      <link>https://epapyrus.tistory.com/449</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;스크린샷 2025-11-12 183525.png&quot; data-origin-width=&quot;1908&quot; data-origin-height=&quot;863&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dEBKMV/dJMcac9FY0x/ulTUtFkbxGOb6Ah7B3hVLK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dEBKMV/dJMcac9FY0x/ulTUtFkbxGOb6Ah7B3hVLK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dEBKMV/dJMcac9FY0x/ulTUtFkbxGOb6Ah7B3hVLK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdEBKMV%2FdJMcac9FY0x%2FulTUtFkbxGOb6Ah7B3hVLK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1908&quot; height=&quot;863&quot; data-filename=&quot;스크린샷 2025-11-12 183525.png&quot; data-origin-width=&quot;1908&quot; data-origin-height=&quot;863&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style2&quot;&gt;딜로이트&amp;middot;PwC&amp;middot;KPMG, AI 데이터 활용 인프라로 '파이뮤PDF 프로' 채택골드만삭스&amp;middot;블룸버그&amp;middot;미스트랄AI 등 신규 수주&amp;hellip; K-소프트웨어의 압도적 기술력 입증&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #222222; text-align: start;&quot;&gt;글로벌 문서 인공지능(AI) 그룹 이파피루스(대표 김정희)는 세계 최대 투자은행인 골드만삭스와 자사 핵심 문서 데이터 추출 솔루션 '파이뮤PDF 프로(PyMuPDF Pro)' 공급 계약을 체결했다고 밝혔다. 아울러 블룸버그, 세일즈포스, 미스트랄 AI 등 글로벌 톱티어 기업들을 잇따라 신규 고객사로 확보했다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #222222; text-align: start;&quot;&gt;파이뮤PDF 프로는 AI 및&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; text-align: start;&quot;&gt;&lt;a style=&quot;color: #222222;&quot;&gt;빅데이터&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #222222; text-align: start;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;구축, 업무 자동화, 이미지 렌더링 등 다양한 문서 작업을 파이선 환경에서 빠르고 정확하게 구현할 수 있는 문서 데이터 추출 라이브러리다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #222222; text-align: start;&quot;&gt;글로벌 회계법인(Big 4)들의 도입세도 눈에 띈다. 딜로이트는 자사 디지털 지능형 콘텐츠 추출(Digital Intelligent Content Extraction, D-ICE) 툴의 핵심 구성 요소로 파이뮤PDF 프로를 활용하고 있다. 계약서, 보고서, 재무 문서 등 비정형 PDF에서 텍스트와 좌표 정보를 정밀하게 계산해 추출하며, 이를 구조화된 데이터로 변환해 AI 및 분석 엔진의 입력값으로 사용한다.&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #ffffff; color: #333333; text-align: start;&quot;&gt;자세한 내용은 아래에서 확인해주세요 :)&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #ffffff; color: #333333; text-align: start;&quot;&gt;&lt;a href=&quot;https://www.etnews.com/20260113000171&quot; target=&quot;_blank&quot; rel=&quot;noopener&amp;nbsp;noreferrer&quot;&gt;https://www.etnews.com/20260113000171&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1769063466478&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;이파피루스, '파이뮤PDF 프로'로 글로벌 영토 확장&amp;hellip;금융&amp;middot;회계 '빅네임' 연달아 수주&quot; data-og-description=&quot;글로벌 문서 인공지능(AI) 그룹 이파피루스(대표 김정희)는 세계 최대 투자은행인 골드만삭스와 자사 핵심 문서 데이터 추출 솔루션 '파이뮤PDF 프로(PyMuPDF Pro)' 공급 계약을 체결했다고 밝혔다. &quot; data-og-host=&quot;www.etnews.com&quot; data-og-source-url=&quot;https://www.etnews.com/20260113000171&quot; data-og-url=&quot;https://www.etnews.com/20260113000171?SNS=00002&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/q6isM/dJMb82Mw8tg/XA1NhajbmG41qOKSC8Y481/img.png?width=700&amp;amp;height=317&amp;amp;face=0_0_700_317&quot;&gt;&lt;a href=&quot;https://www.etnews.com/20260113000171&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://www.etnews.com/20260113000171&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/q6isM/dJMb82Mw8tg/XA1NhajbmG41qOKSC8Y481/img.png?width=700&amp;amp;height=317&amp;amp;face=0_0_700_317');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;이파피루스, '파이뮤PDF 프로'로 글로벌 영토 확장&amp;hellip;금융&amp;middot;회계 '빅네임' 연달아 수주&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;글로벌 문서 인공지능(AI) 그룹 이파피루스(대표 김정희)는 세계 최대 투자은행인 골드만삭스와 자사 핵심 문서 데이터 추출 솔루션 '파이뮤PDF 프로(PyMuPDF Pro)' 공급 계약을 체결했다고 밝혔다.&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;www.etnews.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>언론보도</category>
      <category>KPMG</category>
      <category>pdf추출</category>
      <category>pwc</category>
      <category>미스트랄ai</category>
      <category>블룸버그</category>
      <category>세일즈포스</category>
      <category>회계데이터</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/449</guid>
      <comments>https://epapyrus.tistory.com/449#entry449comment</comments>
      <pubDate>Thu, 22 Jan 2026 15:31:51 +0900</pubDate>
    </item>
    <item>
      <title>PyMuPDF-Layout: 문서파싱, GPU없이 10배 빠르게 가능한 이유?</title>
      <link>https://epapyrus.tistory.com/448</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;blog_PyMuPDF PRo_GPU없이.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/lBdbW/dJMcajgpmCs/yN9pYcPeXY16SiJYahYUb1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/lBdbW/dJMcajgpmCs/yN9pYcPeXY16SiJYahYUb1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/lBdbW/dJMcajgpmCs/yN9pYcPeXY16SiJYahYUb1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FlBdbW%2FdJMcajgpmCs%2FyN9pYcPeXY16SiJYahYUb1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;blog_PyMuPDF PRo_GPU없이.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 style=&quot;text-align: center;&quot; data-end=&quot;147&quot; data-start=&quot;116&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;PyMuPDF-Layout은 어떻게 시작되었을까요?&lt;/b&gt;&lt;/h2&gt;
&lt;p style=&quot;text-align: left;&quot; data-end=&quot;289&quot; data-start=&quot;149&quot; data-ke-size=&quot;size16&quot;&gt;*PyMuPDF-Layout은 'PyMuPDF Pro' 패키지에 포함된 표 등 레이아웃 전용 추출 라이브러리입니다. 복잡한 레이아웃 문서를 파싱할때 PyMuPDF Pro와 Layout을 이용하면 더욱 정확한 문서 파싱이 가능합니다.&lt;/p&gt;
&lt;p data-end=&quot;289&quot; data-start=&quot;149&quot; data-ke-size=&quot;size16&quot;&gt;지난해 9월, 유럽과 아시아 각지에서 일하던 ePapyrus와 Artifex 팀원들이 한자리에 모였습니다.&lt;br /&gt;( ePapyrus와 Artifex는 전 세계 거의 모든 타임존에 팀원이 있는 회사입니다.)&lt;br /&gt;장소는 샌프란시스코 본사에서 북쪽으로 약 70마일 떨어진 작은 해안 도시였습니다.&lt;/p&gt;
&lt;p data-end=&quot;345&quot; data-start=&quot;291&quot; data-ke-size=&quot;size16&quot;&gt;안개가 자욱한 그곳에서, 우리는 &lt;b&gt;일주일 내내 단 하나의 질문&lt;/b&gt;만을 놓고 이야기를 나눴습니다.&lt;/p&gt;
&lt;blockquote data-end=&quot;451&quot; data-start=&quot;347&quot; data-ke-style=&quot;style1&quot;&gt;
&lt;p data-end=&quot;451&quot; data-start=&quot;349&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;35년 동안 쌓아온 문서 처리 경험, 특히 PDF처럼 구조가 복잡한 문서를 다뤄온 노하우를&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;최신 AI 기술과 결합하면, 지금보다 훨씬 나은 데이터 파싱을 만들 수 있지 않을까?&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p data-end=&quot;617&quot; data-start=&quot;453&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-end=&quot;617&quot; data-start=&quot;453&quot; data-ke-size=&quot;size16&quot;&gt;ePapyrus와 Artifex는 이미 PyMuPDF 제품군을 통해 많은 개발자와 기업에 문서 파싱 솔루션을 제공하고 있습니다.&lt;br /&gt;마크다운 출력에 특화된 PyMuPDF4LLM을 포함해,&lt;br /&gt;Mistral AI, Harvey AI, DocuSign, Oracle 같은 글로벌 기업들도 우리 기술을 사용하고 있죠.&lt;/p&gt;
&lt;p data-end=&quot;668&quot; data-start=&quot;619&quot; data-ke-size=&quot;size16&quot;&gt;하지만 AI 기술이 빠르게 발전하면서, 문서 파싱 분야 역시 큰 변화를 겪고 있었습니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;699&quot; data-start=&quot;675&quot; data-ke-size=&quot;size26&quot;&gt;VLM이 가진 한계, 그리고 다른 접근&lt;/h2&gt;
&lt;p data-end=&quot;844&quot; data-start=&quot;701&quot; data-ke-size=&quot;size16&quot;&gt;요즘 문서 파싱에서 많이 이야기되는 방식 중 하나가 &lt;b&gt;VLM(Vision Language Model)&lt;/b&gt; 입니다.&lt;br /&gt;PDF를 그대로 분석하는 대신, 페이지를 이미지로 변환한 뒤&lt;br /&gt;Vision Transformer 기반 모델로 내용을 추출하는 방식이죠.&lt;/p&gt;
&lt;p data-end=&quot;881&quot; data-start=&quot;846&quot; data-ke-size=&quot;size16&quot;&gt;분명 혁신적인 접근입니다.&lt;br /&gt;하지만 치명적인 단점도 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;897&quot; data-start=&quot;883&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;비용과 속도입니다.&lt;/b&gt;&lt;/p&gt;
&lt;p data-end=&quot;1021&quot; data-start=&quot;899&quot; data-ke-size=&quot;size16&quot;&gt;VLM은 막대한 GPU 리소스를 필요로 합니다.&lt;br /&gt;처리 속도는 느려지고, 운영 비용도 빠르게 증가하죠.&lt;br /&gt;대규모 투자를 받은 스타트업이라면 감당할 수 있을지 모르지만,&lt;br /&gt;대부분의 팀에게는 현실적인 선택이 아닙니다.&lt;/p&gt;
&lt;p data-end=&quot;1091&quot; data-start=&quot;1023&quot; data-ke-size=&quot;size16&quot;&gt;무엇보다 중요한 문제는 따로 있었습니다.&lt;br /&gt;많은 팀들이 &lt;b&gt;문서를 잘 모른 채 문서 문제를 풀고 있다는 점&lt;/b&gt;이었습니다.&lt;/p&gt;
&lt;p data-end=&quot;1163&quot; data-start=&quot;1093&quot; data-ke-size=&quot;size16&quot;&gt;PDF의 구조를 버리고, 단순한 이미지로 취급한 채 문제를 해결하려는 접근.&lt;br /&gt;우리는 이 방식이 과연 최선일까 고민했습니다.&lt;/p&gt;
&lt;p data-end=&quot;1163&quot; data-start=&quot;1093&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 data-end=&quot;1182&quot; data-start=&quot;1170&quot; data-ke-size=&quot;size26&quot;&gt;우리가 던진 질문&lt;/h2&gt;
&lt;p data-end=&quot;1287&quot; data-start=&quot;1184&quot; data-ke-size=&quot;size16&quot;&gt;ePapyrus와 Artifex 에는 다른 팀들이 갖지 못한 자산이 있습니다.&lt;br /&gt;&lt;b&gt;35년간 쌓아온 PDF 처리 기술&lt;/b&gt;과,&lt;br /&gt;&lt;b&gt;현대적인 ML을 연구하는 AI 엔지니어 팀&lt;/b&gt;이 함께 있다는 점입니다.&lt;/p&gt;
&lt;p data-end=&quot;1308&quot; data-start=&quot;1289&quot; data-ke-size=&quot;size16&quot;&gt;그래서 우리는 이렇게 질문했습니다.&lt;/p&gt;
&lt;blockquote data-end=&quot;1427&quot; data-start=&quot;1310&quot; data-ke-style=&quot;style1&quot;&gt;
&lt;p data-end=&quot;1427&quot; data-start=&quot;1312&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;네이티브 PDF 추출 과정에서 이미 알고 있는 구조 정보를 활용해&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;GPU 없이도 학습 가능한 ML 모델을 만들 수는 없을까?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;속도와 정확도를 모두 잡을 수 있는 진짜 하이브리드 방식은 없을까?&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p data-end=&quot;1509&quot; data-start=&quot;1429&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-end=&quot;1509&quot; data-start=&quot;1429&quot; data-ke-size=&quot;size16&quot;&gt;이 질문을 던질 수 있는 회사는 사실상 우리뿐이었습니다.&lt;br /&gt;그리고 그 질문이 &lt;b&gt;PyMuPDF-Layout&lt;/b&gt;의 출발점이 되었습니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;1547&quot; data-start=&quot;1516&quot; data-ke-size=&quot;size26&quot;&gt;PyMuPDF-Layout: 구조부터 이해하는 접근&lt;/h2&gt;
&lt;p data-end=&quot;1647&quot; data-start=&quot;1549&quot; data-ke-size=&quot;size16&quot;&gt;1년간의 개발 끝에, 우리는 이 방식을 베타 테스터에게 공개할 수 있는 단계에 이르렀습니다.&lt;br /&gt;이 하이브리드 접근법을 우리는 &lt;b&gt;PyMuPDF-Layout&lt;/b&gt;이라고 부릅니다.&lt;/p&gt;
&lt;p data-end=&quot;1737&quot; data-start=&quot;1649&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF-Layout은 문서를 이미지로 바꿔 거대한 신경망에 맡기지 않습니다.&lt;br /&gt;대신, &lt;b&gt;PDF 자체가 가진 구조 정보에서부터 분석을 시작&lt;/b&gt;합니다.&lt;/p&gt;
&lt;p data-end=&quot;1784&quot; data-start=&quot;1739&quot; data-ke-size=&quot;size16&quot;&gt;먼저 MuPDF의 네이티브 파서를 사용해 다음과 같은 정보를 정확하게 추출합니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1851&quot; data-start=&quot;1786&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1800&quot; data-start=&quot;1786&quot;&gt;폰트 크기와 스타일&lt;/li&gt;
&lt;li data-end=&quot;1816&quot; data-start=&quot;1801&quot;&gt;줄 간격과 정렬 패턴&lt;/li&gt;
&lt;li data-end=&quot;1835&quot; data-start=&quot;1817&quot;&gt;문자와 텍스트 박스의 위치&lt;/li&gt;
&lt;li data-end=&quot;1851&quot; data-start=&quot;1836&quot;&gt;들여쓰기와 마진 정보&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1955&quot; data-start=&quot;1853&quot; data-ke-size=&quot;size16&quot;&gt;이 데이터는 추측이 아닙니다.&lt;br /&gt;PDF 구조로부터 직접 읽어낸, &lt;b&gt;정확한 수치 정보&lt;/b&gt;입니다.&lt;br /&gt;문서를 사진으로 보는 것이 아니라,&lt;br /&gt;문서의 &amp;ldquo;DNA&amp;rdquo;를 읽는 것에 가깝습니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;1978&quot; data-start=&quot;1962&quot; data-ke-size=&quot;size26&quot;&gt;작은 모델로, 더 빠르게&lt;/h2&gt;
&lt;p data-end=&quot;2111&quot; data-start=&quot;1980&quot; data-ke-size=&quot;size16&quot;&gt;이렇게 추출한 구조 정보를 &lt;b&gt;Graph Neural Network(GNN)&lt;/b&gt; 에 전달합니다.&lt;br /&gt;GNN은 텍스트 박스를 노드로, 공간적 관계를 엣지로 삼아&lt;br /&gt;제목, 본문, 표, 이미지 같은 문서 요소를 구분하는 패턴을 학습합니다.&lt;/p&gt;
&lt;p data-end=&quot;2129&quot; data-start=&quot;2113&quot; data-ke-size=&quot;size16&quot;&gt;이 방식의 핵심은 명확합니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;2225&quot; data-start=&quot;2131&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;2169&quot; data-start=&quot;2131&quot;&gt;VLM: 고해상도 이미지를 거대한 모델로 처리 &amp;rarr; GPU 필요&lt;/li&gt;
&lt;li data-end=&quot;2225&quot; data-start=&quot;2170&quot;&gt;PyMuPDF-Layout: 구조 정보 먼저 추출 &amp;rarr; 작은 GNN으로 판단 &amp;rarr; CPU만 사용&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2276&quot; data-start=&quot;2227&quot; data-ke-size=&quot;size16&quot;&gt;무거운 연산은 휴리스틱 기반 구조 분석이 먼저 처리하고,&lt;br /&gt;모델은 판단에만 집중합니다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;6df44723084f31705f0f2e662737e6a9279dc233-800x300.webp&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;300&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/3UhJo/dJMcaaX7Rih/e7labP6HoDT7NM77ALpjUK/img.webp&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/3UhJo/dJMcaaX7Rih/e7labP6HoDT7NM77ALpjUK/img.webp&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/3UhJo/dJMcaaX7Rih/e7labP6HoDT7NM77ALpjUK/img.webp&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F3UhJo%2FdJMcaaX7Rih%2Fe7labP6HoDT7NM77ALpjUK%2Fimg.webp&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;300&quot; data-filename=&quot;6df44723084f31705f0f2e662737e6a9279dc233-800x300.webp&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;300&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-end=&quot;2295&quot; data-start=&quot;2283&quot; data-ke-size=&quot;size26&quot;&gt;결과는 분명합니다&lt;/h2&gt;
&lt;p data-end=&quot;2382&quot; data-start=&quot;2297&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF-Layout은 경쟁 솔루션 대비 &lt;b&gt;최대 10배 빠른 속도&lt;/b&gt;를 보여줍니다.&lt;br /&gt;그것도 &lt;b&gt;GPU 없이, CPU 환경에서만&lt;/b&gt; 동작합니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;2437&quot; data-start=&quot;2384&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;2397&quot; data-start=&quot;2384&quot;&gt;GPU 비용 없음&lt;/li&gt;
&lt;li data-end=&quot;2416&quot; data-start=&quot;2398&quot;&gt;클라우드 API 의존 없음&lt;/li&gt;
&lt;li data-end=&quot;2437&quot; data-start=&quot;2417&quot;&gt;로컬 환경에서 바로 실행 가능&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2499&quot; data-start=&quot;2439&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF-Layout은 PyPI에서 바로 설치할 수 있으며,&lt;br /&gt;라이브 데모도 함께 제공하고 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;2499&quot; data-start=&quot;2439&quot; data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://epapyrus.com/kor/support/contact.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;b&gt;라이브 데모 신청하러가기 &amp;gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1765502188869&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;문의하기 | 무엇이든 물어보세요.&quot; data-og-description=&quot;무엇이든 물어보세요. 빠르고 친절하게 답변해드립니다.&quot; data-og-host=&quot;epapyrus.com&quot; data-og-source-url=&quot;https://epapyrus.com/kor/support/contact.php&quot; data-og-url=&quot;https://epapyrus.com/kor/support/contact.php&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/cUJyYp/hyZPBStkXW/7RrgXjaRbZ07ArX5oF35M1/img.jpg?width=800&amp;amp;height=400&amp;amp;face=0_0_800_400&quot;&gt;&lt;a href=&quot;https://epapyrus.com/kor/support/contact.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://epapyrus.com/kor/support/contact.php&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/cUJyYp/hyZPBStkXW/7RrgXjaRbZ07ArX5oF35M1/img.jpg?width=800&amp;amp;height=400&amp;amp;face=0_0_800_400');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;문의하기 | 무엇이든 물어보세요.&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;무엇이든 물어보세요. 빠르고 친절하게 답변해드립니다.&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;epapyrus.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-end=&quot;2499&quot; data-start=&quot;2439&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://epapyrus.tistory.com/443&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;PyMuPDF-Layout 가이드 자세히 보기 &amp;gt;&amp;nbsp;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1765502154308&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;'PyMuPDF Pro' PyMuPDF Layout 시작하기!&quot; data-og-description=&quot;이 블로그 포스트에서는 PyMuPDF Pro에 포함되어 있는 PyMuPDF Layout을 어떻게 시작하는지와, 무엇을 할 수 있는지 단계별로 설명합니다.Python과 명령줄(Command Line)에 대한 기본 지식, 그리고 PyPI(Python Pa&quot; data-og-host=&quot;epapyrus.tistory.com&quot; data-og-source-url=&quot;https://epapyrus.tistory.com/443&quot; data-og-url=&quot;https://epapyrus.tistory.com/443&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/dvi5fV/hyZPs84tYH/jZrumhMEK6PhhgOw6VbQ3k/img.png?width=800&amp;amp;height=450&amp;amp;face=0_0_800_450,https://scrap.kakaocdn.net/dn/cRBtBr/hyZPFHc8nj/Y8Czk744PeoMAuXYjTMupk/img.png?width=800&amp;amp;height=450&amp;amp;face=0_0_800_450,https://scrap.kakaocdn.net/dn/bAMBwv/hyZPtmB9Wd/4HSIKdFlEHc2poDkTtyK9K/img.png?width=1080&amp;amp;height=608&amp;amp;face=0_0_1080_608&quot;&gt;&lt;a href=&quot;https://epapyrus.tistory.com/443&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://epapyrus.tistory.com/443&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/dvi5fV/hyZPs84tYH/jZrumhMEK6PhhgOw6VbQ3k/img.png?width=800&amp;amp;height=450&amp;amp;face=0_0_800_450,https://scrap.kakaocdn.net/dn/cRBtBr/hyZPFHc8nj/Y8Czk744PeoMAuXYjTMupk/img.png?width=800&amp;amp;height=450&amp;amp;face=0_0_800_450,https://scrap.kakaocdn.net/dn/bAMBwv/hyZPtmB9Wd/4HSIKdFlEHc2poDkTtyK9K/img.png?width=1080&amp;amp;height=608&amp;amp;face=0_0_1080_608');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;'PyMuPDF Pro' PyMuPDF Layout 시작하기!&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;이 블로그 포스트에서는 PyMuPDF Pro에 포함되어 있는 PyMuPDF Layout을 어떻게 시작하는지와, 무엇을 할 수 있는지 단계별로 설명합니다.Python과 명령줄(Command Line)에 대한 기본 지식, 그리고 PyPI(Python Pa&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;epapyrus.tistory.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;a href=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot;&gt;PyMuPDF Pro 제품소개페이지 바로가기 &amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1765502137301&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;PyMuPDF Pro | 문서 데이터 추출 라이브러리&quot; data-og-description=&quot;전 세계 개발자들이 사랑하는 문서 데이터 추출 파이썬 라이브러리 PyMuPDF Pro 글로벌 다운로드 9,000만 건 이상, 일간 다운로드 100만 건 이상&quot; data-og-host=&quot;epapyrus.com&quot; data-og-source-url=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot; data-og-url=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/dhTs4R/hyZPoliQaD/hn18Xm2k1umKBuJ9LRsgFK/img.jpg?width=800&amp;amp;height=400&amp;amp;face=0_0_800_400,https://scrap.kakaocdn.net/dn/bWO54d/hyZPqQXB5F/kFsVYslsTTVnOaubbhoYq0/img.jpg?width=720&amp;amp;height=400&amp;amp;face=0_0_720_400,https://scrap.kakaocdn.net/dn/YXSYp/hyZPjTqRfV/Z3Qo4QhFKotYntQl3HdQO0/img.jpg?width=619&amp;amp;height=400&amp;amp;face=0_0_619_400&quot;&gt;&lt;a href=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/dhTs4R/hyZPoliQaD/hn18Xm2k1umKBuJ9LRsgFK/img.jpg?width=800&amp;amp;height=400&amp;amp;face=0_0_800_400,https://scrap.kakaocdn.net/dn/bWO54d/hyZPqQXB5F/kFsVYslsTTVnOaubbhoYq0/img.jpg?width=720&amp;amp;height=400&amp;amp;face=0_0_720_400,https://scrap.kakaocdn.net/dn/YXSYp/hyZPjTqRfV/Z3Qo4QhFKotYntQl3HdQO0/img.jpg?width=619&amp;amp;height=400&amp;amp;face=0_0_619_400');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro | 문서 데이터 추출 라이브러리&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;전 세계 개발자들이 사랑하는 문서 데이터 추출 파이썬 라이브러리 PyMuPDF Pro 글로벌 다운로드 9,000만 건 이상, 일간 다운로드 100만 건 이상&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;epapyrus.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>AIOCR</category>
      <category>AIVLM</category>
      <category>AI데이터</category>
      <category>AI도입</category>
      <category>ocr</category>
      <category>pdf추출</category>
      <category>vlm</category>
      <category>데이터파싱</category>
      <category>문서파싱</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/448</guid>
      <comments>https://epapyrus.tistory.com/448#entry448comment</comments>
      <pubDate>Fri, 12 Dec 2025 10:13:08 +0900</pubDate>
    </item>
    <item>
      <title>AI용 데이터 추출 어떻게 하고 계신가요? 문서 포맷마다 다른 문서 파서 쓰면 안되는 이유</title>
      <link>https://epapyrus.tistory.com/447</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;11604317_4754731.jpg&quot; data-origin-width=&quot;2000&quot; data-origin-height=&quot;2000&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bGONj6/dJMcabvWoiC/BRgwbdZnMa4Rfz7ZdRcaok/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bGONj6/dJMcabvWoiC/BRgwbdZnMa4Rfz7ZdRcaok/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bGONj6/dJMcabvWoiC/BRgwbdZnMa4Rfz7ZdRcaok/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbGONj6%2FdJMcabvWoiC%2FBRgwbdZnMa4Rfz7ZdRcaok%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;2000&quot; height=&quot;2000&quot; data-filename=&quot;11604317_4754731.jpg&quot; data-origin-width=&quot;2000&quot; data-origin-height=&quot;2000&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;AI용 데이터 추출 어떻게 하고 계신가요?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;문서 포맷마다 다른 파싱 제품을 돌려가며 쓰고 계시진 않으신가요&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-size=&quot;size16&quot; data-ke-style=&quot;style1&quot;&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;PDF는 A 솔루션&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;아래한글(HWP,HWPX)은 B 제품&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;Word&amp;middot;Excel은 또 다른 프로그램&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;제각각 다른 문서 파싱 프로그램으로 추출된 데이터는 &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&amp;nbsp;페이지 정보, 위치 정보가 일관되게 추출되지 않습니다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;막상 추출한 데이터를 AI 서비스에 적용할 때 문제가 발생할 수 밖에 없습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt; AI 기반 문서 검색(Q&amp;amp;A), 요약, 분석 LLM 서비스를 구축해 놓았을 때,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;b&gt;문서마다 다른 파서로 데이터를 추출했다면, 질의 응답의 근거가 되는 부분을 찾아내기가 어려워&lt;/b&gt;집니다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt; 추출 된 데이터의 좌표, 구조가 일관되지 않고 파서마다 달라질 확률이 있기 때문입니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;실제 업무에 활용할 수 있는 AI 질의 응답 서비스는&lt;/span&gt;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;br /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&amp;ldquo;어떤 부분에서 이 답변이 나온 거지?&amp;rdquo; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&amp;ldquo;LLM이 이 문장을 어디서 인용했지?&amp;rdquo;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;의문이 들었을 때, 바로 &lt;b&gt;해당 문서에서 답변의 근거를 찾아서 보여줄 수 있는 근거 기반 AI&lt;/b&gt;가 되어야합니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt; LLM이&amp;nbsp;답을&amp;nbsp;생성해도&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;답변의 근거가 어디에 있었는지 사용자에게 정확히 보여줄 수 없고,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&amp;nbsp;답변의 진위여부를 바로바로 확인할 수 없다면&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;AI 서비스를 신뢰하고 업무에 적용하기 어렵겠죠.&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;b&gt; &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;py-mupdf-pro-full-logo-with-text.png&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;500&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/oOBzi/dJMcacVUJOQ/NPFi4aRzFK8s1MaYy0cBbk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/oOBzi/dJMcacVUJOQ/NPFi4aRzFK8s1MaYy0cBbk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/oOBzi/dJMcacVUJOQ/NPFi4aRzFK8s1MaYy0cBbk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FoOBzi%2FdJMcacVUJOQ%2FNPFi4aRzFK8s1MaYy0cBbk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;500&quot; data-filename=&quot;py-mupdf-pro-full-logo-with-text.png&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;500&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;b&gt;PyMuPDF Pro는 HWP/HWPX, MS오피스(PPT, 엑셀, 워드), PDF, 이미지 문서를&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;b&gt;하나의&amp;nbsp;파이프라인에서&amp;nbsp;직접&amp;nbsp;처리하여&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;b&gt;AI가 활용하기 좋은 포맷인 Markdown + 위치정보(JSON)로 변환합니다.&lt;br /&gt;문서의 레이아웃과 문서 속 다양한 요소를 이해해 빠르고 정확하게 데이터를 추출합니다.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;demo-hero.webp&quot; data-origin-width=&quot;2560&quot; data-origin-height=&quot;1674&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bn0fy9/dJMcac9pzpj/Y1CMqNAikDxJt0IKoGQQY1/img.webp&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bn0fy9/dJMcac9pzpj/Y1CMqNAikDxJt0IKoGQQY1/img.webp&quot; data-alt=&quot;실제 PyMuPDF Pro Layout을 사용해 복잡한 문서의 구조를 분석한 경우&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bn0fy9/dJMcac9pzpj/Y1CMqNAikDxJt0IKoGQQY1/img.webp&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbn0fy9%2FdJMcac9pzpj%2FY1CMqNAikDxJt0IKoGQQY1%2Fimg.webp&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;2560&quot; height=&quot;1674&quot; data-filename=&quot;demo-hero.webp&quot; data-origin-width=&quot;2560&quot; data-origin-height=&quot;1674&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;실제 PyMuPDF Pro Layout을 사용해 복잡한 문서의 구조를 분석한 경우&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;이렇게 통일된 형태의 데이터를 활용하면 문서 구조와 위치 값을 모두 일관되게 보존해&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;b&gt;AI 서비스의 답변 근거를 원본 문서에 정확히 하이라이트&lt;/b&gt;할 수 있습니다.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;서비스 이용자들도 직접 눈으로 확인할 수 있으니 신뢰하고 서비스를 이용할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;결국 &lt;b&gt;정확한 데이터를 추출하는 것이 AI 및 LLM 서비스의 가장 중요한 작업이자 핵심&lt;/b&gt;이라고 할 수 있겠죠!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;이제, AI 도입용 데이터 추출을 하나의 파이프라인으로 통합하세요.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;PyMuPDF Pro로 신뢰할 수 있는 AI 서비스로 업그레이드할 수 있습니다 &lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;b&gt;정확한 문서 기반 AI 서비스의 필수 인프라, PyMuPDF Pro!&amp;nbsp;&lt;br /&gt;지금 2개월간 무료 체험해보세요.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size18&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://epapyrus.com/kor/support/contact.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;PyMuPDF Pro 2개월 무료 트라이얼 받으러가기 &amp;gt;&amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;문의하기를 통해 2개월 트라이얼을 요청하시면 빠르게 안내해드립니다&lt;/b&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>Ai</category>
      <category>AI데이터</category>
      <category>AI질의응답</category>
      <category>PyMuPDFPro</category>
      <category>데이터추출</category>
      <category>데이터파싱</category>
      <category>문서추출</category>
      <category>문서파싱</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/447</guid>
      <comments>https://epapyrus.tistory.com/447#entry447comment</comments>
      <pubDate>Mon, 8 Dec 2025 17:03:12 +0900</pubDate>
    </item>
    <item>
      <title>비전 모델이 따라올 수 없는 문서 이해력: PDF 네이티브 접근 방식의 힘</title>
      <link>https://epapyrus.tistory.com/445</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;blog_PyMuPDF PRo_네이티브대비전모델.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dsU3zs/dJMcabJs3Ip/h56JfUjCYlLhkrvxlX6R8K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dsU3zs/dJMcabJs3Ip/h56JfUjCYlLhkrvxlX6R8K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dsU3zs/dJMcabJs3Ip/h56JfUjCYlLhkrvxlX6R8K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdsU3zs%2FdJMcabJs3Ip%2Fh56JfUjCYlLhkrvxlX6R8K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;blog_PyMuPDF PRo_네이티브대비전모델.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-end=&quot;308&quot; data-start=&quot;156&quot; data-ke-size=&quot;size16&quot;&gt;Google이 최근 Gemini 3.0을 공개하면서 문서 AI 업계가 꽤 들썩이고 있습니다.&lt;br /&gt;멀티모달 성능이 좋아졌다는 얘기도 많고, 실제로 문서 처리 회사들 중 일부는 벌써 파싱 작업에 적용해서 필기체 인식이나 읽기 순서 감지 같은 부분의 개선을 확인했다고 합니다.&lt;/p&gt;
&lt;p data-end=&quot;441&quot; data-start=&quot;310&quot; data-ke-size=&quot;size16&quot;&gt;하지만&amp;nbsp;초기&amp;nbsp;사용자들은&amp;nbsp;여전히&amp;nbsp;해결되지&amp;nbsp;않은&amp;nbsp;문제도&amp;nbsp;발견했습니다.&lt;br /&gt;복잡한&amp;nbsp;레이아웃에서는&amp;nbsp;성능이&amp;nbsp;떨어지고,&amp;nbsp;취소선&amp;nbsp;같은&amp;nbsp;텍스트&amp;nbsp;스타일을&amp;nbsp;제대로&amp;nbsp;못&amp;nbsp;잡는&amp;nbsp;경우가&amp;nbsp;많으며,&amp;nbsp;특정&amp;nbsp;텍스트&amp;nbsp;위치를&amp;nbsp;박스로&amp;nbsp;표시해&amp;nbsp;인용하는(bounding-box&amp;nbsp;citation)&amp;nbsp;기능도&amp;nbsp;정확하지&amp;nbsp;않다는&amp;nbsp;점이죠.&lt;/p&gt;
&lt;p data-end=&quot;518&quot; data-start=&quot;443&quot; data-ke-size=&quot;size16&quot;&gt;사실 이건 그렇게 놀라운 일도 아닙니다.&lt;br /&gt;PDF를 다룰 때 비전 기반 시스템은 근본적으로 넘어야 할 벽이 있어요.&lt;br /&gt;쉽게 말하면:&lt;/p&gt;
&lt;p data-end=&quot;551&quot; data-start=&quot;520&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;애초에 문제 자체를 잘못 정의하고 있는 셈입니다.&lt;/b&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;583&quot; data-start=&quot;558&quot; data-ke-size=&quot;size26&quot;&gt;Vision Model이 바라보는 PDF&lt;/h2&gt;
&lt;p data-end=&quot;648&quot; data-start=&quot;585&quot; data-ke-size=&quot;size16&quot;&gt;Gemini 3.0 같은 VLM(Vision Language Model)은 PDF를 그냥 &amp;ldquo;이미지&amp;rdquo;로 취급합니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;713&quot; data-start=&quot;650&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;668&quot; data-start=&quot;650&quot;&gt;페이지를 픽셀로 렌더링하고&lt;/li&gt;
&lt;li data-end=&quot;713&quot; data-start=&quot;669&quot;&gt;하나의 큰 모델이 텍스트 인식, 레이아웃 감지, 의미 파악까지 전부 처리&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;775&quot; data-start=&quot;715&quot; data-ke-size=&quot;size16&quot;&gt;이 방식이 강력한 건 맞습니다. 태스크 전체를 통으로 최적화할 수 있으니까요.&lt;br /&gt;하지만 단점도 명확합니다:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1005&quot; data-start=&quot;777&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;828&quot; data-start=&quot;777&quot;&gt;&lt;b&gt;연산량 폭발:&lt;/b&gt; 픽셀을 처리해야 하니 파라미터도 크고 GPU 자원도 많이 필요함&lt;/li&gt;
&lt;li data-end=&quot;909&quot; data-start=&quot;829&quot;&gt;&lt;b&gt;텍스트 정확도 보장 어려움:&lt;/b&gt; PDF에 이미 존재하는 고유 텍스트를 쓰는 게 아니기 때문에 폰트&amp;middot;취소선&amp;middot;굵기 같은 포맷을 자주 틀림&lt;/li&gt;
&lt;li data-end=&quot;962&quot; data-start=&quot;910&quot;&gt;&lt;b&gt;오류 수정이 힘듦:&lt;/b&gt; 틀리면 패치를 못 하고 프롬프트 수정이나 모델 튜닝이 필요함&lt;/li&gt;
&lt;li data-end=&quot;1005&quot; data-start=&quot;963&quot;&gt;&lt;b&gt;문서에는 이미 있는 정보를 복구하려고 너무 많은 파라미터를 씀&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1103&quot; data-start=&quot;1007&quot; data-ke-size=&quot;size16&quot;&gt;스캔 문서나 필기 노트라면 이 방식이 맞을 수 있지만,&lt;br /&gt;대부분의 비즈니스 문서가 &lt;b&gt;born-digital PDF&lt;/b&gt;라는 점을 생각하면 좀 과합니다. 효율도 떨어지고요.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;1128&quot; data-start=&quot;1110&quot; data-ke-size=&quot;size26&quot;&gt;PDF는 이미지가 아니다&lt;/h2&gt;
&lt;p data-end=&quot;1173&quot; data-start=&quot;1130&quot; data-ke-size=&quot;size16&quot;&gt;PDF 안에는 비전 모델이 전혀 접근할 수 없는 정보들이 잔뜩 들어 있습니다:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1322&quot; data-start=&quot;1175&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1224&quot; data-start=&quot;1175&quot;&gt;텍스트 객체 + 폰트 속성(볼드, 이탤릭, 모노스페이스, 취소선, 하이라이트 등)&lt;/li&gt;
&lt;li data-end=&quot;1262&quot; data-start=&quot;1225&quot;&gt;테이블 선, 그리드 등 각종 레이아웃을 구성하는 벡터 그래픽&lt;/li&gt;
&lt;li data-end=&quot;1279&quot; data-start=&quot;1263&quot;&gt;로고 같은 이미지 객체&lt;/li&gt;
&lt;li data-end=&quot;1293&quot; data-start=&quot;1280&quot;&gt;주석, 하이라이트&lt;/li&gt;
&lt;li data-end=&quot;1322&quot; data-start=&quot;1294&quot;&gt;문서 구조/북마크/읽기 순서 같은 메타데이터&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1406&quot; data-start=&quot;1324&quot; data-ke-size=&quot;size16&quot;&gt;PDF를 이미지로 렌더링하면 이 정보가 전부 사라집니다.&lt;br /&gt;그러면 비전 모델은 이걸 픽셀에서 다시 유추해야 합니다.&lt;br /&gt;당연히 부정확하고 비싸죠.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;1438&quot; data-start=&quot;1413&quot; data-ke-size=&quot;size26&quot;&gt;PDF-Native 접근 방식의 장점&lt;/h2&gt;
&lt;p data-end=&quot;1511&quot; data-start=&quot;1440&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF-Layout은 PDF 내부 구조를 그대로 읽습니다.&lt;br /&gt;즉, 이미 문서 안에 존재하는 정보만 잘 활용하면 됩니다.&lt;/p&gt;
&lt;pre id=&quot;code_1764915234232&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;import pymupdf.layout
import pymupdf4llm

# Extract structured content as markdown
doc = pymupdf.open(&quot;document.pdf&quot;)
md_text = pymupdf4llm.to_markdown(doc)

# Or extract as JSON
json_text = pymupdf4llm.to_json(doc)&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이 방식이 좋은 이유는 명확합니다:&lt;/p&gt;
&lt;h3 data-end=&quot;1762&quot; data-start=&quot;1741&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;1. 텍스트 정확도 100%&lt;/b&gt;&lt;/h3&gt;
&lt;p data-end=&quot;1839&quot; data-start=&quot;1763&quot; data-ke-size=&quot;size16&quot;&gt;OCR 추론이 아니라 &lt;b&gt;PDF에 저장된 텍스트 그 자체&lt;/b&gt;를 읽습니다.&lt;br /&gt;취소선, 폰트 스타일, 코드 폰트 등도 정확하게 가져옵니다.&lt;/p&gt;
&lt;h3 data-end=&quot;1865&quot; data-start=&quot;1846&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;2. 정확한 테이블 감지&lt;/b&gt;&lt;/h3&gt;
&lt;p data-end=&quot;1922&quot; data-start=&quot;1866&quot; data-ke-size=&quot;size16&quot;&gt;우리 GNN 모델은 테이블 경계를 잡고,&lt;br /&gt;PyMuPDF는 벡터 그래픽을 분석해 행&amp;middot;열을 뽑습니다.&lt;/p&gt;
&lt;p data-end=&quot;1992&quot; data-start=&quot;1924&quot; data-ke-size=&quot;size16&quot;&gt;최근 복잡한 금융 문서에서 &lt;b&gt;97% 정확도&lt;/b&gt;로 테이블 구조를 감지했습니다.&lt;br /&gt;이건 비전 모델이 자주 놓치는 부분이죠.&lt;/p&gt;
&lt;h3 data-end=&quot;2015&quot; data-start=&quot;1999&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;3. 리소스 효율성&lt;/b&gt;&lt;/h3&gt;
&lt;p data-end=&quot;2104&quot; data-start=&quot;2016&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF-Layout은 &lt;b&gt;CPU에서&lt;/b&gt;, &lt;b&gt;1.8M 파라미터&lt;/b&gt;로 실행됩니다.&lt;br /&gt;Gemini 3.0은 &lt;b&gt;GPU + 수십억 파라미터&lt;/b&gt;가 필요하죠.&lt;/p&gt;
&lt;p data-end=&quot;2187&quot; data-start=&quot;2106&quot; data-ke-size=&quot;size16&quot;&gt;수천 건의 문서를 매일 처리하는 기업 입장에서 비용 차이는&amp;hellip;&lt;br /&gt;말할 필요도 없습니다.&lt;br /&gt;게다가 대부분의 문서는 &lt;b&gt;1초 미만&lt;/b&gt;에 처리됩니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;2209&quot; data-start=&quot;2194&quot; data-ke-size=&quot;size26&quot;&gt;스캔 문서는 어떡하죠?&lt;/h2&gt;
&lt;p data-end=&quot;2329&quot; data-start=&quot;2211&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF-Layout에는 OCR이 내장되어 있습니다.&lt;br /&gt;페이지를 분석해서 OCR이 유용하다고 판단되면 자동으로 Tesseract를 호출합니다.&lt;br /&gt;이후에는 born-digital 문서와 똑같이 처리합니다.&lt;/p&gt;
&lt;p data-end=&quot;2375&quot; data-start=&quot;2331&quot; data-ke-size=&quot;size16&quot;&gt;RapidOCR 같은 다른 엔진도 추가될 예정이어서 선택지가 더 넓어질 거예요.&lt;/p&gt;
&lt;p data-end=&quot;2461&quot; data-start=&quot;2377&quot; data-ke-size=&quot;size16&quot;&gt;물론 손글씨가 많거나 심하게 훼손된 스캔은 비전 모델이 유리할 수 있습니다.&lt;br /&gt;하지만 일반적인 비즈니스 스캔 문서는 GPU 없이도 충분히 해결됩니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;2491&quot; data-start=&quot;2468&quot; data-ke-size=&quot;size26&quot;&gt;우리의 전략: 경쟁이 아니라 보완&lt;/h2&gt;
&lt;p data-end=&quot;2589&quot; data-start=&quot;2493&quot; data-ke-size=&quot;size16&quot;&gt;우리는 VLM이 하는 모든 걸 따라가려는 게 아닙니다.&lt;br /&gt;오히려 VLM이 접근할 수 없는 PDF 내부 구조를 활용해&lt;br /&gt;더 효율적이고 정확한 문서 추출을 만들고 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;2628&quot; data-start=&quot;2591&quot; data-ke-size=&quot;size16&quot;&gt;차세대 모델은 teacher-student 방식으로 학습 중입니다:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;2723&quot; data-start=&quot;2630&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;2673&quot; data-start=&quot;2630&quot;&gt;공개 데이터셋(DocLayNet, PublayNet 등 40만 페이지)&lt;/li&gt;
&lt;li data-end=&quot;2698&quot; data-start=&quot;2674&quot;&gt;비공개 비즈니스 문서(50만 페이지)&lt;/li&gt;
&lt;li data-end=&quot;2723&quot; data-start=&quot;2699&quot;&gt;VLM과 비교 평가를 통한 지속 개선&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;2787&quot; data-start=&quot;2725&quot; data-ke-size=&quot;size16&quot;&gt;이 방식은 PDF-native 효율성과&lt;br /&gt;비전 기반의 유연성을 함께 가져갈 수 있는 접근입니다&amp;mdash;GPU 없이요.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-end=&quot;2873&quot; data-start=&quot;2803&quot; data-ke-size=&quot;size16&quot;&gt;만약 여러분이 주로 &lt;b&gt;청&lt;/b&gt;구서, 재무 보고서, 계약서, 기술 문서처럼 &amp;lsquo;디지털 원본 PDF(born-digital PDF)&amp;rsquo;를 파싱한다면,&lt;br /&gt;PDF 네이티브(구조분석) 방식의 문서 추출 소프트웨어가 비전 모델보다 더 빠르고, 더 정확하며, 비용도 압도적으로 적게 듭니다.&lt;/p&gt;
&lt;p data-end=&quot;2987&quot; data-start=&quot;2927&quot; data-ke-size=&quot;size16&quot;&gt;스캔 문서를 다루는 경우에도 PyMuPDF-Layout의 OCR 통합 기능으로 대부분 해결 가능합니다.&lt;br /&gt;굳이 무거운 비전 모델을 쓸 이유가 없죠.&lt;/p&gt;
&lt;p data-end=&quot;3036&quot; data-start=&quot;2989&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;이미 읽을 수 있는 것을 다시 복구하려 하지 마세요.&lt;br /&gt;그냥 읽으면 됩니다.&lt;/b&gt;&lt;/p&gt;
&lt;p data-end=&quot;3036&quot; data-start=&quot;2989&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF-Layout은 PyPI에서 설치할 수 있고,&lt;br /&gt;라이브 데모도 바로 사용해볼 수 있습니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;  &lt;b&gt;Happy Coding!  &lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;앞으로,&amp;nbsp;다양하고&amp;nbsp;유익한&amp;nbsp;PyMuPDF&amp;nbsp;Pro&amp;nbsp;튜토리얼로&amp;nbsp;찾아오겠습니다.&amp;nbsp;기대해주세요!&amp;nbsp;감사합니다&amp;nbsp;:)&lt;br /&gt;&lt;a href=&quot;https://epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot;&gt;PyMuPDF Pro 제품소개페이지 바로가기 &amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>AIOCR</category>
      <category>AI데이터</category>
      <category>AI데이터추출</category>
      <category>AI학습</category>
      <category>ocr</category>
      <category>pdf추출</category>
      <category>pdf파싱</category>
      <category>데이터추출</category>
      <category>문서추출</category>
      <category>문서파싱</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/445</guid>
      <comments>https://epapyrus.tistory.com/445#entry445comment</comments>
      <pubDate>Fri, 5 Dec 2025 16:44:03 +0900</pubDate>
    </item>
    <item>
      <title>68만 IT 크리에이터 조코딩이 소개하는 PyMuPDF Pro! 궁금하신가요?</title>
      <link>https://epapyrus.tistory.com/442</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;AI 개발자들의 필수 PDF 도구, &lt;span style=&quot;background-color: #f6e199;&quot;&gt;PyMuPDF Pro가 68만 구독자를 보유한 IT 유튜버 조코딩의 AI 뉴스 콘텐츠에 소개&lt;/span&gt;되었습니다!&lt;br /&gt;조코딩은 영상에서 &amp;ldquo;AI 연동의 핵심 도구&amp;rdquo;로 PyMuPDF Pro를 소개하며, PDF에서 직접 데이터를 추출하고 활용하는 방법도 시연했습니다  &lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;스크린샷 2025-11-11 085211.png&quot; data-origin-width=&quot;1232&quot; data-origin-height=&quot;692&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/qTlXI/dJMcagKBR3i/fKAKVNP21obEy2kVvjgoz1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/qTlXI/dJMcagKBR3i/fKAKVNP21obEy2kVvjgoz1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/qTlXI/dJMcagKBR3i/fKAKVNP21obEy2kVvjgoz1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FqTlXI%2FdJMcagKBR3i%2FfKAKVNP21obEy2kVvjgoz1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1232&quot; height=&quot;692&quot; data-filename=&quot;스크린샷 2025-11-11 085211.png&quot; data-origin-width=&quot;1232&quot; data-origin-height=&quot;692&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro의 어떤내용이 소개되었는지 간단하게 알려드릴게요&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1147&quot; data-origin-height=&quot;642&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/eAT2bt/dJMb99LucOz/Zn21neRsdp2dCz4YK69eFk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/eAT2bt/dJMb99LucOz/Zn21neRsdp2dCz4YK69eFk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/eAT2bt/dJMb99LucOz/Zn21neRsdp2dCz4YK69eFk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FeAT2bt%2FdJMb99LucOz%2FZn21neRsdp2dCz4YK69eFk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1147&quot; height=&quot;642&quot; data-origin-width=&quot;1147&quot; data-origin-height=&quot;642&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;스크린샷 2025-11-11 145141.png&quot; data-origin-width=&quot;1137&quot; data-origin-height=&quot;543&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/L2y2g/dJMcajUR2Qt/xo8luKxHTP2p7YW3GEyuy0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/L2y2g/dJMcajUR2Qt/xo8luKxHTP2p7YW3GEyuy0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/L2y2g/dJMcajUR2Qt/xo8luKxHTP2p7YW3GEyuy0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FL2y2g%2FdJMcajUR2Qt%2Fxo8luKxHTP2p7YW3GEyuy0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1137&quot; height=&quot;543&quot; data-filename=&quot;스크린샷 2025-11-11 145141.png&quot; data-origin-width=&quot;1137&quot; data-origin-height=&quot;543&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1145&quot; data-origin-height=&quot;645&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bIPRLZ/dJMcac9hwNn/uv6myPG7rZKP7z7Gc7YPgK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bIPRLZ/dJMcac9hwNn/uv6myPG7rZKP7z7Gc7YPgK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bIPRLZ/dJMcac9hwNn/uv6myPG7rZKP7z7Gc7YPgK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbIPRLZ%2FdJMcac9hwNn%2Fuv6myPG7rZKP7z7Gc7YPgK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1145&quot; height=&quot;645&quot; data-origin-width=&quot;1145&quot; data-origin-height=&quot;645&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1147&quot; data-origin-height=&quot;642&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/d5YW1Y/dJMcahvY1CC/H1w8SJYa4YfXHiHh0moiXk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/d5YW1Y/dJMcahvY1CC/H1w8SJYa4YfXHiHh0moiXk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/d5YW1Y/dJMcahvY1CC/H1w8SJYa4YfXHiHh0moiXk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fd5YW1Y%2FdJMcahvY1CC%2FH1w8SJYa4YfXHiHh0moiXk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1147&quot; height=&quot;642&quot; data-origin-width=&quot;1147&quot; data-origin-height=&quot;642&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1145&quot; data-origin-height=&quot;646&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/tI5jT/dJMcaap5ELi/HKRrqxWKvfEi0QvCOhTHuk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/tI5jT/dJMcaap5ELi/HKRrqxWKvfEi0QvCOhTHuk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/tI5jT/dJMcaap5ELi/HKRrqxWKvfEi0QvCOhTHuk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FtI5jT%2FdJMcaap5ELi%2FHKRrqxWKvfEi0QvCOhTHuk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1145&quot; height=&quot;646&quot; data-origin-width=&quot;1145&quot; data-origin-height=&quot;646&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1143&quot; data-origin-height=&quot;646&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/yIlLV/dJMcacuFZOP/Jp4YcmdMgC746XMn0qQTPk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/yIlLV/dJMcacuFZOP/Jp4YcmdMgC746XMn0qQTPk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/yIlLV/dJMcacuFZOP/Jp4YcmdMgC746XMn0qQTPk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FyIlLV%2FdJMcacuFZOP%2FJp4YcmdMgC746XMn0qQTPk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1143&quot; height=&quot;646&quot; data-origin-width=&quot;1143&quot; data-origin-height=&quot;646&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1143&quot; data-origin-height=&quot;649&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cfTHgK/dJMcaezgbGu/OLM8Amz0g71F2EkIUO9Eb1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cfTHgK/dJMcaezgbGu/OLM8Amz0g71F2EkIUO9Eb1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cfTHgK/dJMcaezgbGu/OLM8Amz0g71F2EkIUO9Eb1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcfTHgK%2FdJMcaezgbGu%2FOLM8Amz0g71F2EkIUO9Eb1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1143&quot; height=&quot;649&quot; data-origin-width=&quot;1143&quot; data-origin-height=&quot;649&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro의 탁월한 표(레이아웃) 속 데이터 추출 기능을 중점적으로 설명해주었네요!&lt;br /&gt;누구나 이해하기 쉽게 예시와 함께 잘 소개되었습니다✨&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;표추출 기능뿐 아니라 &lt;span style=&quot;background-color: #f6e199;&quot;&gt;개인정보 보호에 꼭 필요한 비식별화, 왜 PyMuPDF PRo가 AI연동에 좋은 제품인지 그 이유까지!&lt;/span&gt;&amp;nbsp;다각도로 소개하고 있으니, 전체 내용이 궁금하신분께서는 조코딩의 소개영상, 놓치지마시고 꼭 체크해보세요!&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size18&quot;&gt;&lt;br /&gt;&lt;a href=&quot;https://youtu.be/ENWoIZtouxc?t=233&amp;amp;si=9wp0Np4RSaRs7AtT&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&amp;gt;&amp;gt; 조코딩 소개영상 보러가기&lt;/a&gt;&lt;/p&gt;</description>
      <category>이파피루스 소식</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/442</guid>
      <comments>https://epapyrus.tistory.com/442#entry442comment</comments>
      <pubDate>Tue, 11 Nov 2025 15:04:51 +0900</pubDate>
    </item>
    <item>
      <title>PyMuPDF Pro 설치 가이드</title>
      <link>https://epapyrus.tistory.com/441</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;blog_PyMuPDF PRo.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cMx4Ni/dJMcagDQlgQ/aKIPn4mIci5qRbZiOdK1Uk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cMx4Ni/dJMcagDQlgQ/aKIPn4mIci5qRbZiOdK1Uk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cMx4Ni/dJMcagDQlgQ/aKIPn4mIci5qRbZiOdK1Uk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcMx4Ni%2FdJMcagDQlgQ%2FaKIPn4mIci5qRbZiOdK1Uk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;blog_PyMuPDF PRo.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;안녕하세요, 이파피루스입니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PyMuPDF&amp;nbsp;Pro를&amp;nbsp;처음&amp;nbsp;사용하시나요?&lt;br /&gt;이 포스팅에서는 PyMuPDF Pro를 설치하는 방법을 안내드립니다.&amp;nbsp;간단하게 설치하고, 자유롭게 PyMuPDF Pro를 활용해보세요!&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size18&quot;&gt;&lt;b&gt;PyMuPDF Pro 설치 안내&lt;/b&gt; &lt;br /&gt;PyMuPDF Pro는 서버/로컬 환경 모두에서 Python 패키지 형태로 사용할 수 있습니다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;blog_설치가이드.png&quot; data-origin-width=&quot;1123&quot; data-origin-height=&quot;164&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bLnzkX/dJMcabCw9BT/T27Xv7jPM5xrvmlJNZJKWK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bLnzkX/dJMcabCw9BT/T27Xv7jPM5xrvmlJNZJKWK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bLnzkX/dJMcabCw9BT/T27Xv7jPM5xrvmlJNZJKWK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbLnzkX%2FdJMcabCw9BT%2FT27Xv7jPM5xrvmlJNZJKWK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1123&quot; height=&quot;164&quot; data-filename=&quot;blog_설치가이드.png&quot; data-origin-width=&quot;1123&quot; data-origin-height=&quot;164&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;1. Python 환경(3.10 이상)에서 아래 명령을 실행해 주세요.&lt;/p&gt;
&lt;pre id=&quot;code_1762836497625&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;pip install pymupdfpro&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;2. 설치 후 아래 코드를 실행하여 라이선스를 활성화할 수 있습니다.&lt;/p&gt;
&lt;pre id=&quot;code_1762836549619&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;import pymupdf.pro
pymupdf.pro.unlock(&quot;여기에_라이선스_코드_입력&quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;투스텝으로 설치를 마쳤습니다. 놀랍도록 간단하죠!&lt;br /&gt;이제, PyMuPDF Pro로 손쉽게 데이터 추출이 가능합니다  &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;감사합니다.&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/441</guid>
      <comments>https://epapyrus.tistory.com/441#entry441comment</comments>
      <pubDate>Tue, 11 Nov 2025 13:51:13 +0900</pubDate>
    </item>
    <item>
      <title>[IT 기업 AX 전략&amp;middot;솔루션/ 기업용 SW ⑬] 이파피루스</title>
      <link>https://epapyrus.tistory.com/440</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;ePapyurs-Logo-RGB-Dark.png&quot; data-origin-width=&quot;7140&quot; data-origin-height=&quot;3342&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/s8YeY/dJMcaj8nNtQ/SwzpEKcE11lam7WpGzFu90/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/s8YeY/dJMcaj8nNtQ/SwzpEKcE11lam7WpGzFu90/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/s8YeY/dJMcaj8nNtQ/SwzpEKcE11lam7WpGzFu90/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fs8YeY%2FdJMcaj8nNtQ%2FSwzpEKcE11lam7WpGzFu90%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;7140&quot; height=&quot;3342&quot; data-filename=&quot;ePapyurs-Logo-RGB-Dark.png&quot; data-origin-width=&quot;7140&quot; data-origin-height=&quot;3342&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style2&quot;&gt;&lt;b&gt;&amp;ldquo;20년 축적된 PDF 기술과 AI 기반 문서 솔루션으로 글로벌 SaaS 기업 도약&amp;rdquo;&lt;/b&gt;&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;background-color: #ffffff; color: #222222; text-align: start;&quot;&gt;20년 업력의 문서 처리 전문가, AI 기반 솔루션으로 혁신 주도&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #ffffff; color: #222222; text-align: start;&quot;&gt;이파피루스는 2004년에 설립된 문서 처리 전문 기업으로, 전 세계 70여 개국 2천여 고객사에 PDF 및 AI 기반 문서 솔루션을 공급하고 있다. 본사는 판교에 위치하고 있으며, 실리콘밸리에 위치한 자회사 아티펙스(Artifex)와 함께 글로벌 시장을 대상으로 고성능 PDF 엔진과 AI 문서 인식 기술을 개발 중이다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #ffffff; color: #222222; text-align: start;&quot;&gt;이파피루스는 20년간 축적해 온 PDF 기술력과 최신 AI 기반 문서 분석 기술을 결합해 기업의 문서 데이터 활용 효율을 극대화하는 다양한 솔루션을 제공하고 있다. AI는 문서 중심 산업의 핵심 인프라로, 수많은 문서 속에 기업 의사결정에 필요한 핵심 정보가 숨어 있다. 하지만 대부분의 조직은 이러한 데이터를 충분히 활용하지 못하고 있다는 점을 해결하기 위해 이파피루스는 AI를 활용하고 있다.&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;대표님 인터뷰&lt;/b&gt;를 포함한 자세한 내용은 아래에서 확인해주세요 :)&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;http://www.itdaily.kr/news/articleView.html?idxno=236070&quot; target=&quot;_blank&quot; rel=&quot;noopener&amp;nbsp;noreferrer&quot;&gt;http://www.itdaily.kr/news/articleView.html?idxno=236070&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1762403418243&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;[IT 기업 AX 전략&amp;middot;솔루션/ 기업용 SW ⑬] 이파피루스 - 아이티데일리&quot; data-og-description=&quot;[아이티데일리]20년 업력의 문서 처리 전문가, AI 기반 솔루션으로 혁신 주도이파피루스는 2004년에 설립된 문서 처리 전문 기업으로, 전 세계 70여 개국 2천여 고객사에 PDF 및 AI 기반 문서 솔루션&quot; data-og-host=&quot;www.itdaily.kr&quot; data-og-source-url=&quot;http://www.itdaily.kr/news/articleView.html?idxno=236070&quot; data-og-url=&quot;http://www.itdaily.kr/news/articleView.html?idxno=236070&quot; data-og-image=&quot;&quot;&gt;&lt;a href=&quot;http://www.itdaily.kr/news/articleView.html?idxno=236070&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;http://www.itdaily.kr/news/articleView.html?idxno=236070&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url();&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;[IT 기업 AX 전략&amp;middot;솔루션/ 기업용 SW ⑬] 이파피루스 - 아이티데일리&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;[아이티데일리]20년 업력의 문서 처리 전문가, AI 기반 솔루션으로 혁신 주도이파피루스는 2004년에 설립된 문서 처리 전문 기업으로, 전 세계 70여 개국 2천여 고객사에 PDF 및 AI 기반 문서 솔루션&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;www.itdaily.kr&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>언론보도</category>
      <category>기업용소프트웨어</category>
      <category>문서ai</category>
      <category>이파피루스</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/440</guid>
      <comments>https://epapyrus.tistory.com/440#entry440comment</comments>
      <pubDate>Thu, 6 Nov 2025 13:31:58 +0900</pubDate>
    </item>
    <item>
      <title>[런칭] 문서 데이터 추출, GPU 없이도 가능하다고? PDF의 DNA를 해석하는 'PyMuPDF-Layout'</title>
      <link>https://epapyrus.tistory.com/439</link>
      <description>&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;b&gt;&lt;b&gt;시작&lt;br /&gt;&lt;/b&gt;&lt;/b&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;pymupdf-layout-hero.webp&quot; data-origin-width=&quot;2288&quot; data-origin-height=&quot;1600&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/MNMXQ/dJMcajgcqt2/4KFn3IkvUhvYBalhw3JEjK/img.webp&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/MNMXQ/dJMcajgcqt2/4KFn3IkvUhvYBalhw3JEjK/img.webp&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/MNMXQ/dJMcajgcqt2/4KFn3IkvUhvYBalhw3JEjK/img.webp&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FMNMXQ%2FdJMcajgcqt2%2F4KFn3IkvUhvYBalhw3JEjK%2Fimg.webp&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;2288&quot; height=&quot;1600&quot; data-filename=&quot;pymupdf-layout-hero.webp&quot; data-origin-width=&quot;2288&quot; data-origin-height=&quot;1600&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;지난 9월, 유럽과 아시아에서 온 동료들이 샌프란시스코 본사에서 북쪽으로 110km 떨어진 작은 해안 마을에 모였습니다. 이파피루스와 이파피루스의 미국 자회사 Artifex 팀원들은 거의 모든 시간대에 흩어져 일하고 있거든요. 안개가 밀려오는 가운데, 우리는 일주일 내내 단 하나의 주제만 논의했습니다: 35년간 쌓아온 문서 처리 지식, 특히 PDF 같은 비정형 포맷 전문성을 최첨단 AI와 어떻게 결합해서 최고의 데이터 파싱 솔루션을 만들 수 있을까?&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;이파피루스와 Artifex는 이미 PyMuPDF 제품군으로 인기 있는 파싱 솔루션을 제공하고 있습니다. 마크다운 출력에 특화된 PyMuPDF4LLM도 포함해서요. Notion, DocuSign, Oracle 같은 주요 고객들이 우리 솔루션을 쓰고 있지만, AI 혁명으로 이 분야가 빠르게 변하고 있다는 걸 체감했습니다. 파싱에서 가장 주목받는 접근법은 VLM(비전 언어 모델)을 쓰는 겁니다. 쉽게 말하면, PDF 포맷은 무시하고 이미지 파일로 바꾼 다음 Vision Transformer 구조로 데이터를 뽑아내는 방식이죠.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;VLM은 분명 혁신적인 접근입니다. 하지만 한 가지 문제가 있습니다: 연산 비용이 너무 높다는 거죠. GPU 자원을 엄청나게 먹어서 자연스럽게 처리가 느리고 비쌉니다. VC한테 수백억 원 투자받은 스타트업이라면 수익 없이도 비용을 감당하면서 밸류에이션을 부풀릴 수 있을지 모릅니다. 하지만 대부분 팀이 놓치는 게 있습니다: 머신러닝 역량은 강하지만 문서 자체에 대한 깊은 이해가 부족하다는 점이죠. 문서 구조를 다 버리고 PDF를 그냥 비트맵처럼 취급하면서 문서 문제를 풀려고 합니다. 우리는 다르게 접근할 수 있다고 생각했습니다. 우리가 실제로 아는 것, 35년의 PDF 전문성과 현대 머신러닝을 결합하는 방식으로요. 이 문제를 제대로 풀려면 두 가지 역량이 다 필요하다고 믿습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;만약 &lt;b&gt;휴리스틱 알고리즘 기반의 네이티브 추출 방식이 GPU 없이도 자체 머신러닝 모델을 학습시키는 데 도움이 된다면 어떨까요?&lt;/b&gt; 이런 진짜 하이브리드 접근이 속도와 정확도를 동시에 잡을 수 있지 않을까요?&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;우리를 가장 흥분시킨 건 &lt;b&gt;이런 질문을 할 수 있는 회사가 우리밖에 없다는 깨달음&lt;/b&gt;이었습니다. 방대한 PDF 지식과 AI 연구자/엔지니어가 함께 일하는 회사는 세상에 없거든요.&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h1&gt;&lt;span style=&quot;color: #000000;&quot;&gt;PyMuPDF-Layout 소개&lt;/span&gt;&lt;/h1&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;1년간 개발한 끝에, 드디어 베타 테스터들에게 선보일 수 있는 단계까지 왔습니다. 우리는 이 하이브리드 접근법을 PyMuPDF-Layout이라고 부릅니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;PyMuPDF-Layout이 다른 이유는 이렇습니다: 문서를 이미지로 보고 거대한 신경망(그것도 원격 서버에 있을 수 있는)이 전부 알아서 처리하게 하는 대신, 우리는 이미 PDF에 대해 알고 있는 것부터 시작합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;먼저 MuPDF의 네이티브 PDF 파싱으로 구조화된 정보를 추출합니다: 폰트 통계, 줄 간격 패턴, 글자 위치, 들여쓰기, 여백 같은 거죠. 이건 추측이 아닙니다. PDF 구조에서 직접 뽑아낸 정확한 측정값입니다. 문서 사진만 보는 게 아니라 문서의 DNA를 읽는다고 생각하시면 됩니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;그다음 이 구조화된 데이터를 그래프 신경망(GNN)에 넣습니다. GNN은 텍스트 박스를 노드로, 그 공간적 관계를 엣지로 봅니다. &quot;이 텍스트는 14포인트 볼드체다&quot;, &quot;이 박스들은 12포인트 간격으로 세로로 정렬되어 있다&quot; 같은 휴리스틱 특징들을 받아서, 어떤 패턴이 제목인지 본문인지 표인지 그림인지 학습합니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;핵심 차이는 이겁니다: VLM 방식은 GPU 가속이 필요한 거대한 Vision Transformer로 고해상도 페이지 이미지를 통째로 처리합니다. PyMuPDF-Layout은 먼저 특징을 추출하고(CPU로 가능), 그다음 작은 GNN을 돌립니다(역시 CPU로 가능). 휴리스틱이 무거운 작업을 미리 해주기 때문에 모델이 그럴 필요가 없는 거죠.&lt;/span&gt;&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;결과는? &lt;/span&gt;&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;b&gt;경쟁 솔루션보다 25배 빠르면서 완전히 CPU만으로 돌아갑니다.&lt;/b&gt; GPU 비용도 없고, 클라우드 API 의존성도 없이, 그냥 빠른 로컬 처리만 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;300&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/LAXeq/dJMcaiImubg/v2RjCSV3gOkqnyXFDzs5wK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/LAXeq/dJMcaiImubg/v2RjCSV3gOkqnyXFDzs5wK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/LAXeq/dJMcaiImubg/v2RjCSV3gOkqnyXFDzs5wK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FLAXeq%2FdJMcaiImubg%2Fv2RjCSV3gOkqnyXFDzs5wK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;720&quot; height=&quot;271&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;300&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h1&gt;&lt;span style=&quot;color: #000000;&quot;&gt;데모&lt;/span&gt;&lt;/h1&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;곧 정식 출시할 예정입니다. 그동안&lt;b&gt; &lt;a href=&quot;https://pymupdf.io/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;pymupdf.io&lt;/a&gt; &lt;/b&gt;웹사이트에서 라이브 데모를 보실 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>이파피루스 소식</category>
      <category>데이터추출</category>
      <category>문서데이터추출</category>
      <category>문서파싱</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/439</guid>
      <comments>https://epapyrus.tistory.com/439#entry439comment</comments>
      <pubDate>Tue, 28 Oct 2025 16:22:38 +0900</pubDate>
    </item>
    <item>
      <title>이파피루스, 첨부문서 통합뷰어 '스트림닥스 뷰!'에 ZIP 파일 바로보기 기능 추가</title>
      <link>https://epapyrus.tistory.com/438</link>
      <description>&lt;blockquote data-ke-style=&quot;style2&quot;&gt;압축파일 내 문서 여러 개를 하나의 문서처럼 이어서 보여줘전자결재 문서 바로보기 지원&amp;middot;웹 접근성 표준 준수 등 공공기관 누리집에 최적&lt;/blockquote&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;사진자료_'스트림닥스 뷰' 압축파일 바로보기 화면.png&quot; data-origin-width=&quot;3837&quot; data-origin-height=&quot;2080&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dgvODE/btsQPoWBvIy/UPkTkFbDNQmQvkbOsZvg3k/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dgvODE/btsQPoWBvIy/UPkTkFbDNQmQvkbOsZvg3k/img.png&quot; data-alt=&quot;'스트림닥스 뷰!'를 통해 압축파일 내 여러 문서를 하나의 문서처럼 이어서 읽는 모습.&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dgvODE/btsQPoWBvIy/UPkTkFbDNQmQvkbOsZvg3k/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdgvODE%2FbtsQPoWBvIy%2FUPkTkFbDNQmQvkbOsZvg3k%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;3837&quot; height=&quot;2080&quot; data-filename=&quot;사진자료_'스트림닥스 뷰' 압축파일 바로보기 화면.png&quot; data-origin-width=&quot;3837&quot; data-origin-height=&quot;2080&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;'스트림닥스 뷰!'를 통해 압축파일 내 여러 문서를 하나의 문서처럼 이어서 읽는 모습.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;color: #222222; text-align: start;&quot;&gt;문서 AI 전문 기업 이파피루스(대표 김정희)는 첨부문서 통합뷰어 '스트림닥스 뷰!(StreamDocs Vu!)'에 대표 압축파일 포맷인 ZIP 파일 바로보기 기능이 추가되었다고 25일 밝혔다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #222222; text-align: start;&quot;&gt;이를 통해 PDF, 이미지 파일, 한글 및 MS오피스 문서 등 '스트림닥스 뷰!'가 지원하는 모든 포맷 문서를 압축 파일 상태로 웹에서 바로 볼 수 있게 됐다. 하나의 압축 파일에 포함된 문서들은 원본 포맷에 상관 없이 하나의 문서처럼 이어서 볼 수 있어 더욱 편리하다. 여기에 공공기관 및 기업에서 자주 사용하는 전자결재 문서 포맷인 HWX 파일 바로보기 기능도 추가되어 기관 내 결재 문서를 외부에 간편하게 공유할 수 있게 됐다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #222222; text-align: start;&quot;&gt;김정아 이파피루스 부사장은 이번 업데이트에 대해 &amp;ldquo;홈페이지의 경우 공고문과 서류 양식, 홍보 자료 등을 하나의 압축파일로 올리면 하나의 게시물에 딸린 여러 첨부파일을 일일이 클릭하지 않고도 한번에 바로 볼 수 있어 열람 편의성을 대폭 높여줄 수 있는 기능&amp;rdquo;이라고 소개했다.&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;자세한 내용은 아래에서 확인해주세요 :)&lt;br /&gt;&lt;a href=&quot;https://www.etnews.com/20250925000208&quot; target=&quot;_blank&quot; rel=&quot;noopener&amp;nbsp;noreferrer&quot;&gt;https://www.etnews.com/20250925000208&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1758777739580&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;이파피루스, 첨부문서 통합뷰어 '스트림닥스 뷰!'에 ZIP 파일 바로보기 기능 추가&quot; data-og-description=&quot;문서 AI 전문 기업 이파피루스(대표 김정희)는 첨부문서 통합뷰어 '스트림닥스 뷰!(StreamDocs Vu!)'에 대표 압축파일 포맷인 ZIP 파일 바로보기 기능이 추가되었다고 25일 밝혔다. 이를 통해 PDF, 이미&quot; data-og-host=&quot;www.etnews.com&quot; data-og-source-url=&quot;https://www.etnews.com/20250925000208&quot; data-og-url=&quot;https://www.etnews.com/20250925000208?SNS=00002&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bm3FN9/hyZJ1c6TCn/hLUcR1JkScVqnNeKwit2Vk/img.png?width=700&amp;amp;height=379&amp;amp;face=0_0_700_379&quot;&gt;&lt;a href=&quot;https://www.etnews.com/20250925000208&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://www.etnews.com/20250925000208&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bm3FN9/hyZJ1c6TCn/hLUcR1JkScVqnNeKwit2Vk/img.png?width=700&amp;amp;height=379&amp;amp;face=0_0_700_379');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;이파피루스, 첨부문서 통합뷰어 '스트림닥스 뷰!'에 ZIP 파일 바로보기 기능 추가&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;문서 AI 전문 기업 이파피루스(대표 김정희)는 첨부문서 통합뷰어 '스트림닥스 뷰!(StreamDocs Vu!)'에 대표 압축파일 포맷인 ZIP 파일 바로보기 기능이 추가되었다고 25일 밝혔다. 이를 통해 PDF, 이미&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;www.etnews.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>언론보도</category>
      <category>zip파일</category>
      <category>이파피루스</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/438</guid>
      <comments>https://epapyrus.tistory.com/438#entry438comment</comments>
      <pubDate>Thu, 25 Sep 2025 14:22:42 +0900</pubDate>
    </item>
    <item>
      <title>이파피루스 홈페이지 리뉴얼 오픈! </title>
      <link>https://epapyrus.tistory.com/437</link>
      <description>&lt;div style=&quot;-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; padding: 20px 0px; margin: 0 auto;&quot; role=&quot;article&quot; aria-roledescription=&quot;email&quot;&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;표지 (3).png&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;570&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dJJNwI/btsQr7mTlm8/1U0wUu8YOxCyKdoz5W5600/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dJJNwI/btsQr7mTlm8/1U0wUu8YOxCyKdoz5W5600/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dJJNwI/btsQr7mTlm8/1U0wUu8YOxCyKdoz5W5600/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdJJNwI%2FbtsQr7mTlm8%2F1U0wUu8YOxCyKdoz5W5600%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;570&quot; data-filename=&quot;표지 (3).png&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;570&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;

&lt;table id=&quot;stb-container&quot; style=&quot;width: 100.233%;&quot; role=&quot;presentation&quot; border=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 100%;&quot; align=&quot;center&quot;&gt;&lt;!-- [if mso]&gt;          &lt;table role=&quot;presentation&quot; align=&quot;center&quot; style=&quot;width:630px;background:#ffffff;&quot;&gt;          &lt;tr&gt;          &lt;td&gt;            &lt;div class=&quot;outer&quot;&gt;          &lt;![endif]--&gt;&lt;!-- [if !mso]&gt;&lt;!--&gt;
&lt;div class=&quot;outer&quot; style=&quot;width: 100%; max-width: 630px; background: #ffffff; margin: 0px auto;&quot;&gt;&lt;!--&lt;![endif]--&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; border: 0;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;word-break: break-word; text-align: left; margin: 0px; ;line-height: 1.7; font-size: 16px; font-family: noto sans kr, noto sans cjk kr, noto sans cjk, Malgun Gothic, apple sd gothic neo,     nanum gothic, malgun gothic, dotum, arial, helvetica, Meiryo, MS Gothic, sans-serif!important; ;-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: black; padding: 0px 0px 15px 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;font-size: 26px; color: #f56a2f;&quot; class=&quot;stb-fore-colored&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;새롭게 단장한 ePapyrus ,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span style=&quot;font-size: 26px; color: black;&quot; class=&quot;stb-fore-colored&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;어떻게 바뀌었을까요?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; border: 0;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center; font-size: 0; box-sizing: border-box;&quot;&gt;&lt;img class=&quot;stb-center&quot; style=&quot;width: 100%; display: inline; vertical-align: bottom; text-align: center; max-width: 100% !important; height: auto; border: 0;&quot; src=&quot;https://img2.stibee.com/125963_2965160_1756186682420042982.png&quot; alt=&quot;&quot; width=&quot;630&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style=&quot;border: 0; background: none;&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&quot;stb-text-box&quot; style=&quot;height: 15px;&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; border: 0;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;word-break: break-word; text-align: left; margin: 0px; ;line-height: 1.7; font-size: 16px; font-family: noto sans kr, noto sans cjk kr, noto sans cjk, Malgun Gothic, apple sd gothic neo,     nanum gothic, malgun gothic, dotum, arial, helvetica, Meiryo, MS Gothic, sans-serif!important; ;-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: black; padding: 25px 15px 25px 15px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;font-size: 26px; font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;color: #f56a2f;&quot; class=&quot;stb-fore-colored&quot;&gt; 한눈에 보는 제품, 솔루션 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span style=&quot;font-size: 18px; color: black;&quot; class=&quot;stb-fore-colored&quot;&gt;원하는 기능에 딱 맞는 제품을 쉽고 빠르게 찾을 수 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; border: 0;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: justify; font-size: 0; box-sizing: border-box; padding: 0px 15px 0 15px;&quot;&gt;&lt;img class=&quot;stb-justify&quot; style=&quot;width: 598px; display: inline; vertical-align: bottom; text-align: justify; max-width: 100% !important; height: auto; border: 0;&quot; src=&quot;https://img2.stibee.com/125963_2965160_1756184958860412703.gif&quot; alt=&quot;&quot; width=&quot;598&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;word-break: break-word; text-align: left; margin: 0px; ;line-height: 1.7; font-size: 16px; font-family: noto sans kr, noto sans cjk kr, noto sans cjk, Malgun Gothic, apple sd gothic neo,     nanum gothic, malgun gothic, dotum, arial, helvetica, Meiryo, MS Gothic, sans-serif!important; ;-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: black; padding: 20px 15px 15px 15px;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;▲ 제품으로 찾기&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; border: 0;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: justify; font-size: 0; box-sizing: border-box; padding: 15px 15px 0 15px;&quot;&gt;&lt;img class=&quot;stb-justify&quot; style=&quot;width: 598px; display: inline; vertical-align: bottom; text-align: justify; max-width: 100% !important; height: auto; border: 0;&quot; src=&quot;https://img2.stibee.com/125963_2965160_1756185411043428626.gif&quot; alt=&quot;&quot; width=&quot;598&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;word-break: break-word; text-align: left; margin: 0px; ;line-height: 1.7; font-size: 16px; font-family: noto sans kr, noto sans cjk kr, noto sans cjk, Malgun Gothic, apple sd gothic neo,     nanum gothic, malgun gothic, dotum, arial, helvetica, Meiryo, MS Gothic, sans-serif!important; ;-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: black; padding: 20px 15px 25px 15px;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;▲ 기능으로 찾기&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; border: 0;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;word-break: break-word; text-align: left; margin: 0px; ;line-height: 1.7; font-size: 16px; font-family: noto sans kr, noto sans cjk kr, noto sans cjk, Malgun Gothic, apple sd gothic neo,     nanum gothic, malgun gothic, dotum, arial, helvetica, Meiryo, MS Gothic, sans-serif!important; ;-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: black; padding: 25px 0px 25px 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;font-size: 26px; font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;color: #f56a2f;&quot; class=&quot;stb-fore-colored&quot;&gt; 풍부한 도입사례 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span style=&quot;font-size: 18px; color: black;&quot; class=&quot;stb-fore-colored&quot;&gt;제품별, 산업별 레퍼런스를 바로 확인할 수 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; border: 0;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: justify; font-size: 0; box-sizing: border-box; padding: 15px 0px 25px 0px;&quot;&gt;&lt;img class=&quot;stb-justify&quot; style=&quot;width: 100%; display: inline; vertical-align: bottom; text-align: justify; max-width: 100% !important; height: auto; border: 0;&quot; src=&quot;https://img2.stibee.com/125963_2965160_1756186994348315583.png&quot; alt=&quot;&quot; width=&quot;630&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style=&quot;border: 0; background: none;&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&quot;stb-text-box&quot; style=&quot;height: 25px;&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; background: #EF682E; border: 0;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;word-break: break-word; text-align: left; margin: 0px; ;line-height: 1.7; font-size: 16px; font-family: noto sans kr, noto sans cjk kr, noto sans cjk, Malgun Gothic, apple sd gothic neo,     nanum gothic, malgun gothic, dotum, arial, helvetica, Meiryo, MS Gothic, sans-serif!important; ;-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: black; padding: 0px 15px 15px 15px;&quot;&gt;
&lt;div&gt;&lt;span style=&quot;color: #ffffff;&quot; class=&quot;stb-fore-colored&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;✨&lt;/span&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;지금&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;이 순간&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;!&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;ePapyrus&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;홈페이지에서 가장 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;핫한&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt; 제품은&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot; class=&quot;stb-bold&quot;&gt;&lt;span style=&quot;font-size: 12.0pt; color: black;&quot;&gt;&lt;span style=&quot;color: #ffffff;&quot; class=&quot;stb-fore-colored&quot;&gt;?&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;!-- [if !mso]&gt;&lt;!--&gt;
&lt;div class=&quot;stb-two-col&quot; style=&quot;border: 0; font-size: 0;&quot;&gt;&lt;!--&lt;![endif]--&gt;&lt;!-- [if mso]&gt;  &lt;div class='stb-two-col' style='text-align:center;' &gt;  &lt;![endif]--&gt;&lt;!-- [if mso]&gt;      &lt;table role='presentation' width='100%' cellpadding='0' cellspacing='0' style='border:0;'&gt;         &lt;tr&gt;      &lt;![endif]--&gt;&lt;!-- [if mso]&gt;          &lt;td style='width:50%;padding:25px 15px 15px 15px;' valign='top'&gt;      &lt;![endif]--&gt;
&lt;div class=&quot;stb-column&quot; style=&quot;max-width: 315px; width: 100%; margin: 0; vertical-align: top; border-collapse: collapse; box-sizing: border-box; font-size: 16px; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; display: inline-block;&quot;&gt;&lt;!-- [if !mso]&gt;&lt;!--&gt;
&lt;div style=&quot;padding: 25px 15px 15px 15px;&quot;&gt;&lt;!--&lt;![endif]--&gt;&lt;!-- [if mso]&gt;    &lt;div &gt;    &lt;![endif]--&gt;&lt;img class=&quot;stb-justify&quot; style=&quot;width: 285px; display: inline; vertical-align: bottom; max-width: 100% !important; height: auto; border: 0;&quot; src=&quot;https://img2.stibee.com/125963_2965160_1756187097334690394.png&quot; alt=&quot;&quot; width=&quot;285&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;!-- [if mso]&gt;  &lt;/td&gt;  &lt;![endif]--&gt;&lt;!-- [if mso]&gt;          &lt;td style='width:50%;padding:25px 15px 15px 15px;' valign='top'&gt;      &lt;![endif]--&gt;
&lt;div class=&quot;stb-column&quot; style=&quot;max-width: 315px; width: 100%; margin: 0; vertical-align: top; border-collapse: collapse; box-sizing: border-box; font-size: 16px; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; display: inline-block;&quot;&gt;&lt;!-- [if !mso]&gt;&lt;!--&gt;
&lt;div style=&quot;padding: 25px 15px 15px 15px;&quot;&gt;&lt;!--&lt;![endif]--&gt;&lt;!-- [if mso]&gt;    &lt;div &gt;    &lt;![endif]--&gt;
&lt;div style=&quot;word-break: break-word; text-align: left; margin: 0px; ;line-height: 1.7; font-size: 16px; font-family: noto sans kr, noto sans cjk kr, noto sans cjk, Malgun Gothic, apple sd gothic neo,     nanum gothic, malgun gothic, dotum, arial, helvetica, Meiryo, MS Gothic, sans-serif!important; ;-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: black;&quot;&gt;&lt;span&gt;&lt;span style=&quot;font-size: 12.0pt; color: black;&quot;&gt;포털 &lt;/span&gt;&lt;span style=&quot;font-size: 12.0pt; color: black;&quot;&gt;/ &lt;/span&gt;&lt;span style=&quot;font-size: 12.0pt; color: black;&quot;&gt;모바일 &lt;/span&gt;&lt;span style=&quot;font-size: 12.0pt; color: black;&quot;&gt;/ &lt;/span&gt;&lt;span style=&quot;font-size: 12.0pt; color: black;&quot;&gt;홈페이지에서 다양한 첨부 문서를 다운로드 없이&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span style=&quot;font-size: 12.0pt; color: black;&quot;&gt;바로 보여주는 &lt;/span&gt;&lt;span style=&quot;font-size: 12.0pt; color: black;&quot;&gt;통합뷰어&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- [if mso]&gt;  &lt;/td&gt;  &lt;![endif]--&gt;&lt;!-- [if mso]&gt;  &lt;/tr&gt;  &lt;/table&gt;  &lt;![endif]--&gt;&lt;/div&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; border: 0;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: justify; font-size: 0; box-sizing: border-box; padding: 15px 15px 15px 15px;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: #ececec;&quot; href=&quot;https://www.epapyrus.com/kor/product/server/streamdocs_vu.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;img class=&quot;stb-justify&quot; style=&quot;width: 100%; display: inline; vertical-align: bottom; text-align: justify; max-width: 100% !important; height: auto; border: 0;&quot; src=&quot;https://img2.stibee.com/125963_2965160_1756185178992254049.gif&quot; alt=&quot;&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style=&quot;border: 0;&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;height: 15px;&quot; colspan=&quot;3&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 15px;&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;td style=&quot;height: 15px; background: none; padding: 0px; border-top-width: 1px; border-top-style: dashed; border-top-color: #b5b8c3; margin: 0 0;&quot;&gt;&lt;!-- &lt;div style='background: none;padding: 0px;border-top-width:1px;border-top-style:dashed;border-top-color:#b5b8c3;margin:0 0;'&gt;&lt;/div&gt; --&gt;&lt;/td&gt;
&lt;td style=&quot;width: 15px;&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;!-- [if !mso]&gt;&lt;!--&gt;
&lt;div class=&quot;stb-two-col&quot; style=&quot;border: 0; font-size: 0;&quot;&gt;&lt;!--&lt;![endif]--&gt;&lt;!-- [if mso]&gt;  &lt;div class='stb-two-col' style='text-align:center;' &gt;  &lt;![endif]--&gt;&lt;!-- [if mso]&gt;      &lt;table role='presentation' width='100%' cellpadding='0' cellspacing='0' style='border:0;'&gt;         &lt;tr&gt;      &lt;![endif]--&gt;&lt;!-- [if mso]&gt;          &lt;td style='width:50%;padding:25px 15px 15px 15px;' valign='top'&gt;      &lt;![endif]--&gt;
&lt;div class=&quot;stb-column&quot; style=&quot;max-width: 315px; width: 100%; margin: 0; vertical-align: top; border-collapse: collapse; box-sizing: border-box; font-size: 16px; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; display: inline-block;&quot;&gt;&lt;!-- [if !mso]&gt;&lt;!--&gt;
&lt;div style=&quot;padding: 25px 15px 15px 15px;&quot;&gt;&lt;!--&lt;![endif]--&gt;&lt;!-- [if mso]&gt;    &lt;div &gt;    &lt;![endif]--&gt;&lt;img class=&quot;stb-center&quot; style=&quot;width: 96px; display: inline; vertical-align: bottom; text-align: center; max-width: 100% !important; height: auto; border: 0;&quot; src=&quot;https://img2.stibee.com/125963_2965160_1756187271591054432.png&quot; alt=&quot;&quot; width=&quot;96&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;!-- [if mso]&gt;  &lt;/td&gt;  &lt;![endif]--&gt;&lt;!-- [if mso]&gt;          &lt;td style='width:50%;padding:25px 15px 15px 15px;' valign='top'&gt;      &lt;![endif]--&gt;
&lt;div class=&quot;stb-column&quot; style=&quot;max-width: 315px; width: 100%; margin: 0; vertical-align: top; border-collapse: collapse; box-sizing: border-box; font-size: 16px; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; display: inline-block;&quot;&gt;&lt;!-- [if !mso]&gt;&lt;!--&gt;
&lt;div style=&quot;padding: 25px 15px 15px 15px;&quot;&gt;&lt;!--&lt;![endif]--&gt;&lt;!-- [if mso]&gt;    &lt;div &gt;    &lt;![endif]--&gt;
&lt;div style=&quot;word-break: break-word; text-align: left; margin: 0px; ;line-height: 1.7; font-size: 16px; font-family: noto sans kr, noto sans cjk kr, noto sans cjk, Malgun Gothic, apple sd gothic neo,     nanum gothic, malgun gothic, dotum, arial, helvetica, Meiryo, MS Gothic, sans-serif!important; ;-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: black;&quot;&gt;&lt;span&gt;&lt;span style=&quot;font-size: 12.0pt; color: black;&quot;&gt;전 세계 개발자들이 사랑하는 문서 데이터 추출 파이썬 라이브러리&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span style=&quot;font-size: 12.0pt; color: black;&quot;&gt;글로벌 시장에서도 독보적 1위!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- [if mso]&gt;  &lt;/td&gt;  &lt;![endif]--&gt;&lt;!-- [if mso]&gt;  &lt;/tr&gt;  &lt;/table&gt;  &lt;![endif]--&gt;&lt;/div&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; border: 0;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: justify; font-size: 0; box-sizing: border-box; padding: 15px 15px 15px 15px;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: #ececec;&quot; href=&quot;https://www.epapyrus.com/kor/product/sdk/pymupdf_pro.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;img class=&quot;stb-justify&quot; style=&quot;width: 100%; display: inline; vertical-align: bottom; text-align: justify; max-width: 100% !important; height: auto; border: 0;&quot; src=&quot;https://img2.stibee.com/125963_2965160_1756186805469634570.png&quot; alt=&quot;&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;stb-one-col&quot; style=&quot;width: 100%; border: 0px; height: 128px;&quot; role=&quot;presentation&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr style=&quot;height: 128px;&quot;&gt;
&lt;td class=&quot;stb-cta-box&quot; style=&quot;clear: both; height: 128px;&quot; width=&quot;100%&quot;&gt;
&lt;table style=&quot;width: 100%;&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 15px 15px 15px 15px; border: 0; width: 100%; text-align: center;&quot;&gt;
&lt;table class=&quot;stb-cell-wrap-cta&quot; style=&quot;color: #ffffff; mso-padding-alt: 0px; background: #181818; border-radius: 500px; mso-line-height-rule: exactly; width: 100%; box-sizing: border-box; text-decoration: none; outline: 0px; font-family: noto sans kr, noto sans cjk kr, noto sans cjk, Malgun Gothic, apple sd gothic neo,     nanum gothic, malgun gothic, dotum, arial, helvetica, Meiryo, MS Gothic, sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-align: center;&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;font-size: 0; background: #181818; border-radius: 500px; padding: 20px 26px; text-align: center;&quot; valign=&quot;top&quot;&gt;&lt;a style=&quot;font-size: 18px; display: block; color: #ffffff; text-decoration: none; outline: 0px; font-family: noto sans kr, noto sans cjk kr, noto sans cjk, Malgun Gothic, apple sd gothic neo,     nanum gothic, malgun gothic, dotum, arial, helvetica, Meiryo, MS Gothic, sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-align: center; line-height: 1; box-sizing: border-box; mso-line-height-rule: exactly; width: 100%;&quot; href=&quot;https://www.epapyrus.com/kor/index.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;ePapyrus 새집 구경하러 가기 &lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style=&quot;border: 0;&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;height: 15px;&quot; colspan=&quot;3&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 15px;&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;td style=&quot;height: 15px; background: none; padding: 0px; border-top-width: 1px; border-top-style: dashed; border-top-color: #999999; margin: 0 0;&quot;&gt;&lt;!-- &lt;div style='background: none;padding: 0px;border-top-width:1px;border-top-style:dashed;border-top-color:#999999;margin:0 0;'&gt;&lt;/div&gt; --&gt;&lt;/td&gt;
&lt;td style=&quot;width: 15px;&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;!-- [if mso]&gt;          &lt;/td&gt;          &lt;/tr&gt;          &lt;/table&gt;          &lt;![endif]--&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style=&quot;padding: 10pt 0cm 10pt 0cm;&quot;&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot; align=&quot;center&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>이파피루스 소식</category>
      <category>이파피루스</category>
      <category>홈페이지</category>
      <category>홈페이지리뉴얼</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/437</guid>
      <comments>https://epapyrus.tistory.com/437#entry437comment</comments>
      <pubDate>Tue, 9 Sep 2025 14:04:05 +0900</pubDate>
    </item>
    <item>
      <title>PyMuPDF Pro로 PDF에서 텍스트 검색&amp;middot;치환하기: 샘플 코드 포함</title>
      <link>https://epapyrus.tistory.com/436</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;blog436.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/n5bJU/btsP1slHRlJ/MLjPr0aUYP9oLWdkL5Qoxk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/n5bJU/btsP1slHRlJ/MLjPr0aUYP9oLWdkL5Qoxk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/n5bJU/btsP1slHRlJ/MLjPr0aUYP9oLWdkL5Qoxk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fn5bJU%2FbtsP1slHRlJ%2FMLjPr0aUYP9oLWdkL5Qoxk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;blog436.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-end=&quot;40&quot; data-start=&quot;0&quot; data-ke-size=&quot;size26&quot;&gt;PDF 텍스트 검색 및 치환: PyMuPDF Pro로 간단하게 해결하기&lt;/h2&gt;
&lt;p data-end=&quot;199&quot; data-start=&quot;42&quot; data-ke-size=&quot;size16&quot;&gt;PDF 편집은 오래전부터 개발자들에게 까다로운 작업이었지만, PyMuPDF Pro를 사용하면 훨씬 간단하게 처리할 수 있습니다.&lt;br /&gt;회사 이름을 업데이트하거나, 오타를 수정하거나, 여러 문서에 걸쳐 오래된 정보를 교체해야 할 때 PyMuPDF Pro는 강력한 검색 및 치환 기능을 제공합니다.&lt;/p&gt;
&lt;h2 data-end=&quot;215&quot; data-start=&quot;201&quot; data-ke-size=&quot;size26&quot;&gt;PyMuPDF Pro란?&lt;/h2&gt;
&lt;p data-end=&quot;394&quot; data-start=&quot;217&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro는 MuPDF의 파이썬 바인딩으로, 가볍고 빠른 PDF 툴킷입니다.&lt;br /&gt;속도가 빠르고 메모리 효율이 뛰어나며, 텍스트 추출&amp;middot;렌더링&amp;middot;수정까지 다양한 기능을 제공합니다.&lt;br /&gt;특히 일부 라이브러리처럼 새 문서를 생성하지 않고, 기존 PDF의 구조와 포맷을 유지한 채 직접 수정할 수 있다는 장점이 있습니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;403&quot; data-start=&quot;396&quot; data-ke-size=&quot;size26&quot;&gt;설치&lt;/h2&gt;
&lt;p data-end=&quot;435&quot; data-start=&quot;405&quot; data-ke-size=&quot;size16&quot;&gt;아래와 같이 pip으로 손쉽게 설치할 수 있습니다:&lt;/p&gt;
&lt;pre id=&quot;code_1755828803127&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;pip install PyMuPDF&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;19&quot; data-start=&quot;0&quot; data-ke-size=&quot;size26&quot;&gt;기본 텍스트 검색 및 치환&lt;/h2&gt;
&lt;p data-end=&quot;76&quot; data-start=&quot;21&quot; data-ke-size=&quot;size16&quot;&gt;아래 예제는 PDF 안의 특정 텍스트를 찾아 다른 문자열로 교체하는 기본적인 방법을 보여줍니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;search_and_replace_text(pdf_path,&amp;nbsp;search_text,&amp;nbsp;replace_text,&amp;nbsp;output_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Iterate&amp;nbsp;through&amp;nbsp;each&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(doc)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Search&amp;nbsp;for&amp;nbsp;the&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text_instances&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.search_for(search_text)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Replace&amp;nbsp;each&amp;nbsp;instance&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;inst&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;text_instances:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Get&amp;nbsp;the&amp;nbsp;rectangle&amp;nbsp;containing&amp;nbsp;the&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;inst&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Add&amp;nbsp;a&amp;nbsp;white&amp;nbsp;rectangle&amp;nbsp;to&amp;nbsp;cover&amp;nbsp;the&amp;nbsp;old&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.draw_rect(rect,&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;),&amp;nbsp;fill&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;the&amp;nbsp;new&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(rect.tl,&amp;nbsp;replace_text,&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;12&lt;/span&gt;,&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;modified&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;example&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;search_and_replace_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Hello&amp;nbsp;World&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Goodbye!&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;27&quot; data-start=&quot;0&quot; data-ke-size=&quot;size26&quot;&gt;고급 텍스트 검색 및 치환 (서식 유지)&lt;/h2&gt;
&lt;p data-end=&quot;121&quot; data-start=&quot;29&quot; data-ke-size=&quot;size16&quot;&gt;앞의 기본 방법은 동작은 하지만 글꼴이나 크기 같은 원래 서식을 유지하지 못합니다. 아래 코드는 원래 텍스트의 속성을 추출해 최대한 비슷하게 치환하는 방식입니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;fitz&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;PyMuPDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;advanced_search_and_replace(pdf_path,&amp;nbsp;output_path,&amp;nbsp;search_str,&amp;nbsp;replace_str):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fitz.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;doc:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;검색된&amp;nbsp;텍스트와&amp;nbsp;위치&amp;nbsp;정보&amp;nbsp;가져오기&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text_instances&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.search_for(search_str,&amp;nbsp;quads&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;inst&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;text_instances:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;글꼴&amp;nbsp;및&amp;nbsp;크기&amp;nbsp;정보&amp;nbsp;가져오기&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;words&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_text(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;words&quot;&lt;/span&gt;)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;단어&amp;nbsp;단위&amp;nbsp;텍스트&amp;nbsp;정보&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;w&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;words:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;w[&lt;span style=&quot;color: #0099cc;&quot;&gt;4&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;search_str:&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;(x0,&amp;nbsp;y0,&amp;nbsp;x1,&amp;nbsp;y1,&amp;nbsp;word,&amp;nbsp;block_no,&amp;nbsp;line_no,&amp;nbsp;word_no)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bbox&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;fitz.Rect(w[:&lt;span style=&quot;color: #0099cc;&quot;&gt;4&lt;/span&gt;])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;w[&lt;span style=&quot;color: #0099cc;&quot;&gt;3&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;w[&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;]&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;높이&amp;nbsp;기반으로&amp;nbsp;글자&amp;nbsp;크기&amp;nbsp;추정&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;기존&amp;nbsp;텍스트&amp;nbsp;영역&amp;nbsp;흰색으로&amp;nbsp;덮기&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.add_redact_annot(inst.rect,&amp;nbsp;fill&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.apply_redactions()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;inst&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;text_instances:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;추출한&amp;nbsp;서식&amp;nbsp;기반으로&amp;nbsp;새&amp;nbsp;텍스트&amp;nbsp;추가&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;inst.rect.tl,&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;좌상단&amp;nbsp;좌표&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replace_str,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;fontsize&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'fontsize'&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;locals()&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;12&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;사용&amp;nbsp;예시&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;advanced_search_and_replace(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output_formatted.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;2023&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;2024&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;참고사항&lt;br /&gt;여기서는 글꼴 이름(font name) 치환까지는 다루지 않았습니다.&lt;br /&gt;글꼴 이름을 유지하려면 추출된 글꼴 이름을 해당 PDF 내부의 참조 ID와 매칭하는 작업이 필요하며, 이는 조금 더 복잡한 절차가 요구됩니다.&amp;nbsp;자세한 내용은 &lt;a href=&quot;https://pymupdf.readthedocs.io/en/latest/shape.html?_gl=1*fsvlfd*_ga*MTYxODI5Njk1Ny4xNzU1ODI4NTAy*_ga_JZTN4VTL9M*czE3NTU4Mjg1MDIkbzEkZzEkdDE3NTU4Mjg1NTgkajQkbDAkaDA.#common-parameters&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;PyMuPDF Pro 문서의 fontname 항목(영어)&lt;/a&gt;을 참고하세요.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;18&quot; data-start=&quot;0&quot; data-ke-size=&quot;size23&quot;&gt;여러 문자열 교체 처리&lt;/h3&gt;
&lt;p data-end=&quot;90&quot; data-start=&quot;20&quot; data-ke-size=&quot;size16&quot;&gt;여러 개의 문자열을 한 번에 바꿔야 할 때는, 검색어와 교체어를 &lt;b&gt;딕셔너리&lt;/b&gt; 형태로 받아 처리하는 방식이 효율적입니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;bulk_search_replace(pdf_path,&amp;nbsp;replacements,&amp;nbsp;output_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Replace&amp;nbsp;multiple&amp;nbsp;text&amp;nbsp;strings&amp;nbsp;in&amp;nbsp;a&amp;nbsp;PDF.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_path:&amp;nbsp;Path&amp;nbsp;to&amp;nbsp;input&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacements:&amp;nbsp;Dictionary&amp;nbsp;with&amp;nbsp;search&amp;nbsp;terms&amp;nbsp;as&amp;nbsp;keys&amp;nbsp;and&amp;nbsp;replacements&amp;nbsp;as&amp;nbsp;values&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path:&amp;nbsp;Path&amp;nbsp;for&amp;nbsp;output&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(doc)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;search_text,&amp;nbsp;replace_text&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;replacements.items():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text_instances&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.search_for(search_text)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;inst&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;text_instances:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;inst&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.draw_rect(rect,&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;),&amp;nbsp;fill&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(rect.tl,&amp;nbsp;replace_text,&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;12&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;example&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;replacements&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Acme&amp;nbsp;Corp&quot;&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Super&amp;nbsp;Corp&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;2023&quot;&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;2024&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;john@acme.com&quot;&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;john@supercorp.com&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;bulk_search_replace(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input.pdf&quot;&lt;/span&gt;,&amp;nbsp;replacements,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;19&quot; data-start=&quot;0&quot; data-ke-size=&quot;size23&quot;&gt;대소문자 구분 없는 검색&lt;/h3&gt;
&lt;p data-end=&quot;141&quot; data-start=&quot;21&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro의 search_for()는 기본적으로 &lt;b&gt;대소문자를 구분&lt;/b&gt;합니다.&lt;br /&gt;대소문자를 무시하고 검색하려면, 검색 범위를 직접 잡고 텍스트를 소문자(또는 대문자)로 변환해 비교하는 방식이 필요합니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;case_insensitive_replace(pdf_path,&amp;nbsp;search_text,&amp;nbsp;replace_text,&amp;nbsp;output_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(doc)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Get&amp;nbsp;all&amp;nbsp;text&amp;nbsp;on&amp;nbsp;the&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text_dict&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_text(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;dict&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;block&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;text_dict[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;blocks&quot;&lt;/span&gt;]:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;lines&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;block:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;line&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;block[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;lines&quot;&lt;/span&gt;]:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;span&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;line[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;spans&quot;&lt;/span&gt;]:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;original_text&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;span[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;text&quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Case-insensitive&amp;nbsp;search&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;search_text.lower()&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;original_text.lower():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Find&amp;nbsp;all&amp;nbsp;occurrences&amp;nbsp;(case-insensitive)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;re&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pattern&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;re.compile(re.escape(search_text),&amp;nbsp;re.IGNORECASE)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_text&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pattern.sub(replace_text,&amp;nbsp;original_text)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;new_text&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;original_text:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bbox&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;span[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;bbox&quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Rect(bbox)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Replace&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.draw_rect(rect,&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;),&amp;nbsp;fill&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rect.tl,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_text,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;span[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;size&quot;&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;span[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;color&quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;example&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;case_insensitive_replace(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input.pdf&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;HeLlo&amp;nbsp;WoRlD&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Goodbye!&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;10&quot; data-start=&quot;0&quot; data-ke-size=&quot;size23&quot;&gt;정규식 지원&lt;/h3&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;48&quot; data-start=&quot;11&quot; data-ke-size=&quot;size16&quot;&gt;더 복잡한 패턴 매칭이 필요하다면 정규식을 사용할 수 있습니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;re&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;regex_replace(pdf_path,&amp;nbsp;pattern,&amp;nbsp;replacement,&amp;nbsp;output_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Replace&amp;nbsp;text&amp;nbsp;using&amp;nbsp;regular&amp;nbsp;expressions.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pattern:&amp;nbsp;Regular&amp;nbsp;expression&amp;nbsp;pattern&amp;nbsp;to&amp;nbsp;search&amp;nbsp;for&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;replacement:&amp;nbsp;Replacement&amp;nbsp;string&amp;nbsp;(can&amp;nbsp;include&amp;nbsp;group&amp;nbsp;references&amp;nbsp;like&amp;nbsp;\1,&amp;nbsp;\2)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;compiled_pattern&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;re.compile(pattern)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(doc)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text_dict&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_text(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;dict&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;block&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;text_dict[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;blocks&quot;&lt;/span&gt;]:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;lines&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;block:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;line&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;block[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;lines&quot;&lt;/span&gt;]:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;span&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;line[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;spans&quot;&lt;/span&gt;]:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;original_text&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;span[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;text&quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_text&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;compiled_pattern.sub(replacement,&amp;nbsp;original_text)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;new_text&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;original_text:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bbox&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;span[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;bbox&quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Rect(bbox)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.draw_rect(rect,&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;),&amp;nbsp;fill&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rect.tl,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_text,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;span[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;size&quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Example:&amp;nbsp;Replace&amp;nbsp;all&amp;nbsp;email&amp;nbsp;addresses&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;regex_replace(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input.pdf&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;r&lt;span style=&quot;color: #63a35c;&quot;&gt;'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;email@hidden.com&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;참고&lt;br /&gt;위 예시는 여러 줄에 걸쳐 있는 이메일 주소는 바꾸지 못합니다. 이런 특수한 경우가 없는지 반드시 결과를 확인하세요.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div data-message-model-slug=&quot;gpt-5&quot; data-message-id=&quot;02ce3e53-3c96-45dc-b863-8f543df1530b&quot; data-message-author-role=&quot;assistant&quot;&gt;
&lt;div&gt;
&lt;div&gt;&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;16&quot; data-start=&quot;0&quot; data-ke-size=&quot;size23&quot;&gt;에러 처리와 모범 사례&lt;/h3&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;104&quot; data-start=&quot;17&quot; data-ke-size=&quot;size16&quot;&gt;실제 운영 환경에서는 반드시 적절한 에러 처리를 포함해야 합니다. 아래 코드는 PDF가 암호를 요구하는지 확인하고, 오류가 발생하면 예외를 발생시킵니다.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;safe_search_replace(pdf_path,&amp;nbsp;search_text,&amp;nbsp;replace_text,&amp;nbsp;output_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;doc.is_encrypted:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;PDF&amp;nbsp;is&amp;nbsp;password&amp;nbsp;protected&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;changes_made&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(doc)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text_instances&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.search_for(search_text)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;text_instances:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;changes_made&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;inst&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;text_instances:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;inst&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.draw_rect(rect,&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;),&amp;nbsp;fill&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(rect.tl,&amp;nbsp;replace_text,&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;12&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Text&amp;nbsp;replacement&amp;nbsp;made&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;changes_made:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Successfully&amp;nbsp;saved&amp;nbsp;modified&amp;nbsp;PDF&amp;nbsp;to&amp;nbsp;{output_path}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;No&amp;nbsp;instances&amp;nbsp;of&amp;nbsp;'{search_text}'&amp;nbsp;found&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;e:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Error&amp;nbsp;processing&amp;nbsp;PDF:&amp;nbsp;{str(e)}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;example&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;safe_search_replace(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input.pdf&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Hello&amp;nbsp;World&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Goodbye!&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h1 data-end=&quot;231&quot; data-start=&quot;205&quot;&gt;그런데, 교체된 텍스트는 어떻게 될까요?&lt;/h1&gt;
&lt;p data-end=&quot;430&quot; data-start=&quot;232&quot; data-ke-size=&quot;size16&quot;&gt;앞서 본 예제들은 찾은 텍스트 영역을 흰색 사각형으로 덮어서 가리는 방식이었습니다. 하지만 이렇게 하면 실제로는 텍스트가 여전히 문서 안에 남아 있어서, PDF 텍스트 추출 기능을 사용하면 원래 내용이 드러날 수 있습니다. 만약 교체 전에 텍스트를 &lt;b&gt;완전히 삭제&lt;/b&gt;하고 싶다면 &lt;b&gt;텍스트 삭제(Redaction)&lt;/b&gt; 기능을 사용해야 합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;450&quot; data-start=&quot;432&quot; data-ke-size=&quot;size23&quot;&gt;교체 전에 텍스트 삭제하기&lt;/h3&gt;
&lt;p data-end=&quot;508&quot; data-start=&quot;451&quot; data-ke-size=&quot;size16&quot;&gt;아래 예제는 기존 텍스트를 문서에서 완전히 제거한 뒤, 새로운 데이터로 교체하는 방법을 보여줍니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;search_redact_and_replace_text(pdf_path,&amp;nbsp;search_text,&amp;nbsp;replace_text,&amp;nbsp;output_path,&amp;nbsp;fill_color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;),&amp;nbsp;text_color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;),&amp;nbsp;fontname&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;tiro&quot;&lt;/span&gt;,&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;14&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Iterate&amp;nbsp;through&amp;nbsp;each&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(doc)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Search&amp;nbsp;for&amp;nbsp;text&amp;nbsp;instances&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text_instances&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.search_for(search_text)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Replace&amp;nbsp;each&amp;nbsp;instance&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;rect&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;text_instances:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;redaction&amp;nbsp;annotation&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;redact_area&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.add_redact_annot(rect,&amp;nbsp;text&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;replace_text,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fill&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;fill_color,&amp;nbsp;text_color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;text_color,&amp;nbsp;fontname&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;fontname,&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;fontsize)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Set&amp;nbsp;additional&amp;nbsp;properties&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;redact_area.set_info(content&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Redacted&amp;nbsp;sensitive&amp;nbsp;information&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;redact_area.update()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.apply_redactions()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;modified&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;example&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;search_redact_and_replace_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input.pdf&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Hello&amp;nbsp;World&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Goodbye!&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-end=&quot;185&quot; data-start=&quot;36&quot; data-ke-size=&quot;size16&quot;&gt;이 방법은 PyMuPDF Pro의 add_redaction 메서드를 활용해 기본 텍스트 옵션을 지정하는 방식입니다. 다만 실제 PDF의 스타일에 맞추려면 폰트 속성과 배경색을 직접 조정해야 합니다. 앞서 살펴본 예시들이 그 방법을 이해하는 데 도움이 될 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;297&quot; data-start=&quot;187&quot; data-ke-size=&quot;size16&quot;&gt;텍스트 완전 삭제(Redaction)를 활용하면 단순히 텍스트를 가리는 것이 아니라 &lt;b&gt;실제로 제거 후 교체&lt;/b&gt;하기 때문에 훨씬 안전하며, 검색&amp;middot;치환 작업 시 가장 권장되는 방법입니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;참고&lt;br /&gt;문서를 저장하면 텍스트 완전 삭제(Redaction) 대상으로 지정된 원본 텍스트는 완전히 삭제됩니다. 따라서 중요한 문서라면 반드시 원본 파일을 복사해 두고 작업하세요.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4 data-end=&quot;393&quot; data-start=&quot;374&quot; data-ke-size=&quot;size20&quot;&gt;제한 사항과 고려해야 할 점&lt;/h4&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;784&quot; data-start=&quot;395&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;478&quot; data-start=&quot;395&quot;&gt;&lt;b&gt;폰트 매칭(Font Matching)&lt;/b&gt;: 임베디드 글꼴이나 커스텀 폰트는 완벽히 매칭되지 않을 수 있습니다. 결과물을 반드시 확인하세요.&lt;/li&gt;
&lt;li data-end=&quot;602&quot; data-start=&quot;479&quot;&gt;&lt;b&gt;레이아웃 유지(Layout Preservation)&lt;/b&gt;: PDF는 워드 문서처럼 글자가 밀리면서 자동으로 줄바꿈&amp;middot;페이지 분할이 되지 않습니다. 교체된 텍스트가 원본보다 길면 바로 옆 단어를 침범할 수 있습니다.&lt;/li&gt;
&lt;li data-end=&quot;701&quot; data-start=&quot;603&quot;&gt;&lt;b&gt;텍스트 인식(Text Recognition)&lt;/b&gt;: PyMuPDF Pro는 실제 텍스트 객체만 다룰 수 있습니다. 이미지 기반 텍스트(스캔 PDF 등)는 교체할 수 없습니다.&lt;/li&gt;
&lt;li data-end=&quot;784&quot; data-start=&quot;702&quot;&gt;&lt;b&gt;성능(Performance)&lt;/b&gt;: 대용량 PDF나 다수 문서를 처리할 때는 페이지 단위로 나누거나 멀티프로세싱을 활용하는 것이 좋습니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h1 data-end=&quot;797&quot; data-start=&quot;791&quot;&gt;결론&lt;/h1&gt;
&lt;p data-end=&quot;903&quot; data-start=&quot;798&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro는 PDF 문서 내 텍스트 검색과 교체를 강력하고 효율적으로 지원합니다. 기본 기능은 간단하지만, 완벽한 서식 보존을 위해서는 폰트 속성과 텍스트 위치에 신경 써야 합니다.&lt;/p&gt;
&lt;p data-end=&quot;983&quot; data-start=&quot;905&quot; data-ke-size=&quot;size16&quot;&gt;레닥션 기반 교체는 보안상 안전한 방법이지만, 반드시 샘플 문서로 먼저 테스트하고, 중요한 문서는 원본 백업 후 진행하는 것이 좋습니다.&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>AI데이터</category>
      <category>AI데이터추출</category>
      <category>LLM</category>
      <category>LLM데이터추출</category>
      <category>LLM학습</category>
      <category>pdf추출</category>
      <category>PyMIPDFPRO</category>
      <category>데이터추출</category>
      <category>파이썬라이브러리</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/436</guid>
      <comments>https://epapyrus.tistory.com/436#entry436comment</comments>
      <pubDate>Fri, 22 Aug 2025 11:45:05 +0900</pubDate>
    </item>
    <item>
      <title>PyMuPDF Pro로 PDF를 이미지로 변환하기: 완벽 가이드 (샘플 코드 포함)</title>
      <link>https://epapyrus.tistory.com/435</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;무피디에프프로7.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/uagLA/btsPY7CNuRE/Y0PeNCxYdU9d1kxxsg99v0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/uagLA/btsPY7CNuRE/Y0PeNCxYdU9d1kxxsg99v0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/uagLA/btsPY7CNuRE/Y0PeNCxYdU9d1kxxsg99v0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FuagLA%2FbtsPY7CNuRE%2FY0PeNCxYdU9d1kxxsg99v0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;무피디에프프로7.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h1 data-end=&quot;187&quot; data-start=&quot;154&quot;&gt;PyMuPDF Pro로 PDF를 이미지로 변환하기: 완벽 가이드&lt;/h1&gt;
&lt;p data-end=&quot;307&quot; data-start=&quot;189&quot; data-ke-size=&quot;size16&quot;&gt;PDF는 어디서나 쓰이지만, 프레젠테이션이나 웹에 올리거나 추가 가공을 위해 이미지로 변환해야 할 때가 있습니다.&lt;br /&gt;PyMuPDF Pro는 이 과정을 빠르고 효율적으로 처리할 수 있는 파워풀한 파이썬 라이브러리입니다.&lt;/p&gt;
&lt;h2 data-end=&quot;326&quot; data-start=&quot;314&quot; data-ke-size=&quot;size26&quot;&gt;PyMuPDF Pro란?&lt;/h2&gt;
&lt;p data-end=&quot;448&quot; data-start=&quot;327&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro는 MuPDF의 파이썬 바인딩으로, 가볍고 빠르며 메모리 효율성이 뛰어난 PDF/XPS 처리 도구입니다.&lt;br /&gt;폰트, 이미지, 벡터 그래픽이 복잡하게 섞인 PDF도 고품질로 다룰 수 있다는 점이 강점입니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;432&quot; data-start=&quot;422&quot; data-ke-size=&quot;size26&quot;&gt;설치 방법&lt;/h2&gt;
&lt;p data-end=&quot;510&quot; data-start=&quot;433&quot; data-ke-size=&quot;size16&quot;&gt;설치는 간단합니다. pip으로 바로 설치할 수 있습니다.&lt;/p&gt;
&lt;pre id=&quot;code_1755754049811&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;pip install PyMuPDF&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;추가적인 이미지 형식을 다루려면 Pillow 라이브러리 설치도 권장됩니다.&lt;/p&gt;
&lt;pre id=&quot;code_1755754076639&quot; class=&quot;bash&quot; data-ke-language=&quot;bash&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;pip install PyMuPDF Pillow&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 data-end=&quot;566&quot; data-start=&quot;543&quot; data-ke-size=&quot;size26&quot;&gt;기본 변환: PDF 페이지 &amp;rarr; 이미지&lt;/h2&gt;
&lt;p data-end=&quot;604&quot; data-start=&quot;567&quot; data-ke-size=&quot;size16&quot;&gt;한 장의 PDF 페이지를 이미지로 변환하는 가장 간단한 방법입니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;pdf_to_image_basic(pdf_path,&amp;nbsp;output_path,&amp;nbsp;page_num&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Convert&amp;nbsp;a&amp;nbsp;single&amp;nbsp;PDF&amp;nbsp;page&amp;nbsp;to&amp;nbsp;an&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_path:&amp;nbsp;Path&amp;nbsp;to&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path:&amp;nbsp;Path&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_num:&amp;nbsp;Page&amp;nbsp;number&amp;nbsp;to&amp;nbsp;convert&amp;nbsp;(0-indexed)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Get&amp;nbsp;the&amp;nbsp;specified&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Render&amp;nbsp;page&amp;nbsp;to&amp;nbsp;a&amp;nbsp;pixmap&amp;nbsp;(image)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Clean&amp;nbsp;up&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;example&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;pdf_to_image_basic(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;document.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;page_0.png&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;Copy&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;657&quot; data-start=&quot;645&quot; data-ke-size=&quot;size26&quot;&gt;모든 페이지 변환&lt;/h2&gt;
&lt;p data-end=&quot;690&quot; data-start=&quot;658&quot; data-ke-size=&quot;size16&quot;&gt;PDF 전체 페이지를 각각의 이미지로 변환할 수 있습니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;pdf_to_images_all_pages(pdf_path,&amp;nbsp;output_dir,&amp;nbsp;image_format&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;png&quot;&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Convert&amp;nbsp;all&amp;nbsp;pages&amp;nbsp;of&amp;nbsp;a&amp;nbsp;PDF&amp;nbsp;to&amp;nbsp;individual&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_path:&amp;nbsp;Path&amp;nbsp;to&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_dir:&amp;nbsp;Directory&amp;nbsp;to&amp;nbsp;save&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image_format:&amp;nbsp;Output&amp;nbsp;format&amp;nbsp;(png,&amp;nbsp;jpg,&amp;nbsp;etc.)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;output&amp;nbsp;directory&amp;nbsp;if&amp;nbsp;it&amp;nbsp;doesn't&amp;nbsp;exist&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;os.makedirs(output_dir,&amp;nbsp;exist_ok&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Get&amp;nbsp;the&amp;nbsp;base&amp;nbsp;filename&amp;nbsp;without&amp;nbsp;extension&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base_name&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.splitext(os.path.basename(pdf_path))[&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Get&amp;nbsp;the&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Render&amp;nbsp;to&amp;nbsp;pixmap&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;output&amp;nbsp;filename&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.join(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_dir,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;{base_name}_page_{page_num&amp;nbsp;+&amp;nbsp;1}.{image_format}&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Saved:&amp;nbsp;{output_path}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Converted&amp;nbsp;{doc.page_count}&amp;nbsp;pages&amp;nbsp;successfully!&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;example&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;pdf_to_images_all_pages(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;report.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output_images&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;png&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;741&quot; data-start=&quot;731&quot; data-ke-size=&quot;size26&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;고해상도 변환&lt;/span&gt;&lt;/h2&gt;
&lt;p data-end=&quot;791&quot; data-start=&quot;742&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;해상도를 높이고 싶다면 변환 시 확대 비율(zoom factor)을 지정할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;pdf_to_image_high_res(pdf_path,&amp;nbsp;output_path,&amp;nbsp;page_num&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;zoom_factor&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Convert&amp;nbsp;PDF&amp;nbsp;page&amp;nbsp;to&amp;nbsp;high-resolution&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_path:&amp;nbsp;Path&amp;nbsp;to&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path:&amp;nbsp;Path&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_num:&amp;nbsp;Page&amp;nbsp;number&amp;nbsp;to&amp;nbsp;convert&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;zoom_factor:&amp;nbsp;Resolution&amp;nbsp;multiplier&amp;nbsp;(2.0&amp;nbsp;=&amp;nbsp;double&amp;nbsp;resolution)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;transformation&amp;nbsp;matrix&amp;nbsp;for&amp;nbsp;higher&amp;nbsp;resolution&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mat&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Matrix(zoom_factor,&amp;nbsp;zoom_factor)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Render&amp;nbsp;with&amp;nbsp;the&amp;nbsp;transformation&amp;nbsp;matrix&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap(matrix&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;mat)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;a&amp;nbsp;high-resolution&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;pdf_to_image_high_res(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;document.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;high_res_page.png&quot;&lt;/span&gt;,&amp;nbsp;zoom_factor&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;4.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;848&quot; data-start=&quot;832&quot; data-ke-size=&quot;size26&quot;&gt;다양한 이미지 포맷 지원&lt;/h2&gt;
&lt;p data-end=&quot;902&quot; data-start=&quot;849&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF는 여러 가지 이미지 포맷을 지원합니다.&lt;br /&gt;예를 들어 PNG로 변환할 때는 알파 채널(투명도)을 유지할 수도 있습니다.&lt;br /&gt;아래는 포맷별 요구사항을 처리하는 방법입니다:&lt;/p&gt;
&lt;div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;pdf_to_image_format_options(pdf_path,&amp;nbsp;output_path,&amp;nbsp;page_num&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;format_type&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;png&quot;&lt;/span&gt;,&amp;nbsp;quality&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;95&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Convert&amp;nbsp;PDF&amp;nbsp;to&amp;nbsp;image&amp;nbsp;with&amp;nbsp;format-specific&amp;nbsp;options&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_path:&amp;nbsp;Path&amp;nbsp;to&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path:&amp;nbsp;Path&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_num:&amp;nbsp;Page&amp;nbsp;number&amp;nbsp;to&amp;nbsp;convert&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;format_type:&amp;nbsp;Image&amp;nbsp;format&amp;nbsp;(png,&amp;nbsp;jpg,&amp;nbsp;ppm,&amp;nbsp;etc.)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;quality:&amp;nbsp;JPEG&amp;nbsp;quality&amp;nbsp;(1-100,&amp;nbsp;only&amp;nbsp;for&amp;nbsp;JPEG)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;format_type.lower()&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;jpg&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;or&lt;/span&gt;&amp;nbsp;format_type.lower()&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;jpeg&quot;&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;For&amp;nbsp;JPEG,&amp;nbsp;we&amp;nbsp;can&amp;nbsp;specify&amp;nbsp;quality&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix.save(output_path,&amp;nbsp;jpg_quality&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;quality)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;format_type.lower()&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;png&quot;&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;PNG&amp;nbsp;supports&amp;nbsp;transparency&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap(alpha&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Include&amp;nbsp;alpha&amp;nbsp;channel&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Default&amp;nbsp;handling&amp;nbsp;for&amp;nbsp;other&amp;nbsp;formats&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Examples&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;pdf_to_image_format_options(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;document.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.jpg&quot;&lt;/span&gt;,&amp;nbsp;format_type&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;jpg&quot;&lt;/span&gt;,&amp;nbsp;quality&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;85&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;pdf_to_image_format_options(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;document.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.png&quot;&lt;/span&gt;,&amp;nbsp;format_type&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;png&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;958&quot; data-start=&quot;943&quot; data-ke-size=&quot;size26&quot;&gt;여러 PDF 일괄 변환&lt;/h2&gt;
&lt;p data-end=&quot;995&quot; data-start=&quot;959&quot; data-ke-size=&quot;size16&quot;&gt;폴더에 있는 여러 PDF를 한 번에 이미지로 변환할 수 있습니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;from&lt;/span&gt;&amp;nbsp;pathlib&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;Path&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;batch_pdf_to_images(input_dir,&amp;nbsp;output_dir,&amp;nbsp;image_format&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;png&quot;&lt;/span&gt;,&amp;nbsp;zoom_factor&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Convert&amp;nbsp;all&amp;nbsp;PDFs&amp;nbsp;in&amp;nbsp;a&amp;nbsp;directory&amp;nbsp;to&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;input_dir:&amp;nbsp;Directory&amp;nbsp;containing&amp;nbsp;PDF&amp;nbsp;files&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_dir:&amp;nbsp;Directory&amp;nbsp;to&amp;nbsp;save&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image_format:&amp;nbsp;Output&amp;nbsp;image&amp;nbsp;format&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;zoom_factor:&amp;nbsp;Resolution&amp;nbsp;multiplier&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;input_path&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;Path(input_dir)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;Path(output_dir)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;output&amp;nbsp;directory&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path.mkdir(parents&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;,&amp;nbsp;exist_ok&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Find&amp;nbsp;all&amp;nbsp;PDF&amp;nbsp;files&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_files&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;list(input_path.glob(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;*.pdf&quot;&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;not&lt;/span&gt;&amp;nbsp;pdf_files:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;No&amp;nbsp;PDF&amp;nbsp;files&amp;nbsp;found&amp;nbsp;in&amp;nbsp;the&amp;nbsp;input&amp;nbsp;directory.&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Found&amp;nbsp;{len(pdf_files)}&amp;nbsp;PDF&amp;nbsp;files&amp;nbsp;to&amp;nbsp;process...&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;pdf_file&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;pdf_files:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_file)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_name&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pdf_file.stem&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;subdirectory&amp;nbsp;for&amp;nbsp;this&amp;nbsp;PDF's&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_output_dir&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;output_path&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;pdf_name&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_output_dir.mkdir(exist_ok&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Convert&amp;nbsp;each&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;zoom_factor&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mat&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Matrix(zoom_factor,&amp;nbsp;zoom_factor)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap(matrix&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;mat)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_file&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pdf_output_dir&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;page_{page_num&amp;nbsp;+&amp;nbsp;1}.{image_format}&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix.save(&lt;span style=&quot;color: #066de2;&quot;&gt;str&lt;/span&gt;(output_file))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;✓&amp;nbsp;Processed&amp;nbsp;{pdf_file.name}:&amp;nbsp;{doc.page_count}&amp;nbsp;pages&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;e:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;✗&amp;nbsp;Error&amp;nbsp;processing&amp;nbsp;{pdf_file.name}:&amp;nbsp;{str(e)}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;batch_pdf_to_images(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input_pdfs&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output_images&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;png&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;17&quot; data-start=&quot;0&quot; data-ke-size=&quot;size26&quot;&gt;에러 처리와 모범 사례&lt;/h2&gt;
&lt;p data-end=&quot;95&quot; data-start=&quot;18&quot; data-ke-size=&quot;size16&quot;&gt;PDF를 이미지로 변환할 때는 예외 상황에 대비한 에러 처리가 중요합니다.&lt;br /&gt;아래는 견고한 에러 처리 로직을 포함한 함수 예제입니다:&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;61&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;62&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;63&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;64&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;65&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;66&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;67&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;68&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;69&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;70&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;71&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;72&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;73&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;74&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;75&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;76&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;77&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;78&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;79&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;80&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;81&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;82&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;83&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;84&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;85&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;86&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;87&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;88&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;89&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;90&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;91&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;92&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;93&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;from&lt;/span&gt;&amp;nbsp;pathlib&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;Path&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;convert_pdf_to_images_robust(pdf_path,&amp;nbsp;output_dir&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;None&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image_format&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;png&quot;&lt;/span&gt;,&amp;nbsp;zoom_factor&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_range&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;None&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Robust&amp;nbsp;PDF&amp;nbsp;to&amp;nbsp;image&amp;nbsp;conversion&amp;nbsp;with&amp;nbsp;error&amp;nbsp;handling&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_path:&amp;nbsp;Path&amp;nbsp;to&amp;nbsp;PDF&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_dir:&amp;nbsp;Output&amp;nbsp;directory&amp;nbsp;(defaults&amp;nbsp;to&amp;nbsp;PDF&amp;nbsp;directory)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image_format:&amp;nbsp;Output&amp;nbsp;format&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;zoom_factor:&amp;nbsp;Resolution&amp;nbsp;multiplier&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_range:&amp;nbsp;Tuple&amp;nbsp;(start,&amp;nbsp;end)&amp;nbsp;for&amp;nbsp;page&amp;nbsp;range,&amp;nbsp;or&amp;nbsp;None&amp;nbsp;for&amp;nbsp;all&amp;nbsp;pages&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Returns:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;List&amp;nbsp;of&amp;nbsp;successfully&amp;nbsp;created&amp;nbsp;image&amp;nbsp;paths&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Validate&amp;nbsp;input&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;not&lt;/span&gt;&amp;nbsp;os.path.exists(pdf_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;raise&lt;/span&gt;&amp;nbsp;FileNotFoundError(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;PDF&amp;nbsp;file&amp;nbsp;not&amp;nbsp;found:&amp;nbsp;{pdf_path}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Set&amp;nbsp;up&amp;nbsp;output&amp;nbsp;directory&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;output_dir&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;is&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;None&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_dir&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.dirname(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;os.makedirs(output_dir,&amp;nbsp;exist_ok&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Determine&amp;nbsp;page&amp;nbsp;range&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;total_pages&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc.page_count&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;page_range:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;start_page,&amp;nbsp;end_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page_range&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;start_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;max(&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;start_page)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;min(total_pages,&amp;nbsp;end_page)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;start_page,&amp;nbsp;end_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;total_pages&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Convert&amp;nbsp;pages&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;created_files&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;[]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base_name&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;Path(pdf_path).stem&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(start_page,&amp;nbsp;end_page):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Apply&amp;nbsp;zoom&amp;nbsp;if&amp;nbsp;specified&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;zoom_factor&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mat&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Matrix(zoom_factor,&amp;nbsp;zoom_factor)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap(matrix&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;mat)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;output&amp;nbsp;filename&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_file&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.join(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_dir,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;{base_name}_page_{page_num&amp;nbsp;+&amp;nbsp;1}.{image_format}&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix.save(output_file)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;created_files.append(output_file)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;✓&amp;nbsp;Page&amp;nbsp;{page_num&amp;nbsp;+&amp;nbsp;1}/{total_pages}&amp;nbsp;converted&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;e:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;✗&amp;nbsp;Error&amp;nbsp;converting&amp;nbsp;page&amp;nbsp;{page_num&amp;nbsp;+&amp;nbsp;1}:&amp;nbsp;{str(e)}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;created_files&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;e:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Error&amp;nbsp;processing&amp;nbsp;PDF:&amp;nbsp;{str(e)}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;[]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;examples&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;images&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;convert_pdf_to_images_robust(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;document.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Created&amp;nbsp;{len(images)}&amp;nbsp;images&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Convert&amp;nbsp;only&amp;nbsp;pages&amp;nbsp;1-5&amp;nbsp;with&amp;nbsp;high&amp;nbsp;resolution&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;images&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;convert_pdf_to_images_robust(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;large_document.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output_images&quot;&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;jpg&quot;&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;zoom_factor&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_range&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;13&quot; data-start=&quot;0&quot; data-ke-size=&quot;size26&quot;&gt;성능 최적화 팁&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;267&quot; data-start=&quot;15&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;76&quot; data-start=&quot;15&quot;&gt;&lt;b&gt;메모리 관리&lt;/b&gt;: 대용량 PDF는 한 번에 불러들이지 말고 페이지 단위로 처리하는 것이 안전합니다.&lt;/li&gt;
&lt;li data-end=&quot;141&quot; data-start=&quot;77&quot;&gt;&lt;b&gt;포맷 선택&lt;/b&gt;: 사진 위주의 문서는 JPEG, 텍스트와 선명한 그래픽이 많은 문서는 PNG가 적합합니다.&lt;/li&gt;
&lt;li data-end=&quot;210&quot; data-start=&quot;142&quot;&gt;&lt;b&gt;해상도 조정&lt;/b&gt;: 배율을 높이면 품질은 좋아지지만 파일 크기도 커집니다. 테스트를 통해 적절한 균형을 찾으세요.&lt;/li&gt;
&lt;li data-end=&quot;267&quot; data-start=&quot;211&quot;&gt;&lt;b&gt;배치 처리&lt;/b&gt;: 여러 파일을 변환할 때는 문서 객체를 재사용하면 속도와 효율이 올라갑니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-end=&quot;276&quot; data-start=&quot;269&quot; data-ke-size=&quot;size26&quot;&gt;결론&lt;/h2&gt;
&lt;p data-end=&quot;378&quot; data-start=&quot;278&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro는 PDF를 이미지로 변환할 때 가볍고 빠르면서도 강력한 도구입니다.&lt;br /&gt;한두 페이지를 변환하든, 수백 개의 문서를 일괄 처리하든 필요한 기능을 충분히 제공합니다.&lt;/p&gt;
&lt;p data-end=&quot;508&quot; data-start=&quot;380&quot; data-ke-size=&quot;size16&quot;&gt;이 가이드에서 다룬 방법들은 프로젝트에 바로 적용할 수 있는 실용적인 기반이 될 것입니다.&lt;br /&gt;특히 대용량 문서를 다룰 때는 메모리 관리에 신경 쓰고, 변환 과정에서 발생할 수 있는 오류를 안정적으로 처리하는 것이 중요합니다. &lt;br /&gt;빠른 성능과 높은 안정성을 갖춘 PyMuPDF Pro는 단순한 스크립트 작업부터 실무용 애플리케이션까지 폭넓게 활용할 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;508&quot; data-start=&quot;380&quot; data-ke-size=&quot;size16&quot;&gt;많은 도움이 되셨길 바라며 제품에 대해 더 궁금하신 내용이 있다면 아래의 홈페이지로 문의해주세요! &lt;br /&gt;&lt;a href=&quot;http://epapyrus.com&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&amp;gt; 문의하기&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>PDF변환</category>
      <category>PDF이미지변환</category>
      <category>PyMuPDFPro</category>
      <category>python</category>
      <category>파이썬라이브러리</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/435</guid>
      <comments>https://epapyrus.tistory.com/435#entry435comment</comments>
      <pubDate>Thu, 21 Aug 2025 14:53:35 +0900</pubDate>
    </item>
    <item>
      <title>이파피루스, 챗GPT 이어 퍼플렉시티에도 자사 문서 기술 공급</title>
      <link>https://epapyrus.tistory.com/434</link>
      <description>&lt;h3 style=&quot;color: #222222; text-align: left;&quot; data-ke-size=&quot;size23&quot;&gt;코드 한 줄만 삽입하면 웹에서 PDF 열람 및 편집 가능한 SDK '뮤PDF 웹뷰어' 구독&lt;br /&gt;챗GPT 이어 두 번째 초대형 글로벌 AI 기업 고객&amp;hellip;AI 서비스 필수 요소로 각광&lt;/h3&gt;
&lt;div id=&quot;articleBody&quot; style=&quot;color: #222222; text-align: start;&quot;&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;500&quot; data-origin-height=&quot;234&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/VpxPz/btsPS2GclgX/HrWkk1IN9Od9Ee8pSvBxhK/img.jpg&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/VpxPz/btsPS2GclgX/HrWkk1IN9Od9Ee8pSvBxhK/img.jpg&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/VpxPz/btsPS2GclgX/HrWkk1IN9Od9Ee8pSvBxhK/img.jpg&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FVpxPz%2FbtsPS2GclgX%2FHrWkk1IN9Od9Ee8pSvBxhK%2Fimg.jpg&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;500&quot; height=&quot;234&quot; data-origin-width=&quot;500&quot; data-origin-height=&quot;234&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;

&lt;p data-ke-size=&quot;size16&quot;&gt;문서 AI 기업 이파피루스(대표 김정희)는 최근 AI 기반 대화형 검색 엔진 퍼플렉시티가 자사의 문서 뷰어 개발 키트(SDK)인 '뮤피디에프 웹뷰어'의 첫 구독 고객이 됐다고 13일 밝혔다.&lt;br /&gt;&lt;br /&gt;'뮤피디에프 웹뷰어'는 이파피루스의 대표 제품인 PDF 스트리밍 뷰어 '스트림닥스(StreamDocs)'를 기반으로 한 뷰어 SDK다. 코드 한 줄만 입력하면 별도의 서버 구축 없이도 브라우저 내에서 작동하는 PDF 뷰어를 구현할 수 있다. 문서 열람은 물론 강조 표시, 주석 달기, 양식 작성, 서명, 콘텐츠 삭제 등의 편집 작업도 가능하다. 올해 4월 출시해 구독 서비스 형태로 제공하고 있다.&lt;br /&gt;&lt;br /&gt;이번 사례는 국내 기존 제품을 해외 시장 요구와 트렌드에 맞게 재설계하여 실제 고객 유치까지 성공한 경우라 더욱 뜻깊다. '뮤피디에프 웹뷰어'는 국내에서 개발된 '스트림닥스'의 핵심 기술을 바탕으로 하되, 미국 및 유럽 고객의 요구에 부응하기 위해 해당 국가의 엔지니어와 디자이너들이 중심이 되어 UI&amp;middot;&lt;span&gt;&lt;a style=&quot;color: #222222;&quot;&gt;UX&lt;/a&gt;&lt;/span&gt;를 전격 재설계했다. 여기에 최근 AI 애플리케이션에서 답변 출처 등을 표시하기 위해 자주 사용되는 참조 문단 찾기 및 하이라이팅 기능을 추가하는 등 실제 AI 서비스에 곧바로 적용할 수 있는 수준으로 UI&amp;middot;UX를 최적화한 것이 특징이다.&lt;br /&gt;&lt;br /&gt;초대형 글로벌 AI 서비스 기업이 이파피루스의 문서 기술을 도입한 것은 이번이 처음이 아니다. 2024년 오픈AI는 '챗GPT'의 학습 및 문서 처리를 위해 파이선 기반 문서 데이터 추출 라이브러리인 '파이뮤피디에프 프로(PyMuPDF Pro)'를 도입한 바 있다. '뮤피디에프 웹뷰어'와 '파이뮤피디에프 프로'는 모두 이미 기존 전자문서 시장에서 충분한 검증이 이루어진 제품들이다. 코드 몇 줄만 입력해 곧바로 적용할 수 있는 형태로 공급한다는 이파피루스의 전략이 문서 관련 서비스를 주축으로 삼는 대화형 AI 시장의 급성장과 맞물려 효과를 발하고 있는 것이다.&lt;br /&gt;&lt;br /&gt;김정아 이파피루스 부사장은 &amp;ldquo;'뮤피디에프 웹뷰어'의 원형인 '스트림닥스'는 2014년 출시 이래 국내에서만 1200개 이상 고객사와 함께 해 온 이파피루스의 플래그십 제품&amp;rdquo;이라며 &amp;ldquo;현재 글로벌 시장에서 가장 주목받는 기업 중 하나인 퍼플렉시티가 첫 구독 고객이 된 것은 의미 있는 출발점&amp;rdquo;이라고 밝혔다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;br /&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;'뮤피디에프 웹뷰어'는 자체 웹사이트에서 14일 무료 체험을 제공한다.&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: #000000; color: #ffffff;&quot;&gt; &lt;a style=&quot;background-color: #000000; color: #ffffff;&quot; href=&quot;https://webviewer.mupdf.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;'&lt;span style=&quot;background-color: #000000;&quot;&gt;뮤피디에프 웹뷰어' 바로가기 ▶&amp;nbsp; webviewer.mupdf.com&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt; &lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;figure id=&quot;og_1755064275176&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;이파피루스, 챗GPT 이어 퍼플렉시티에도 자사 문서 기술 공급&quot; data-og-description=&quot;문서 AI 기업 이파피루스(대표 김정희)는 최근 AI 기반 대화형 검색 엔진 퍼플렉시티가 자사의 문서 뷰어 개발 키트(SDK)인 '뮤피디에프 웹뷰어'의 첫 구독 고객이 됐다고 13일 밝혔다. '뮤피디에프 &quot; data-og-host=&quot;www.etnews.com&quot; data-og-source-url=&quot;https://www.etnews.com/20250813000033&quot; data-og-url=&quot;https://www.etnews.com/20250813000033?SNS=00002&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/buMBFO/hyZyrv5ypu/hPugaUTGhkKePB7SWCwfKK/img.jpg?width=500&amp;amp;height=234&amp;amp;face=0_0_500_234&quot;&gt;&lt;a href=&quot;https://www.etnews.com/20250813000033&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://www.etnews.com/20250813000033&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/buMBFO/hyZyrv5ypu/hPugaUTGhkKePB7SWCwfKK/img.jpg?width=500&amp;amp;height=234&amp;amp;face=0_0_500_234');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;이파피루스, 챗GPT 이어 퍼플렉시티에도 자사 문서 기술 공급&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;문서 AI 기업 이파피루스(대표 김정희)는 최근 AI 기반 대화형 검색 엔진 퍼플렉시티가 자사의 문서 뷰어 개발 키트(SDK)인 '뮤피디에프 웹뷰어'의 첫 구독 고객이 됐다고 13일 밝혔다. '뮤피디에프&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;www.etnews.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>언론보도</category>
      <category>Ai</category>
      <category>LLM</category>
      <category>문서뷰어</category>
      <category>챗GPT</category>
      <category>퍼플렉시티</category>
      <category>해외진출</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/434</guid>
      <comments>https://epapyrus.tistory.com/434#entry434comment</comments>
      <pubDate>Wed, 13 Aug 2025 14:53:33 +0900</pubDate>
    </item>
    <item>
      <title>이파피루스, 제품 정보 총망라한 AI 챗봇 이달 중 고객&amp;middot;파트너사에 제공</title>
      <link>https://epapyrus.tistory.com/433</link>
      <description>&lt;p style=&quot;color: #222222; text-align: start;&quot; data-ke-size=&quot;size16&quot;&gt;문서 AI 기업 이파피루스(대표 김정희)는 최근 자사 제품 관련 정보를 빠르게 찾아볼 수 있는 AI 챗봇을 개발, 7월 중 고객 및 파트너사에 제공할 예정이라고 23일 밝혔다.&lt;br /&gt;&lt;br /&gt;이번에 개발한 AI 챗봇은 이파피루스가 현재 개발&amp;middot;판매 중인 문서 AI 솔루션에 대한 정보를 총망라한 s&lt;span&gt;&lt;a style=&quot;color: #222222;&quot;&gt;LLM&lt;/a&gt;&lt;/span&gt;(소형 언어모델)을 기반으로 한다. 제품 정보부터 자주 묻는 질문(FAQ), 개발 문서에 이르기까지 다양하고 복잡한 정보 중 필요한 내용만 질의응답 형태로 빠르게 찾아볼 수 있다. 이파피루스 내부 업무에 먼저 적용하여 테스트를 거친 후, 파트너사와 고객들을 위한 개발 문서 포털 '테크넷(Tech Net)'에 이달 중 적용될 예정이다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;700&quot; data-origin-height=&quot;328&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/ZingO/btsPR90oEqQ/siuKeJAU8E0C3d0poUwzQK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/ZingO/btsPR90oEqQ/siuKeJAU8E0C3d0poUwzQK/img.png&quot; data-alt=&quot;이파피루스 CI&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/ZingO/btsPR90oEqQ/siuKeJAU8E0C3d0poUwzQK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FZingO%2FbtsPR90oEqQ%2FsiuKeJAU8E0C3d0poUwzQK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;499&quot; height=&quot;234&quot; data-origin-width=&quot;700&quot; data-origin-height=&quot;328&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;이파피루스 CI&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p style=&quot;color: #222222; text-align: start;&quot; data-ke-size=&quot;size16&quot;&gt;김정아 이파피루스 부사장은 &amp;ldquo;고객과 파트너사의 기술 관련 문의에 보다 신속 정확하게 대응하기 위해 챗봇 개발에 착수했다&amp;rdquo;라며 &amp;ldquo;그 과정에서&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;a style=&quot;color: #222222;&quot;&gt;sLLM&lt;/a&gt;&lt;/span&gt;을 활용한 서비스를 직접 개발하고 사용해 보면서 AI에 대한 이해도와 관련 서비스 개발자들의 고충도 이해할 수 있어 일석이조의 기회가 됐다&amp;rdquo;고 말했다.&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: #222222;&quot;&gt;
&lt;p style=&quot;color: #00a0e9;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p style=&quot;color: #333333; text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;이파피루스는 다양한 언어 모델과 데이터 추출 기술을 개발하여 인공지능 훈련 및 활용에 필수적인 솔루션을 제공한다. 특히 최근 국내 정식 출시한 파이썬 기반 문서 데이터 추출 라이브러리 '파이뮤피디에프 프로(PymuPDF Pro)'는 '챗GPT'의 학습 및 문서 처리를 위해 쓰이는 등 AI 서비스 구축의 필수 요소로서 전 세계 개발자들의 사랑을 받고 있다. 동시에 임직원들의 AI 서비스 구독을 적극 지원하는 등, 내부 AI 혁신에도 힘쓰며 문서 AI 기업으로서 안팎으로 성장 중이다.&lt;/p&gt;
&lt;p style=&quot;color: #333333; text-align: left;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;figure id=&quot;og_1755063882587&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;이파피루스, 제품 정보 총망라한 AI 챗봇 이달 중 고객&amp;middot;파트너사에 제공&quot; data-og-description=&quot;문서 AI 기업 이파피루스(대표 김정희)는 최근 자사 제품 관련 정보를 빠르게 찾아볼 수 있는 AI 챗봇을 개발, 7월 중 고객 및 파트너사에 제공할 예정이라고 23일 밝혔다. 이번에 개발한 AI 챗봇은 &quot; data-og-host=&quot;www.etnews.com&quot; data-og-source-url=&quot;https://www.etnews.com/20250723000330&quot; data-og-url=&quot;https://www.etnews.com/20250723000330?SNS=00002&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/1XWEH/hyZvxYKLUq/G5hmSKKxCUUfBmhEeWM1t0/img.png?width=700&amp;amp;height=328&amp;amp;face=0_0_700_328&quot;&gt;&lt;a href=&quot;https://www.etnews.com/20250723000330&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://www.etnews.com/20250723000330&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/1XWEH/hyZvxYKLUq/G5hmSKKxCUUfBmhEeWM1t0/img.png?width=700&amp;amp;height=328&amp;amp;face=0_0_700_328');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;이파피루스, 제품 정보 총망라한 AI 챗봇 이달 중 고객&amp;middot;파트너사에 제공&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;문서 AI 기업 이파피루스(대표 김정희)는 최근 자사 제품 관련 정보를 빠르게 찾아볼 수 있는 AI 챗봇을 개발, 7월 중 고객 및 파트너사에 제공할 예정이라고 23일 밝혔다. 이번에 개발한 AI 챗봇은&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;www.etnews.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>언론보도</category>
      <category>sLLM</category>
      <category>고객지원</category>
      <category>문서ai</category>
      <category>챗봇</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/433</guid>
      <comments>https://epapyrus.tistory.com/433#entry433comment</comments>
      <pubDate>Wed, 13 Aug 2025 14:45:35 +0900</pubDate>
    </item>
    <item>
      <title>이파피루스, 민감정보 비식별화 부가기능 '블랙마커' 업그레이드</title>
      <link>https://epapyrus.tistory.com/432</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;700&quot; data-origin-height=&quot;425&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bA5gOW/btsPP7W1oWk/x4G2caZfQSXBU2WUko7dVk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bA5gOW/btsPP7W1oWk/x4G2caZfQSXBU2WUko7dVk/img.png&quot; data-alt=&quot;PDF 스트리밍 뷰어 '스트림닥스' 에서 문서를 열람하며 비식별화 기능을 사용한 경우.&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bA5gOW/btsPP7W1oWk/x4G2caZfQSXBU2WUko7dVk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbA5gOW%2FbtsPP7W1oWk%2Fx4G2caZfQSXBU2WUko7dVk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;700&quot; height=&quot;425&quot; data-origin-width=&quot;700&quot; data-origin-height=&quot;425&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;PDF 스트리밍 뷰어 '스트림닥스' 에서 문서를 열람하며 비식별화 기능을 사용한 경우.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;700&quot; data-origin-height=&quot;444&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/b3oT1C/btsPSOVCnyk/gMuAIuI96m5CnKvvkXjPz0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/b3oT1C/btsPSOVCnyk/gMuAIuI96m5CnKvvkXjPz0/img.png&quot; data-alt=&quot;PDF 변환 서버 '피디에프 게이트웨이'에서 '블랙마커'를 적용하여 문서를 변환한 경우.&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/b3oT1C/btsPSOVCnyk/gMuAIuI96m5CnKvvkXjPz0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb3oT1C%2FbtsPSOVCnyk%2FgMuAIuI96m5CnKvvkXjPz0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;700&quot; height=&quot;444&quot; data-origin-width=&quot;700&quot; data-origin-height=&quot;444&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;PDF 변환 서버 '피디에프 게이트웨이'에서 '블랙마커'를 적용하여 문서를 변환한 경우.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;color: #222222; text-align: start;&quot; data-ke-size=&quot;size16&quot;&gt;문서 AI 기업 이파피루스(대표 김정희)는 민감정보 비식별화 모듈 '블랙마커(BlackMarker)'의 성능을 업그레이드, 대표 제품인 PDF 스트리밍 뷰어 '스트림닥스(StreamDocs)'와 PDF 변환 솔루션 '피디에프 게이트웨이(PDF Gateway)'의 부가기능으로 제공한다고 18일 밝혔다.&lt;br /&gt;&lt;br /&gt;이파피루스 자체 개발 모듈인 '블랙마커'는 PDF 문서에 포함된 민감정보를 찾아내고 마스킹(Masking) 처리한 후, 원본 데이터를 삭제하여 정보 유출 위험을 원천 차단한다. 이번 업그레이드를 통해 기존의 전화번호, 주민등록번호, 이메일과 같이 일정한 형식을 갖춘 정형화된 데이터는 물론, 인명이나 주소와 같은 비정형 개인정보도 자동으로 감지하여 일괄 비식별 처리할 수 있게 됐다.&lt;br /&gt;&lt;br /&gt;이러한 성능 향상의 비결은 방대한 인명과 지명 데이터베이스를 기반으로 업그레이드한 비식별화 모델 덕분. 새로워진 '블랙마커'의 비식별화 모델은 규칙 기반 모델과 사전 기반 모델로 구성돼 있다. 문서를 업로드하면 텍스트 전처리 과정을 거친 후, 두 모델이 각각 문서 내에 포함된 정형&amp;middot;비정형 개인정보를 인식하여 비식별화한다.&lt;br /&gt;&lt;br /&gt;커스텀 기능과 효율적인 문서 처리 방식도 눈에 띈다. '블랙마커'는 마스킹 처리된 부분에 원하는 텍스트나 특수문자가 표시되도록 설정하는 커스텀 기능을 지원한다. 서버 기반 자동 배치 처리 방식을 적용하여 대량의 문서도 빠르고 안정적으로 비식별화한다.&lt;br /&gt;&lt;br /&gt;김정아 이파피루스 부사장은 &amp;ldquo;AI를 활용한 비식별화 솔루션의 경우 기존 방식보다는 정확도가 높지만 고가의 GPU 서버 환경을 요구하기 때문에 고객 입장에서는 도입 비용 부담이 크다&amp;rdquo;라면서 &amp;ldquo;이파피루스 '블랙마커'는 메인보드에 내장된 일반적인 수준의 GPU를 그대로 사용하면서도 AI 비식별화 수준의 정확도를 구현, 비용 절감과 정보 보호 강화를 동시에 실현할 수 있다&amp;rdquo;고 전했다.&lt;br /&gt;&lt;br /&gt;PDF 뷰어 '스트림닥스'에서 '블랙마커' 기능을 사용하면 문서를 업로드한 후 뷰어 내에서 직접 텍스트를 검색하거나 영역을 지정하여 마스킹 처리하거나, 이름 및 주소, 전화번호와 주민번호 등을 일괄 비식별화할 수 있다. 보안 처리된 문서는 파일 다운로드 없이 웹 브라우저에서 바로 열람할 수 있는 링크를 통해 공유할 수 있어 더욱 안전하고 편리하다.&lt;/p&gt;
&lt;p style=&quot;color: #222222; text-align: start;&quot; data-ke-size=&quot;size16&quot;&gt;PDF 변환 솔루션 '피디에프 게이트웨이'에서 사용할 경우 한글, MS오피스, 기타 다양한 포맷의 문서를 PDF 문서로 변환하면서 동시에 민감정보를 비식별화할 수 있다. A&lt;span&gt;&lt;a style=&quot;color: #222222;&quot;&gt;PI&lt;/a&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;커스텀을 통해 기관명이나 명사, 정규식 등 특정 데이터를 자동으로 마스킹 처리하는 것도 가능하다.&lt;/p&gt;
&lt;p style=&quot;color: #222222; text-align: start;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;figure id=&quot;og_1755063648488&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;article&quot; data-og-title=&quot;이파피루스, 민감정보 비식별화 부가기능 '블랙마커' 업그레이드&quot; data-og-description=&quot;문서 AI 기업 이파피루스(대표 김정희)는 민감정보 비식별화 모듈 '블랙마커(BlackMarker)'의 성능을 업그레이드, 대표 제품인 PDF 스트리밍 뷰어 '스트림닥스(StreamDocs)'와 PDF 변환 솔루션 '피디에프 &quot; data-og-host=&quot;www.etnews.com&quot; data-og-source-url=&quot;https://www.etnews.com/20250618000089&quot; data-og-url=&quot;https://www.etnews.com/20250618000089?SNS=00002&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bEkWHO/hyZylCD3zg/MZWkAc10ceB4WR4kDYGlc0/img.png?width=700&amp;amp;height=425&amp;amp;face=0_0_700_425&quot;&gt;&lt;a href=&quot;https://www.etnews.com/20250618000089&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://www.etnews.com/20250618000089&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bEkWHO/hyZylCD3zg/MZWkAc10ceB4WR4kDYGlc0/img.png?width=700&amp;amp;height=425&amp;amp;face=0_0_700_425');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;이파피루스, 민감정보 비식별화 부가기능 '블랙마커' 업그레이드&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;문서 AI 기업 이파피루스(대표 김정희)는 민감정보 비식별화 모듈 '블랙마커(BlackMarker)'의 성능을 업그레이드, 대표 제품인 PDF 스트리밍 뷰어 '스트림닥스(StreamDocs)'와 PDF 변환 솔루션 '피디에프&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;www.etnews.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: #222222;&quot;&gt;
&lt;p style=&quot;color: #00a0e9;&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
      <category>언론보도</category>
      <category>개인정보</category>
      <category>블랙마커</category>
      <category>비식별화</category>
      <category>정보보호</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/432</guid>
      <comments>https://epapyrus.tistory.com/432#entry432comment</comments>
      <pubDate>Wed, 13 Aug 2025 14:42:05 +0900</pubDate>
    </item>
    <item>
      <title>'PyMuPDF Pro'로 PDF 병합하기! 완벽 가이드 (샘플 코드 포함)</title>
      <link>https://epapyrus.tistory.com/431</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;무피디에프프로6.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bucopw/btsPNiYbZOS/yQqXMbEWCe0g9NR3dygUQ0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bucopw/btsPNiYbZOS/yQqXMbEWCe0g9NR3dygUQ0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bucopw/btsPNiYbZOS/yQqXMbEWCe0g9NR3dygUQ0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbucopw%2FbtsPNiYbZOS%2FyQqXMbEWCe0g9NR3dygUQ0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;무피디에프프로6.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-end=&quot;80&quot; data-start=&quot;48&quot; data-ke-size=&quot;size26&quot;&gt;  PyMuPDF Pro로 PDF 병합하기: 기본부터 고급 기능까지&lt;/h2&gt;
&lt;p data-end=&quot;249&quot; data-start=&quot;91&quot; data-ke-size=&quot;size16&quot;&gt;PDF 병합은 보고서 통합, 연구 자료 합본, 문서 묶음 제작 등 다양한 작업에서 자주 필요한 기능입니다. PyMuPDF Pro는 빠르고 가벼우면서도 세밀한 제어가 가능해, 간단한 결합부터 페이지 범위 지정, 메타데이터 추가까지 모두 처리할 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;294&quot; data-start=&quot;251&quot; data-ke-size=&quot;size16&quot;&gt;이 가이드에서는 &lt;b&gt;PyMuPDF Pro로 PDF를 병합하는 방법&lt;/b&gt;을 다룹니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;368&quot; data-start=&quot;295&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;320&quot; data-start=&quot;295&quot;&gt;기본 병합 (Concatenation)&lt;/li&gt;
&lt;li data-end=&quot;339&quot; data-start=&quot;321&quot;&gt;페이지 범위를 지정한 병합&lt;/li&gt;
&lt;li data-end=&quot;368&quot; data-start=&quot;340&quot;&gt;북마크와 메타데이터 유지 등 고급 병합&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h3 data-end=&quot;393&quot; data-start=&quot;375&quot; data-ke-size=&quot;size23&quot;&gt;1. 기본 PDF 병합&lt;/h3&gt;
&lt;p data-end=&quot;450&quot; data-start=&quot;394&quot; data-ke-size=&quot;size16&quot;&gt;가장 단순한 방법은 여러 PDF를 순서대로 합치는 것입니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;merge_pdfs(pdf_list,&amp;nbsp;output_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Merge&amp;nbsp;multiple&amp;nbsp;PDFs&amp;nbsp;into&amp;nbsp;a&amp;nbsp;single&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_list:&amp;nbsp;List&amp;nbsp;of&amp;nbsp;PDF&amp;nbsp;file&amp;nbsp;paths&amp;nbsp;to&amp;nbsp;merge&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path:&amp;nbsp;Path&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;merged&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;a&amp;nbsp;new&amp;nbsp;PDF&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Iterate&amp;nbsp;through&amp;nbsp;each&amp;nbsp;PDF&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;pdf_path&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;pdf_list:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;all&amp;nbsp;pages&amp;nbsp;from&amp;nbsp;the&amp;nbsp;current&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.insert_pdf(pdf_document)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Close&amp;nbsp;the&amp;nbsp;current&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;merged&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Example&amp;nbsp;usage&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;pdf_files&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;[&lt;span style=&quot;color: #63a35c;&quot;&gt;'document1.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'document2.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'document3.pdf'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;merge_pdfs(pdf_files,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'merged_document.pdf'&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;&lt;/div&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;2. 특정 페이지 범위 병합하기&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;전체 문서가 아니라 일부 페이지만 병합할 수도 있습니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;merge_pdf_pages(pdf_info,&amp;nbsp;output_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Merge&amp;nbsp;specific&amp;nbsp;pages&amp;nbsp;from&amp;nbsp;multiple&amp;nbsp;PDFs&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_info:&amp;nbsp;List&amp;nbsp;of&amp;nbsp;tuples&amp;nbsp;(pdf_path,&amp;nbsp;start_page,&amp;nbsp;end_page)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path:&amp;nbsp;Path&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;merged&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;pdf_path,&amp;nbsp;start_page,&amp;nbsp;end_page&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;pdf_info:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;specific&amp;nbsp;page&amp;nbsp;range&amp;nbsp;(0-indexed)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.insert_pdf(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;from_page&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;start_page,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;to_page&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;end_page&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Example:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;page_ranges&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;[&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;span style=&quot;color: #63a35c;&quot;&gt;'document1.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;),&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;First&amp;nbsp;2&amp;nbsp;pages&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;span style=&quot;color: #63a35c;&quot;&gt;'document2.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;3&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;6&lt;/span&gt;)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Pages&amp;nbsp;4-7&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;merge_pdf_pages(page_ranges,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'custom_merged.pdf'&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;809&quot; data-start=&quot;788&quot; data-ke-size=&quot;size23&quot;&gt;3. 오류 처리 포함 고급 병합&lt;/h3&gt;
&lt;p data-end=&quot;842&quot; data-start=&quot;810&quot; data-ke-size=&quot;size16&quot;&gt;실제 환경에서는 오류 처리와 유효성 검사가 중요합니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;61&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;62&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;63&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;64&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;65&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;66&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;67&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;68&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;69&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;70&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;71&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;72&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;73&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;74&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;75&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;76&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;77&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;78&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;79&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;from&lt;/span&gt;&amp;nbsp;pathlib&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;Path&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;merge_pdfs_robust(pdf_list,&amp;nbsp;output_path,&amp;nbsp;include_bookmarks&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Robustly&amp;nbsp;merge&amp;nbsp;PDFs&amp;nbsp;with&amp;nbsp;error&amp;nbsp;handling&amp;nbsp;and&amp;nbsp;optional&amp;nbsp;bookmark&amp;nbsp;preservation&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_list:&amp;nbsp;List&amp;nbsp;of&amp;nbsp;PDF&amp;nbsp;file&amp;nbsp;paths&amp;nbsp;to&amp;nbsp;merge&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path:&amp;nbsp;Path&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;merged&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;include_bookmarks:&amp;nbsp;Whether&amp;nbsp;to&amp;nbsp;preserve&amp;nbsp;bookmarks&amp;nbsp;from&amp;nbsp;source&amp;nbsp;PDFs&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;i,&amp;nbsp;pdf_path&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enumerate(pdf_list):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Check&amp;nbsp;if&amp;nbsp;file&amp;nbsp;exists&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;not&lt;/span&gt;&amp;nbsp;os.path.exists(pdf_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Warning:&amp;nbsp;File&amp;nbsp;{pdf_path}&amp;nbsp;not&amp;nbsp;found,&amp;nbsp;skipping...&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Check&amp;nbsp;if&amp;nbsp;PDF&amp;nbsp;is&amp;nbsp;valid&amp;nbsp;and&amp;nbsp;has&amp;nbsp;pages&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;pdf_document.page_count&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Warning:&amp;nbsp;{pdf_path}&amp;nbsp;has&amp;nbsp;no&amp;nbsp;pages,&amp;nbsp;skipping...&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Get&amp;nbsp;current&amp;nbsp;page&amp;nbsp;count&amp;nbsp;for&amp;nbsp;bookmark&amp;nbsp;offset&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;current_page_count&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;merged_pdf.page_count&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;all&amp;nbsp;pages&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.insert_pdf(pdf_document)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Handle&amp;nbsp;bookmarks&amp;nbsp;if&amp;nbsp;requested&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;include_bookmarks:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;toc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pdf_document.get_toc()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;toc:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Adjust&amp;nbsp;bookmark&amp;nbsp;page&amp;nbsp;numbers&amp;nbsp;for&amp;nbsp;merged&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;adjusted_toc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;[]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;level,&amp;nbsp;title,&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;toc:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;adjusted_toc.append([level,&amp;nbsp;title,&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;current_page_count])&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Get&amp;nbsp;existing&amp;nbsp;TOC&amp;nbsp;and&amp;nbsp;extend&amp;nbsp;it&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;existing_toc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;merged_pdf.get_toc()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;existing_toc.extend(adjusted_toc)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.set_toc(existing_toc)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Warning:&amp;nbsp;Could&amp;nbsp;not&amp;nbsp;process&amp;nbsp;bookmarks&amp;nbsp;for&amp;nbsp;{pdf_path}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Successfully&amp;nbsp;merged:&amp;nbsp;{pdf_path}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;e:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Error&amp;nbsp;processing&amp;nbsp;{pdf_path}:&amp;nbsp;{str(e)}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;merged&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;merged_pdf.page_count&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Merged&amp;nbsp;PDF&amp;nbsp;saved&amp;nbsp;to:&amp;nbsp;{output_path}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Total&amp;nbsp;pages:&amp;nbsp;{merged_pdf.page_count}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;No&amp;nbsp;pages&amp;nbsp;to&amp;nbsp;merge!&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;e:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Error&amp;nbsp;during&amp;nbsp;merge&amp;nbsp;process:&amp;nbsp;{str(e)}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;finally:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Example&amp;nbsp;usage&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;pdf_files&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;[&lt;span style=&quot;color: #63a35c;&quot;&gt;'report1.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'report2.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'appendix.pdf'&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;merge_pdfs_robust(pdf_files,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'final_report.pdf'&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;1335&quot; data-start=&quot;1314&quot; data-ke-size=&quot;size23&quot;&gt;4. 원하는 위치에 페이지 삽입&lt;/h3&gt;
&lt;p data-end=&quot;1370&quot; data-start=&quot;1336&quot; data-ke-size=&quot;size16&quot;&gt;병합 시 페이지를 원하는 위치에 끼워 넣을 수도 있습니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;merge_with_custom_insertion(base_pdf,&amp;nbsp;insertions,&amp;nbsp;output_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Merge&amp;nbsp;PDFs&amp;nbsp;with&amp;nbsp;custom&amp;nbsp;insertion&amp;nbsp;points&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base_pdf:&amp;nbsp;Path&amp;nbsp;to&amp;nbsp;the&amp;nbsp;base&amp;nbsp;PDF&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;insertions:&amp;nbsp;List&amp;nbsp;of&amp;nbsp;tuples&amp;nbsp;(pdf_path,&amp;nbsp;insert_after_page)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path:&amp;nbsp;Path&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;merged&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;base&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(base_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Sort&amp;nbsp;insertions&amp;nbsp;by&amp;nbsp;page&amp;nbsp;number&amp;nbsp;(descending)&amp;nbsp;to&amp;nbsp;avoid&amp;nbsp;page&amp;nbsp;number&amp;nbsp;shifts&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;insertions.sort(key&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;lambda&amp;nbsp;x:&amp;nbsp;x[&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;],&amp;nbsp;reverse&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;pdf_path,&amp;nbsp;insert_at_page&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;insertions:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;insert_pdf&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;at&amp;nbsp;specified&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.insert_pdf(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;insert_pdf,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;start_at&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;insert_at_page&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;insert_pdf.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Example:&amp;nbsp;Insert&amp;nbsp;cover.pdf&amp;nbsp;at&amp;nbsp;page&amp;nbsp;1,&amp;nbsp;insert&amp;nbsp;appendix.pdf&amp;nbsp;at&amp;nbsp;page&amp;nbsp;9&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;insertions&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;[&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;span style=&quot;color: #63a35c;&quot;&gt;'cover.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;span style=&quot;color: #63a35c;&quot;&gt;'appendix.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;8&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;merge_with_custom_insertion(&lt;span style=&quot;color: #63a35c;&quot;&gt;'main_document.pdf'&lt;/span&gt;,&amp;nbsp;insertions,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'complete_document.pdf'&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;5. 대용량 PDF 성능 최적화&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;큰 PDF를 다룰 때는 다음과 같은 최적화 방법을 고려하세요.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;merge_large_pdfs(pdf_list,&amp;nbsp;output_path,&amp;nbsp;chunk_size&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;10&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Merge&amp;nbsp;large&amp;nbsp;PDFs&amp;nbsp;with&amp;nbsp;memory&amp;nbsp;optimization&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_list:&amp;nbsp;List&amp;nbsp;of&amp;nbsp;PDF&amp;nbsp;file&amp;nbsp;paths&amp;nbsp;to&amp;nbsp;merge&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path:&amp;nbsp;Path&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;merged&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;chunk_size:&amp;nbsp;Number&amp;nbsp;of&amp;nbsp;pages&amp;nbsp;to&amp;nbsp;process&amp;nbsp;at&amp;nbsp;once&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;pdf_path&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;pdf_list:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;total_pages&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pdf_document.page_count&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Process&amp;nbsp;in&amp;nbsp;chunks&amp;nbsp;to&amp;nbsp;manage&amp;nbsp;memory&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;start_page&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;total_pages,&amp;nbsp;chunk_size):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;min(start_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;chunk_size&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;total_pages&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;temporary&amp;nbsp;document&amp;nbsp;for&amp;nbsp;this&amp;nbsp;chunk&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp_doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp_doc.insert_pdf(pdf_document,&amp;nbsp;from_page&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;start_page,&amp;nbsp;to_page&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;end_page)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;chunk&amp;nbsp;into&amp;nbsp;merged&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.insert_pdf(temp_doc)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Clean&amp;nbsp;up&amp;nbsp;temporary&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;temp_doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;merge_large_pdfs([&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;large-doc-1&quot;&lt;/span&gt;,&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;large-doc-2.pdf&quot;&lt;/span&gt;],&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;6. 병합된 PDF에 메타데이터 추가하기&lt;/b&gt;&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PDF 병합 후에는 문서 속성(제목, 저자, 주제 등)을 추가하거나 수정할 수 있습니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;merge_with_metadata(pdf_list,&amp;nbsp;output_path,&amp;nbsp;metadata&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;None&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Merge&amp;nbsp;PDFs&amp;nbsp;and&amp;nbsp;add&amp;nbsp;custom&amp;nbsp;metadata&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_list:&amp;nbsp;List&amp;nbsp;of&amp;nbsp;PDF&amp;nbsp;file&amp;nbsp;paths&amp;nbsp;to&amp;nbsp;merge&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path:&amp;nbsp;Path&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;merged&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;metadata:&amp;nbsp;Dictionary&amp;nbsp;of&amp;nbsp;metadata&amp;nbsp;to&amp;nbsp;add&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Merge&amp;nbsp;the&amp;nbsp;PDFs&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;pdf_path&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;pdf_list:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(pdf_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.insert_pdf(pdf_document)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Add&amp;nbsp;metadata&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;metadata:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.set_metadata(metadata)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Default&amp;nbsp;metadata&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;default_metadata&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'title'&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'Merged&amp;nbsp;PDF&amp;nbsp;Document'&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'author'&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'PyMuPDF&amp;nbsp;Merger'&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'subject'&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'Combined&amp;nbsp;PDF&amp;nbsp;files'&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'creator'&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'Python&amp;nbsp;PyMuPDF'&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'producer'&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'PyMuPDF&amp;nbsp;Library'&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.set_metadata(default_metadata)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;merged_pdf.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Example&amp;nbsp;with&amp;nbsp;custom&amp;nbsp;metadata&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;custom_metadata&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'title'&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'Annual&amp;nbsp;Report&amp;nbsp;2024'&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'author'&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'Your&amp;nbsp;Company'&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'subject'&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'Financial&amp;nbsp;and&amp;nbsp;operational&amp;nbsp;results'&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'keywords'&lt;/span&gt;:&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'annual&amp;nbsp;report,&amp;nbsp;financial,&amp;nbsp;operations'&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;merge_with_metadata([&lt;span style=&quot;color: #63a35c;&quot;&gt;'q1.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'q2.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'q3.pdf'&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'q4.pdf'&lt;/span&gt;],&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'annual_report_2024.pdf'&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;custom_metadata)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;h3 data-end=&quot;1840&quot; data-start=&quot;1821&quot; data-ke-size=&quot;size23&quot;&gt; 프랙티스 &amp;amp; 팁&lt;/h3&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;1. 문서 닫기&lt;/b&gt;&lt;br /&gt;PyMuPDF Pro문서는 작업이 끝나면 반드시 닫아 메모리를 해제하세요.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;2. 암호화된 PDF 처리&lt;/b&gt;&lt;br /&gt;PDF가 암호화되어 있는지 확인하고, 필요하면 인증을 진행하세요.&lt;/p&gt;
&lt;div&gt;
&lt;pre id=&quot;code_1754964145455&quot; class=&quot;python&quot; data-ke-language=&quot;python&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;if pdf_document.needs_pass:
    pdf_document.authenticate(&quot;password&quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;3. 입력 파일 검증&lt;/b&gt;&lt;br /&gt;처리 전, 파일이 존재하고 유효한 PDF인지 확인하세요.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;4. 메모리 관리&lt;/b&gt;&lt;br /&gt;대용량 문서는 청크 단위 처리나 임시 파일 사용을 고려하세요.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;5.문서 구조 유지&lt;/b&gt;&lt;br /&gt;관련 문서를 병합할 때는 북마크 등 기존 구조를 보존하세요.&lt;/p&gt;
&lt;p data-end=&quot;2376&quot; data-start=&quot;2237&quot; data-ke-size=&quot;size16&quot;&gt;&lt;br /&gt;PyMuPDF Pro는 기본 병합부터 페이지 범위 지정, 메타데이터 관리, 성능 최적화까지 폭넓은 기능을 제공합니다. 이 가이드의 예제를 바탕으로, 단순한 스크립트부터 대규모 문서 처리 자동화까지 다양한 병합 작업을 구현할 수 있습니다.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;많은&amp;nbsp;도움이&amp;nbsp;되셨길&amp;nbsp;바라며&amp;nbsp;제품에&amp;nbsp;대해&amp;nbsp;더&amp;nbsp;궁금하신&amp;nbsp;내용이&amp;nbsp;있다면&amp;nbsp;아래의&amp;nbsp;홈페이지로&amp;nbsp;문의해주세요!&lt;br /&gt;&lt;a href=&quot;https://epapyrus.com/customer/question.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&amp;gt;&amp;nbsp;문의하기&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>PDF</category>
      <category>pdf나누기</category>
      <category>PDF병합</category>
      <category>PDF파이썬라이브러리</category>
      <category>PyMuPDFPro</category>
      <category>파이썬라이브러리</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/431</guid>
      <comments>https://epapyrus.tistory.com/431#entry431comment</comments>
      <pubDate>Tue, 12 Aug 2025 11:15:23 +0900</pubDate>
    </item>
    <item>
      <title>PDF를 페이지별로 분할하는 가장 쉬운 방법: 'PyMuPDF Pro' (샘플 코드 포함)</title>
      <link>https://epapyrus.tistory.com/430</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;무피디에프프로5.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dyIOaZ/btsPMWgaPC9/4DRpJ8r6BDSQpfazzA75UK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dyIOaZ/btsPMWgaPC9/4DRpJ8r6BDSQpfazzA75UK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dyIOaZ/btsPMWgaPC9/4DRpJ8r6BDSQpfazzA75UK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdyIOaZ%2FbtsPMWgaPC9%2F4DRpJ8r6BDSQpfazzA75UK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;무피디에프프로5.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-end=&quot;68&quot; data-start=&quot;50&quot; data-ke-size=&quot;size26&quot;&gt;PDF 분할과 PyMuPDF Pro&lt;/h2&gt;
&lt;p data-end=&quot;223&quot; data-start=&quot;70&quot; data-ke-size=&quot;size16&quot;&gt;문서 처리 업무에서 PDF 파일을 다루는 일은 매우 흔한데요,&lt;br /&gt;그중에서도 &lt;b&gt;여러 페이지로 구성된 PDF를 페이지별 개별 파일로 나누는 작업&lt;/b&gt;은 특히 자주 하게됩니다.&lt;br /&gt;&lt;b&gt;PyMuPDF Pro&lt;/b&gt;는 이러한 작업을 쉽고 빠르게 처리할 수 있는 강력한 파이썬 라이브러리입니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h3 data-end=&quot;243&quot; data-start=&quot;230&quot; data-ke-size=&quot;size23&quot;&gt;PyMuPDF Pro란?&lt;/h3&gt;
&lt;p data-end=&quot;383&quot; data-start=&quot;245&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro는 &lt;b&gt;MuPDF&lt;/b&gt;라는 경량 PDF 엔진을 파이썬에서 사용할 수 있도록 만든 라이브러리입니다.&lt;br /&gt;PDF 문서를 &lt;b&gt;읽기, 작성, 편집, 가공&lt;/b&gt;하는 다양한 기능을 제공하며, 속도와 안정성이 뛰어나 PDF 작업에 널리 사용됩니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;399&quot; data-start=&quot;390&quot; data-ke-size=&quot;size23&quot;&gt;설치 방법&lt;/h3&gt;
&lt;p data-end=&quot;436&quot; data-start=&quot;401&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro는 pip 명령어로 간단히 설치할 수 있습니다.&lt;/p&gt;
&lt;div&gt;
&lt;pre id=&quot;code_1754873230525&quot; class=&quot;python&quot; data-ke-language=&quot;python&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;pip install PyMuPDF​&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;14&quot; data-start=&quot;0&quot; data-ke-size=&quot;size26&quot;&gt; 기본 PDF 분할&lt;/h2&gt;
&lt;p data-end=&quot;62&quot; data-start=&quot;16&quot; data-ke-size=&quot;size16&quot;&gt;아래는 하나의 PDF 파일을 페이지별로 나누어 저장하는 간단한 함수 예제입니다&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;split_pdf_to_pages(input_path,&amp;nbsp;output_folder):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Split&amp;nbsp;a&amp;nbsp;PDF&amp;nbsp;file&amp;nbsp;into&amp;nbsp;individual&amp;nbsp;pages.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;input_path&amp;nbsp;(str):&amp;nbsp;Path&amp;nbsp;to&amp;nbsp;the&amp;nbsp;input&amp;nbsp;PDF&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_folder&amp;nbsp;(str):&amp;nbsp;Directory&amp;nbsp;to&amp;nbsp;save&amp;nbsp;individual&amp;nbsp;pages&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;output&amp;nbsp;folder&amp;nbsp;if&amp;nbsp;it&amp;nbsp;doesn't&amp;nbsp;exist&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;os.makedirs(output_folder,&amp;nbsp;exist_ok&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Iterate&amp;nbsp;through&amp;nbsp;each&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(pdf_document)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;a&amp;nbsp;new&amp;nbsp;PDF&amp;nbsp;document&amp;nbsp;for&amp;nbsp;this&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;the&amp;nbsp;current&amp;nbsp;page&amp;nbsp;into&amp;nbsp;the&amp;nbsp;new&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf.insert_pdf(pdf_document,&amp;nbsp;from_page&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;page_num,&amp;nbsp;to_page&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;page_num)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;single-page&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.join(output_folder,&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;page_{page_num&amp;nbsp;+&amp;nbsp;1:03d}.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Close&amp;nbsp;the&amp;nbsp;original&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Successfully&amp;nbsp;split&amp;nbsp;PDF&amp;nbsp;into&amp;nbsp;{len(pdf_document)}&amp;nbsp;pages&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;example&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;split_pdf_to_pages(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input_document.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output_pages&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot; data-start=&quot;0&quot; data-end=&quot;14&quot;&gt; 고급 PDF 분할 &amp;ndash; 사용자 지정 파일명과 페이지 선택&lt;/h2&gt;
&lt;p data-end=&quot;62&quot; data-start=&quot;16&quot; data-ke-size=&quot;size16&quot;&gt;&lt;br /&gt;출력 파일명을 더 세밀하게 지정하거나, 특정 페이지만 골라서 분할해야 할 때 유용한 확장 버전입니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;61&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;62&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;63&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;64&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;65&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;from&lt;/span&gt;&amp;nbsp;pathlib&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;Path&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;split_pdf_advanced(input_path,&amp;nbsp;output_folder,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;name_prefix&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;page&quot;&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_range&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;None&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;preserve_bookmarks&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Advanced&amp;nbsp;PDF&amp;nbsp;splitting&amp;nbsp;with&amp;nbsp;customizable&amp;nbsp;options.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;input_path&amp;nbsp;(str):&amp;nbsp;Path&amp;nbsp;to&amp;nbsp;the&amp;nbsp;input&amp;nbsp;PDF&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_folder&amp;nbsp;(str):&amp;nbsp;Directory&amp;nbsp;to&amp;nbsp;save&amp;nbsp;individual&amp;nbsp;pages&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;name_prefix&amp;nbsp;(str):&amp;nbsp;Prefix&amp;nbsp;for&amp;nbsp;output&amp;nbsp;filenames&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_range&amp;nbsp;(tuple):&amp;nbsp;Optional&amp;nbsp;(start,&amp;nbsp;end)&amp;nbsp;page&amp;nbsp;range&amp;nbsp;(1-indexed)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;preserve_bookmarks&amp;nbsp;(bool):&amp;nbsp;Whether&amp;nbsp;to&amp;nbsp;preserve&amp;nbsp;bookmarks&amp;nbsp;in&amp;nbsp;output&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;output&amp;nbsp;directory&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Path(output_folder).mkdir(parents&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;,&amp;nbsp;exist_ok&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Determine&amp;nbsp;page&amp;nbsp;range&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;total_pages&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(pdf_document)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;page_range:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;start_page,&amp;nbsp;end_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page_range&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;start_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;max(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;start_page)&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Convert&amp;nbsp;to&amp;nbsp;0-indexed&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;min(total_pages,&amp;nbsp;end_page)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;start_page,&amp;nbsp;end_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;total_pages&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pages_split&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(start_page,&amp;nbsp;end_page):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;new&amp;nbsp;PDF&amp;nbsp;for&amp;nbsp;this&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;the&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf.insert_pdf(pdf_document,&amp;nbsp;from_page&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;page_num,&amp;nbsp;to_page&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;page_num)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Preserve&amp;nbsp;bookmarks&amp;nbsp;if&amp;nbsp;requested&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;preserve_bookmarks:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Get&amp;nbsp;bookmarks&amp;nbsp;for&amp;nbsp;this&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bookmarks&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pdf_document.get_toc()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_bookmarks&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;[bm&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;bm&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;bookmarks&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;bm[&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;]&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;page_bookmarks:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf.set_toc(page_bookmarks)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Generate&amp;nbsp;output&amp;nbsp;filename&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_filename&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;{name_prefix}_{page_num&amp;nbsp;+&amp;nbsp;1:03d}.pdf&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.join(output_folder,&amp;nbsp;output_filename)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pages_split&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Successfully&amp;nbsp;split&amp;nbsp;{pages_split}&amp;nbsp;pages&amp;nbsp;from&amp;nbsp;{input_path}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;pages_split&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;examples&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;split_pdf_advanced(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;document.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output&quot;&lt;/span&gt;,&amp;nbsp;name_prefix&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;chapter&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;split_pdf_advanced(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;document.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output&quot;&lt;/span&gt;,&amp;nbsp;page_range&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;10&lt;/span&gt;))&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;여러 개의 PDF를 한 번에 처리해야 한다면, 아래와 같이 &lt;b&gt;배치(Batch) 분할 함수&lt;/b&gt;를 활용할 수 있습니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;from&lt;/span&gt;&amp;nbsp;pathlib&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;Path&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;glob&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;batch_split_pdfs(input_folder,&amp;nbsp;output_base_folder):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Split&amp;nbsp;multiple&amp;nbsp;PDF&amp;nbsp;files&amp;nbsp;in&amp;nbsp;a&amp;nbsp;folder.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;input_folder&amp;nbsp;(str):&amp;nbsp;Folder&amp;nbsp;containing&amp;nbsp;PDF&amp;nbsp;files&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_base_folder&amp;nbsp;(str):&amp;nbsp;Base&amp;nbsp;folder&amp;nbsp;for&amp;nbsp;output&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_files&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;glob.glob(os.path.join(input_folder,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;*.pdf&quot;&lt;/span&gt;))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;not&lt;/span&gt;&amp;nbsp;pdf_files:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;No&amp;nbsp;PDF&amp;nbsp;files&amp;nbsp;found&amp;nbsp;in&amp;nbsp;the&amp;nbsp;input&amp;nbsp;folder&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;pdf_file&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;pdf_files:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;output&amp;nbsp;folder&amp;nbsp;for&amp;nbsp;this&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_name&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;Path(pdf_file).stem&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_folder&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.join(output_base_folder,&amp;nbsp;pdf_name)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;split_pdf_to_pages(pdf_file,&amp;nbsp;output_folder)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Processed:&amp;nbsp;{pdf_file}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;e:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Error&amp;nbsp;processing&amp;nbsp;{pdf_file}:&amp;nbsp;{str(e)}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;batch_split_pdfs(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input_pdfs&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;split_output&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;파일 작업 시에는 항상 오류 처리와 유효성 검증을 포함하는 것이 좋습니다.&lt;br /&gt;아래 예제는 PDF 분할 과정에 &lt;b&gt;예외 처리&lt;/b&gt;와 &lt;b&gt;입력 파일 검증&lt;/b&gt;을 추가한 버전입니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;from&lt;/span&gt;&amp;nbsp;pathlib&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;Path&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;split_pdf_safe(input_path,&amp;nbsp;output_folder):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Split&amp;nbsp;PDF&amp;nbsp;with&amp;nbsp;comprehensive&amp;nbsp;error&amp;nbsp;handling.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Validate&amp;nbsp;input&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;not&lt;/span&gt;&amp;nbsp;os.path.exists(input_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;raise&lt;/span&gt;&amp;nbsp;FileNotFoundError(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Input&amp;nbsp;file&amp;nbsp;not&amp;nbsp;found:&amp;nbsp;{input_path}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;not&lt;/span&gt;&amp;nbsp;input_path.lower().endswith(&lt;span style=&quot;color: #63a35c;&quot;&gt;'.pdf'&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;raise&lt;/span&gt;&amp;nbsp;ValueError(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Input&amp;nbsp;file&amp;nbsp;must&amp;nbsp;be&amp;nbsp;a&amp;nbsp;PDF&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;and&amp;nbsp;validate&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;pdf_document.is_encrypted:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;raise&lt;/span&gt;&amp;nbsp;ValueError(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Encrypted&amp;nbsp;PDFs&amp;nbsp;are&amp;nbsp;not&amp;nbsp;supported&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(pdf_document)&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;raise&lt;/span&gt;&amp;nbsp;ValueError(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;PDF&amp;nbsp;contains&amp;nbsp;no&amp;nbsp;pages&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;output&amp;nbsp;directory&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Path(output_folder).mkdir(parents&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;,&amp;nbsp;exist_ok&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Split&amp;nbsp;pages&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(pdf_document)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf.insert_pdf(pdf_document,&amp;nbsp;from_page&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;page_num,&amp;nbsp;to_page&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;page_num)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.join(output_folder,&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;page_{page_num&amp;nbsp;+&amp;nbsp;1:03d}.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new_pdf.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;,&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Successfully&amp;nbsp;split&amp;nbsp;{len(pdf_document)}&amp;nbsp;pages&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;e:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;,&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Error:&amp;nbsp;{str(e)}&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&amp;nbsp;with&amp;nbsp;error&amp;nbsp;handling&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;success,&amp;nbsp;message&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;split_pdf_safe(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(message)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div data-message-id=&quot;96ea4911-7e41-4c4d-9948-a9d2b3d9b178&quot; data-message-author-role=&quot;user&quot;&gt;
&lt;div&gt;
&lt;div data-multiline=&quot;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;성능을 고려해야 하는 상황이라면, 특히 &lt;/span&gt;&lt;b&gt;대용량 PDF&lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;나 &lt;/span&gt;&lt;b&gt;다수의 파일&lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;을 처리할 때 아래 최적화 팁을 참고하세요.&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot; data-start=&quot;0&quot; data-end=&quot;14&quot;&gt; 성능 최적화 팁&lt;/h2&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-end=&quot;385&quot; data-start=&quot;91&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li data-end=&quot;153&quot; data-start=&quot;91&quot;&gt;&lt;b&gt;메모리 관리&lt;/b&gt;&lt;br /&gt;작업이 끝난 PDF 문서는 즉시 close()로 닫아 메모리를 확보하세요.&lt;/li&gt;
&lt;li data-end=&quot;225&quot; data-start=&quot;158&quot;&gt;&lt;b&gt;배치 처리&lt;/b&gt;&lt;br /&gt;수천 페이지 이상의 대용량 파일은 페이지를 여러 번에 나눠서 처리하는 것이 안정적입니다.&lt;/li&gt;
&lt;li data-end=&quot;288&quot; data-start=&quot;230&quot;&gt;&lt;b&gt;빠른 디스크 사용&lt;/b&gt;&lt;br /&gt;파일 입출력이 많은 경우 SSD 사용이 HDD보다 훨씬 빠릅니다.&lt;/li&gt;
&lt;li data-end=&quot;385&quot; data-start=&quot;293&quot;&gt;&lt;b&gt;스레딩(Threading)&lt;/b&gt;&lt;br /&gt;여러 개의 작은 PDF를 한꺼번에 처리할 때는 I/O 중심의 작업이므로 스레딩을 활용하면 성능 향상에 도움이 됩니다.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 style=&quot;color: #000000; text-align: start;&quot; data-ke-size=&quot;size26&quot; data-start=&quot;0&quot; data-end=&quot;14&quot;&gt; PDF를 이미지로 변환 (대안 방식)&lt;/h2&gt;
&lt;p data-end=&quot;477&quot; data-start=&quot;417&quot; data-ke-size=&quot;size16&quot;&gt;PDF 페이지를 개별 이미지로 변환하면, PDF가 아닌 환경에서도 페이지를 쉽게 표시하거나 공유할 수 있습니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;split_pdf_to_images(input_path,&amp;nbsp;output_folder,&amp;nbsp;image_format&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;PNG&quot;&lt;/span&gt;,&amp;nbsp;dpi&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;150&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Convert&amp;nbsp;PDF&amp;nbsp;pages&amp;nbsp;to&amp;nbsp;image&amp;nbsp;files.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Args:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;input_path&amp;nbsp;(str):&amp;nbsp;Path&amp;nbsp;to&amp;nbsp;input&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_folder&amp;nbsp;(str):&amp;nbsp;Output&amp;nbsp;directory&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;image_format&amp;nbsp;(str):&amp;nbsp;Image&amp;nbsp;format&amp;nbsp;(PNG,&amp;nbsp;JPEG,&amp;nbsp;etc.)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dpi&amp;nbsp;(int):&amp;nbsp;Resolution&amp;nbsp;for&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;os.makedirs(output_folder,&amp;nbsp;exist_ok&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(&lt;span style=&quot;color: #066de2;&quot;&gt;len&lt;/span&gt;(pdf_document)):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pdf_document[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;transformation&amp;nbsp;matrix&amp;nbsp;for&amp;nbsp;desired&amp;nbsp;DPI&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mat&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Matrix(dpi&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;72&lt;/span&gt;,&amp;nbsp;dpi&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;72&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Render&amp;nbsp;page&amp;nbsp;to&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap(matrix&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;mat)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.join(output_folder,&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;page_{page_num&amp;nbsp;+&amp;nbsp;1:03d}.{image_format.lower()}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_document.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Converted&amp;nbsp;{len(pdf_document)}&amp;nbsp;pages&amp;nbsp;to&amp;nbsp;{image_format}&amp;nbsp;images&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-end=&quot;194&quot; data-start=&quot;45&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro는 PDF를 페이지 단위로 분리하는 작업을 간단하고 빠르게 처리할 수 있는 강력한 도구인데요,&lt;br /&gt;기본적인 분할부터 파일명 지정, 여러 파일의 일괄 처리까지 유연하게 지원해 소규모 스크립트는 물론 대규모 문서 처리에도 잘 어울리고&amp;nbsp;속도와 안정성이 뛰어나서 대용량 문서나 반복 작업에도 부담이 적습니다.&lt;br /&gt;&lt;br /&gt;작업 시에는 오류 처리를 꼼꼼히 하고, 사용이 끝난 문서는 반드시 close()로 닫아 성능과 메모리를 효율적으로 관리하는 것이 좋습니다. 소개드린 예제와 방법들을 활용하면, 상황에 맞는 PDF 분할 기능을 손쉽게 구현할 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;194&quot; data-start=&quot;45&quot; data-ke-size=&quot;size16&quot;&gt;많은 도움이 되셨길 바라며 제품에 대해 더 궁금하신 내용이 있다면 아래의 홈페이지로 문의해주세요!&lt;br /&gt;&lt;a href=&quot;https://epapyrus.com/customer/question.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&amp;gt; 문의하기&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1754876003850&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;website&quot; data-og-title=&quot;이파피루스&quot; data-og-description=&quot;ePapyrus는 항상 도움이 되겠습니다.이파피루스의 역사는 항상 고객, 파트너와의 삼위일체 속에서 성장하고 있습니다. 제품에 관련하여 궁금한 점이나 도움이 필요하시다면 언제든 연락바랍니다.&quot; data-og-host=&quot;epapyrus.com&quot; data-og-source-url=&quot;https://epapyrus.com/customer/question.php&quot; data-og-url=&quot;https://epapyrus.com/customer/question.php&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/bMzpJY/hyZvlKtwlG/hMWm1rC0yCiTFOa1Qtn2M0/img.png?width=1200&amp;amp;height=630&amp;amp;face=0_0_1200_630&quot;&gt;&lt;a href=&quot;https://epapyrus.com/customer/question.php&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://epapyrus.com/customer/question.php&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/bMzpJY/hyZvlKtwlG/hMWm1rC0yCiTFOa1Qtn2M0/img.png?width=1200&amp;amp;height=630&amp;amp;face=0_0_1200_630');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;이파피루스&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;ePapyrus는 항상 도움이 되겠습니다.이파피루스의 역사는 항상 고객, 파트너와의 삼위일체 속에서 성장하고 있습니다. 제품에 관련하여 궁금한 점이나 도움이 필요하시다면 언제든 연락바랍니다.&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;epapyrus.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>pdf나누기</category>
      <category>PyMuPDFPro</category>
      <category>파이썬라이브러리</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/430</guid>
      <comments>https://epapyrus.tistory.com/430#entry430comment</comments>
      <pubDate>Mon, 11 Aug 2025 10:34:07 +0900</pubDate>
    </item>
    <item>
      <title>'PyMuPDF Pro'를 활용한 PDF 주석 및 강조 표시: 샘플 코드 포함</title>
      <link>https://epapyrus.tistory.com/429</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;무피디에프프로4.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dDHiSI/btsPMoWVv5Y/Pnp5PYd7l19uDB8SBfAfwK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dDHiSI/btsPMoWVv5Y/Pnp5PYd7l19uDB8SBfAfwK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dDHiSI/btsPMoWVv5Y/Pnp5PYd7l19uDB8SBfAfwK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdDHiSI%2FbtsPMoWVv5Y%2FPnp5PYd7l19uDB8SBfAfwK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;무피디에프프로4.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-end=&quot;76&quot; data-start=&quot;46&quot; data-ke-size=&quot;size26&quot;&gt;'주석(Annotation)' 왜 중요한가요?&lt;/h2&gt;
&lt;p data-end=&quot;218&quot; data-start=&quot;78&quot; data-ke-size=&quot;size16&quot;&gt;주석과 하이라이트 기능은 &lt;b&gt;현대적인 문서 작업 흐름에서 필수적인 도구&lt;/b&gt;가 되었습니다.&lt;br /&gt;학계, 법률 문서, 협업 기반의 문서 검토 등 다양한 분야에서 &lt;b&gt;마크업 도구는 피드백을 구조화하고, 문서의 가독성을 높이는 데 중요한 역할&lt;/b&gt;을 합니다.&lt;/p&gt;
&lt;p data-end=&quot;250&quot; data-start=&quot;225&quot; data-ke-size=&quot;size16&quot;&gt;주석은 단순한 표시 그 이상입니다.&amp;nbsp;PDF에 주석을 추가한다는 것은 단순한 밑줄이나 강조 표시를 넘어,&lt;br /&gt;&lt;b&gt;디지털 텍스트와의 정밀한 상호작용&lt;/b&gt;을 가능하게 합니다. &lt;b&gt;법률 전문가&lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;의 경우 계약서에서 특정 조항을 강조하고, 삭제선을 넣거나 맥락별 의견을 남깁니다. &lt;/span&gt;&lt;b&gt;연구자&lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;는 논문 초안을 공동으로 검토하며 중요한 내용을 표시합니다. &lt;/span&gt;&lt;b&gt;학생&lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;의 경우 학습 자료에 동적으로 참여하면서 하이라이트와 메모를 추가하는 등 다양하게 활용될 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;h2 data-end=&quot;497&quot; data-start=&quot;482&quot; data-ke-size=&quot;size26&quot;&gt;✨ 대표적인 활용 사례&lt;/h2&gt;
&lt;div&gt;&lt;br /&gt;
&lt;table style=&quot;border-collapse: collapse; width: 100%;&quot; border=&quot;1&quot; data-end=&quot;689&quot; data-start=&quot;499&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody data-end=&quot;689&quot; data-start=&quot;527&quot;&gt;
&lt;tr data-end=&quot;585&quot; data-start=&quot;527&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;545&quot; data-start=&quot;527&quot;&gt;&lt;b&gt;학술 논문 피어 리뷰&lt;/b&gt;&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;585&quot; data-start=&quot;545&quot;&gt;공동 연구자들이 원고를 검토하며 핵심 내용을 표시하거나 수정 제안&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;632&quot; data-start=&quot;586&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;599&quot; data-start=&quot;586&quot;&gt;&lt;b&gt;계약서 협상&lt;/b&gt;&lt;/td&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;632&quot; data-start=&quot;599&quot;&gt;특정 조항 강조, 삭제선 삽입, 맥락 기반 주석 추가&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;689&quot; data-start=&quot;633&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;651&quot; data-start=&quot;633&quot;&gt;&lt;b&gt;비즈니스 문서 피드백&lt;/b&gt;&lt;/td&gt;
&lt;td data-end=&quot;689&quot; data-start=&quot;651&quot; data-col-size=&quot;sm&quot;&gt;보고서, 제안서, 프레젠테이션 등 문서에 구조화된 마크업 삽입&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style=&quot;color: #000000; font-size: 1.62em; letter-spacing: -1px;&quot;&gt;  PyMuPDF Pro의 주석 기능&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-end=&quot;845&quot; data-start=&quot;718&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;PyMuPDF Pro는 PDF에 하이라이트, 주석, 마크업 등을 프로그래밍 방식으로 추가할 수 있는 강력한 기능&lt;/b&gt;을 제공합니다.&lt;br /&gt;또한 자동화된 마크업 생성과 &lt;b&gt;상황에 맞춘 주석 커스터마이징&lt;/b&gt;도 유연하게 처리할 수 있습니다.&lt;/p&gt;
&lt;h3 data-end=&quot;867&quot; data-start=&quot;852&quot; data-ke-size=&quot;size23&quot;&gt;  주요 기능 요약&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1148&quot; data-start=&quot;869&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;939&quot; data-start=&quot;869&quot;&gt;&lt;b&gt;정밀한 텍스트 검색&lt;/b&gt;&lt;br /&gt;&amp;rarr; 수평이 아니거나 여러 줄에 걸친 텍스트도 정확히 찾아 해당 영역(rect)을 반환&lt;/li&gt;
&lt;li data-end=&quot;1000&quot; data-start=&quot;941&quot;&gt;&lt;b&gt;다중 줄 하이라이팅 지원&lt;/b&gt;&lt;br /&gt;&amp;rarr; 시작/종료 위치를 지정해 여러 줄에 걸쳐 하이라이트 가능&lt;/li&gt;
&lt;li data-end=&quot;1083&quot; data-start=&quot;1002&quot;&gt;&lt;b&gt;다양한 강조 스타일 제공&lt;/b&gt;&lt;br /&gt;&amp;rarr; 일반 하이라이트, 삭제선(strikeout), 밑줄(underline), 지그재그 밑줄 등 지원&lt;/li&gt;
&lt;li data-end=&quot;1148&quot; data-start=&quot;1085&quot;&gt;&lt;b&gt;호환성 보장&lt;/b&gt;&lt;br /&gt;&amp;rarr; PyMuPDF Pro로 생성한 주석은 &lt;b&gt;어떤 표준 PDF 리더에서도 완벽히 표시&lt;/b&gt;됨&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-end=&quot;1185&quot; data-start=&quot;1155&quot; data-ke-size=&quot;size26&quot;&gt;  예제 코드: 텍스트 검색 후 하이라이트 삽입&lt;/h2&gt;
&lt;p data-end=&quot;1249&quot; data-start=&quot;1187&quot; data-ke-size=&quot;size16&quot;&gt;아래는 PyMuPDF Pro를 사용해 특정 텍스트를 검색하고&lt;br /&gt;일치하는 모든 위치에 하이라이트를 적용하는 예제입니다:&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0px; padding: 0px; border: none; background-color: #fafafa; border-radius: 4px; height: 420px;&quot; width=&quot;796&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Load&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;file&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;sample.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Define&amp;nbsp;the&amp;nbsp;search&amp;nbsp;term&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;search_text&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;important&amp;nbsp;clause&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Iterate&amp;nbsp;through&amp;nbsp;pages&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;doc:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Search&amp;nbsp;for&amp;nbsp;the&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text_instances&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.search_for(search_text,&amp;nbsp;quads&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Apply&amp;nbsp;different&amp;nbsp;types&amp;nbsp;of&amp;nbsp;highlighting&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;inst&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;text_instances:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.add_highlight_annot(inst)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Standard&amp;nbsp;highlight&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.add_strikeout_annot(inst)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Strikeout&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.add_underline_annot(inst)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Underline&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.add_squiggly_annot(inst)&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Zigzag&amp;nbsp;underline&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;modified&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc.save(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;annotated.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-end=&quot;165&quot; data-start=&quot;38&quot; data-ke-size=&quot;size16&quot;&gt;위 코드에서는 quads=True 파라미터를 사용하면,&lt;br /&gt;&lt;b&gt;텍스트가 축(가로/세로)에 정렬되어 있지 않더라도&lt;/b&gt;&lt;br /&gt;기울어진 사각형(tilted rectangle)을 반환하므로 &lt;b&gt;자동으로 비수평 텍스트를 지원&lt;/b&gt;합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;197&quot; data-start=&quot;172&quot; data-ke-size=&quot;size23&quot;&gt;  여러 줄 하이라이트를 적용하려면?&lt;/h3&gt;
&lt;p data-end=&quot;280&quot; data-start=&quot;199&quot; data-ke-size=&quot;size16&quot;&gt;페이지 상에서 &lt;b&gt;시작 위치와 종료 위치를 나타내는 두 점&lt;/b&gt;을 식별해야 합니다.&lt;br /&gt;그 후, 하이라이트 구문은 아래와 같은 형식을 따릅니다:&lt;/p&gt;
&lt;pre id=&quot;code_1754615589905&quot; class=&quot;python&quot; data-ke-language=&quot;python&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;add_highlight_annot(start=start_point, stop=stop_point)&lt;/code&gt;&lt;/pre&gt;
&lt;p data-end=&quot;104&quot; data-start=&quot;79&quot; data-ke-size=&quot;size16&quot;&gt;이&amp;nbsp;방식은&amp;nbsp;지정한&amp;nbsp;두&amp;nbsp;점&amp;nbsp;사이에&amp;nbsp;포함된&amp;nbsp;모든&amp;nbsp;텍스트를&amp;nbsp;하이라이트합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;104&quot; data-start=&quot;79&quot; data-ke-size=&quot;size26&quot;&gt;✨개발자들이 PyMuPDF Pro를 선택하는 이유!&lt;/h2&gt;
&lt;p data-end=&quot;226&quot; data-start=&quot;106&quot; data-ke-size=&quot;size16&quot;&gt;주석 기능을 통합하려는 개발자에게 PyMuPDF Pro는 &lt;b&gt;효율적이고 가벼운 솔루션&lt;/b&gt;을 제공합니다.&lt;br /&gt;텍스트 위치와 하이라이트 스타일을 유연하게 조절하면서도, 프로그래밍 방식으로 마크업을 생성할 수 있게 해줍니다.&lt;/p&gt;
&lt;p data-end=&quot;307&quot; data-start=&quot;228&quot; data-ke-size=&quot;size16&quot;&gt;문서 검토 자동화든, 인터랙티브한 리딩 앱 구축이든 PyMuPDF Pro는 &lt;b&gt;정확한 주석 기능을 갖춘 PDF&lt;/b&gt;를 구현할 수 있도록 도와드리겠습니다 &lt;/p&gt;
&lt;p data-end=&quot;307&quot; data-start=&quot;228&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>pdf주석</category>
      <category>PDF하이라이트</category>
      <category>PyMuPDFPro</category>
      <category>개발</category>
      <category>코딩</category>
      <category>파이썬</category>
      <category>파이썬라이브러리</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/429</guid>
      <comments>https://epapyrus.tistory.com/429#entry429comment</comments>
      <pubDate>Fri, 8 Aug 2025 10:23:21 +0900</pubDate>
    </item>
    <item>
      <title>'PyMuPDF Pro'를 활용한 PDF 용량 최적화: 핵심 기법 3가지</title>
      <link>https://epapyrus.tistory.com/428</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;무피디에프프로3.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bytfQx/btsPHZdr0XE/1HbBeSWbmnD1WCchbdgDW0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bytfQx/btsPHZdr0XE/1HbBeSWbmnD1WCchbdgDW0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bytfQx/btsPHZdr0XE/1HbBeSWbmnD1WCchbdgDW0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbytfQx%2FbtsPHZdr0XE%2F1HbBeSWbmnD1WCchbdgDW0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;무피디에프프로3.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-end=&quot;226&quot; data-start=&quot;173&quot; data-ke-size=&quot;size26&quot;&gt;&lt;b&gt;✅ 업무 흐름을 방해하는 무거운 PDF, PyMuPDF Pro로 가볍게 최적화하세요 &lt;/b&gt;&lt;/h2&gt;
&lt;p data-end=&quot;281&quot; data-start=&quot;228&quot; data-ke-size=&quot;size16&quot;&gt;고해상도 이미지, 삽입된 폰트, 숨겨진 메타데이터 등으로 인해 PDF 파일이 과도하게 커지면 &lt;span style=&quot;letter-spacing: 0px;&quot;&gt;이메일 첨부 전송이 느려지고, &lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;저장 공간을 낭비하며, &lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;모바일 사용자에게 불편을 주는 등 &lt;/span&gt;업무 흐름 전체에 영향을 미칠 수 있습니다.&amp;nbsp;이럴 때는 명확한 목표를 가진 최적화 전략이 필요합니다.&lt;/p&gt;
&lt;p data-end=&quot;492&quot; data-start=&quot;408&quot; data-ke-size=&quot;size16&quot;&gt;이 글에서는 다음의 세 가지 핵심 기법을 중심으로, PyMuPDF Pro를 활용해 과도하게 커진 PDF를 &lt;b&gt;더 작고 빠르게 만드는 방법&lt;/b&gt;을 소개합니다:&lt;/p&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-end=&quot;557&quot; data-start=&quot;494&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li data-end=&quot;517&quot; data-start=&quot;494&quot;&gt;메타데이터 및 불필요한 요소 제거&lt;/li&gt;
&lt;li data-end=&quot;529&quot; data-start=&quot;518&quot;&gt;이미지 압축&lt;/li&gt;
&lt;li data-end=&quot;557&quot; data-start=&quot;530&quot;&gt;폰트 서브세팅(Font Subsetting)&lt;/li&gt;
&lt;/ol&gt;
&lt;p data-end=&quot;629&quot; data-start=&quot;559&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro는 직관적인 API를 제공하여,&lt;br /&gt;&lt;b&gt;복잡한 PDF 최적화 작업도 간단한 코드 몇 줄로 처리할 수 있습니다.&lt;/b&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;413&quot; data-start=&quot;373&quot; data-ke-size=&quot;size26&quot;&gt;1. 불필요한 요소 제거 (Dead-Weight Removal)&lt;/h2&gt;
&lt;h3 data-end=&quot;430&quot; data-start=&quot;415&quot; data-ke-size=&quot;size23&quot;&gt;  왜 중요한가요?&lt;/h3&gt;
&lt;p data-end=&quot;491&quot; data-start=&quot;432&quot; data-ke-size=&quot;size16&quot;&gt;PDF에는 시간이 지남에 따라 &lt;span style=&quot;letter-spacing: 0px;&quot;&gt;저자 정보, 수정 이력, 타임스탬프 같은 &lt;/span&gt;&lt;b&gt;메타데이터, &lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;페이지 썸네일, 첨부 파일, &lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;불필요한 주석 체인, &lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;오래된 폼 필드 값 등 &lt;span style=&quot;color: #333333; text-align: start;&quot;&gt;&amp;nbsp;**숨겨진 데이터(Dead Weight)**가 쌓이기 쉽습니다.&lt;span&gt; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;이런 요소들은 파일 크기를 부풀릴 뿐만 아니라, &lt;/span&gt;&lt;b&gt;민감한 정보 유출 위험&lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;까지 동반합니다.&lt;/span&gt;&lt;/p&gt;
&lt;h3 data-end=&quot;656&quot; data-start=&quot;639&quot; data-ke-size=&quot;size23&quot;&gt;  대표적인 Dead Weight 사례&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;746&quot; data-start=&quot;658&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;688&quot; data-start=&quot;658&quot;&gt;기업 백서나 기술 문서의 &lt;b&gt;공개 배포 전 정리&lt;/b&gt;&lt;/li&gt;
&lt;li data-end=&quot;718&quot; data-start=&quot;689&quot;&gt;웹사이트나 앱 내 &lt;b&gt;PDF 임베딩 전 경량화&lt;/b&gt;&lt;/li&gt;
&lt;li data-end=&quot;746&quot; data-start=&quot;719&quot;&gt;외부 공유 전 &lt;b&gt;개인정보/내부 정보 제거&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;776&quot; data-start=&quot;753&quot; data-ke-size=&quot;size23&quot;&gt;  PyMuPDF Pro로 해결하는 방법&lt;/h3&gt;
&lt;p data-end=&quot;857&quot; data-start=&quot;778&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro에서는 Document.scrub() 메서드 한 줄만으로 불필요한 모든 요소를 한 번에 정리할 수 있습니다:&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;import&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.open(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc.scrub(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;metadata&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Clears&amp;nbsp;basic&amp;nbsp;metadata&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;xml_metadata&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Removes&amp;nbsp;XML&amp;nbsp;metadata&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;attached_files&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Deletes&amp;nbsp;file&amp;nbsp;attachments&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;embedded_files&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Deletes&amp;nbsp;embedded&amp;nbsp;files&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;thumbnails&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Strips&amp;nbsp;page&amp;nbsp;thumbnails&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;reset_fields&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Reverts&amp;nbsp;form&amp;nbsp;fields&amp;nbsp;to&amp;nbsp;their&amp;nbsp;defaults&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;reset_responses&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Removes&amp;nbsp;annotation&amp;nbsp;replies&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc.ez_save(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;lean.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-end=&quot;205&quot; data-start=&quot;38&quot; data-ke-size=&quot;size16&quot;&gt;여기서 scrub() 메서드는 &lt;b&gt;불필요한 객체들을 제거&lt;/b&gt;하고,&lt;br /&gt;ez_save()(발음: &quot;이지 세이브&quot;)는 &lt;b&gt;논리적으로 삭제된 콘텐츠가 실제 출력 파일에서도 완전히 제거되도록 보장&lt;/b&gt;합니다.&lt;br /&gt;이 과정을 거치면, &lt;b&gt;더 작고 개인 정보 보호에 안전한 PDF&lt;/b&gt;를 만들 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;273&quot; data-start=&quot;207&quot; data-ke-size=&quot;size16&quot;&gt;  &lt;b&gt;최상의 결과&lt;/b&gt;를 얻으려면, 이 메서드들은 &lt;b&gt;파일을 저장하기 직전에 단 한 번만 실행&lt;/b&gt;하는 것이 좋습니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;69&quot; data-start=&quot;39&quot; data-ke-size=&quot;size26&quot;&gt;2. 폰트 서브세팅(Font Subsetting)&lt;/h2&gt;
&lt;h3 data-end=&quot;86&quot; data-start=&quot;71&quot; data-ke-size=&quot;size23&quot;&gt;  왜 중요한가요?&lt;/h3&gt;
&lt;p data-end=&quot;233&quot; data-start=&quot;88&quot; data-ke-size=&quot;size16&quot;&gt;PDF에 전체 폰트 파일을 삽입하면, 문서에서 단 몇 글자만 사용하더라도 폰트 하나당 수십에서 수백 KB의 용량이 추가될 수 있습니다. 이로 인해 원래는 단순한 PDF가 불필요하게 큰 파일이 되어 다운로드나 공유 시 부담이 됩니다.&lt;/p&gt;
&lt;h3 data-end=&quot;257&quot; data-start=&quot;240&quot; data-ke-size=&quot;size23&quot;&gt;  대표적인 사례&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;369&quot; data-start=&quot;259&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;291&quot; data-start=&quot;259&quot;&gt;&lt;b&gt;다국어 매뉴얼&lt;/b&gt; 제작 시, 다양한 문자셋 포함&lt;/li&gt;
&lt;li data-end=&quot;333&quot; data-start=&quot;292&quot;&gt;&lt;b&gt;서식 있는 주석&lt;/b&gt;(rich-text annotation) 생성&lt;/li&gt;
&lt;li data-end=&quot;369&quot; data-start=&quot;334&quot;&gt;폼 필드 위젯에 &lt;b&gt;서식 있는 텍스트 입력 또는 수정&lt;/b&gt; 시&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;397&quot; data-start=&quot;376&quot; data-ke-size=&quot;size23&quot;&gt;  PyMuPDF Pro로 해결하는 방법&lt;/h3&gt;
&lt;p data-end=&quot;478&quot; data-start=&quot;399&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro는 **내장된 폰트를 자동으로 서브세팅(subset)**하여,&lt;br /&gt;&lt;b&gt;실제로 사용된 글자(glyph)만 포함&lt;/b&gt;되도록 처리합니다.&lt;/p&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;560&quot; data-start=&quot;480&quot; data-ke-size=&quot;size16&quot;&gt;이 기능 덕분에 &lt;b&gt;시각적으로는 동일한 문서를 유지하면서도&lt;/b&gt;,&lt;br /&gt;불필요한 폰트 데이터를 제거하여 &lt;b&gt;파일 용량을 크게 줄일 수 있습니다.&lt;/b&gt;&lt;/p&gt;
&lt;pre id=&quot;code_1754532241557&quot; class=&quot;python&quot; data-ke-language=&quot;python&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;doc.subset_fonts()
doc.ez_save(&quot;output.pdf&quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이 과정은 &lt;b&gt;시각적 품질을 해치지 않으면서도&lt;/b&gt;,&lt;br /&gt;&lt;b&gt;폰트로 인한 불필요한 용량 부담을 크게 줄여줍니다.&lt;/b&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;⚠️ &lt;b&gt;중요&lt;/b&gt;&lt;br /&gt;이 메서드는 &lt;b&gt;파일을 저장하기 직전에 단 한 번만 실행&lt;/b&gt;해야 합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;83&quot; data-start=&quot;39&quot; data-ke-size=&quot;size26&quot;&gt;3. 고급 이미지 압축 (Advanced Image Compression)&lt;/h2&gt;
&lt;h3 data-end=&quot;100&quot; data-start=&quot;85&quot; data-ke-size=&quot;size23&quot;&gt;  왜 중요한가요?&lt;/h3&gt;
&lt;p data-end=&quot;186&quot; data-start=&quot;102&quot; data-ke-size=&quot;size16&quot;&gt;고해상도 이미지는 PDF 용량을 키우는 가장 큰 원인 중 하나입니다.&lt;br /&gt;300DPI의 사진 몇 장만으로도 수십 MB가 추가되어 &lt;span style=&quot;letter-spacing: 0px;&quot;&gt;업로드 속도를 느리게 하고 &lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;이메일 첨부에 부담을 주며 &lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;모바일 사용자에게는 불편을 유발할 수 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;h3 data-end=&quot;278&quot; data-start=&quot;261&quot; data-ke-size=&quot;size23&quot;&gt;  대표적인 사례&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;384&quot; data-start=&quot;280&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;323&quot; data-start=&quot;280&quot;&gt;&lt;b&gt;슬라이드 자료, 제품 카탈로그, 브로셔&lt;/b&gt; 등을 이메일로 공유할 때&lt;/li&gt;
&lt;li data-end=&quot;354&quot; data-start=&quot;324&quot;&gt;&lt;b&gt;모바일 앱&lt;/b&gt;에 최적화된 가벼운 PDF 게시&lt;/li&gt;
&lt;li data-end=&quot;384&quot; data-start=&quot;355&quot;&gt;&lt;b&gt;용량이 제한된 저장소에 스캔 문서 보관&lt;/b&gt; 시&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;412&quot; data-start=&quot;391&quot; data-ke-size=&quot;size23&quot;&gt;  PyMuPDF Pro로 해결하는 방법&lt;/h3&gt;
&lt;p data-end=&quot;489&quot; data-start=&quot;414&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro의 Document.rewrite_images() 메서드는 &lt;b&gt;이미지를 픽셀 수준까지 제어&lt;/b&gt;할 수 있게 해줍니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;558&quot; data-start=&quot;490&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;516&quot; data-start=&quot;490&quot;&gt;해상도 줄이기 (downsampling)&lt;/li&gt;
&lt;li data-end=&quot;540&quot; data-start=&quot;517&quot;&gt;재압축 (recompressing)&lt;/li&gt;
&lt;li data-end=&quot;558&quot; data-start=&quot;541&quot;&gt;흑백(그레이스케일) 변환 등&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;615&quot; data-start=&quot;560&quot; data-ke-size=&quot;size16&quot;&gt;필요에 따라 이미지 용량을 최소화하면서도 시각적 품질은 유지할 수 있도록 설계되어 있습니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;import&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.open(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;input.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc.rewrite_images(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dpi_threshold&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;only&amp;nbsp;process&amp;nbsp;images&amp;nbsp;above&amp;nbsp;100&amp;nbsp;DPI&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dpi_target&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;72&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;downsample&amp;nbsp;to&amp;nbsp;72&amp;nbsp;DPI&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;quality&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;60&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;JPEG&amp;nbsp;quality&amp;nbsp;level&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lossy&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;include&amp;nbsp;/&amp;nbsp;exclude&amp;nbsp;lossy&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lossless&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;include&amp;nbsp;/&amp;nbsp;exclude&amp;nbsp;lossless&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bitonal&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;include&amp;nbsp;/&amp;nbsp;exclude&amp;nbsp;monochrome&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;include&amp;nbsp;/&amp;nbsp;exclude&amp;nbsp;colored&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gray&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;include&amp;nbsp;/&amp;nbsp;exclude&amp;nbsp;gray-scale&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set_to_gray&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;True,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;convert&amp;nbsp;to&amp;nbsp;gray-scale&amp;nbsp;before&amp;nbsp;conversion&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc.ez_save(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;compressed_images.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이 예제에서는 100 DPI를 초과하는 모든 이미지를 해상도 72 DPI, 그레이스케일, **JPEG 포맷 (품질 60%)**으로 변환합니다.&lt;br /&gt;이렇게 하면 이미지 용량이 70~90%까지 줄어드는 경우도 많습니다.&lt;br /&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;이미지가 &lt;/span&gt;&lt;b&gt;전혀 필요 없다면&lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;PyMuPDF의 &lt;/span&gt;&lt;b&gt;레닥션(redaction) 주석 기능&lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;을 활용해 &lt;/span&gt;&lt;b&gt;이미지를 완전히 제거&lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;할 수도 있습니다.&lt;/span&gt;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;for&amp;nbsp;page&amp;nbsp;in&amp;nbsp;doc:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.add_redact_annot(page.rect)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.apply_redactions(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;images=pymupdf.PDF_REDACT_IMAGE_REMOVE,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;remove&amp;nbsp;images&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;graphics=pymupdf.pymupdf.PDF_REDACT_LINE_ART_NONE,&amp;nbsp;#&amp;nbsp;don't&amp;nbsp;touch&amp;nbsp;graphics&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text=pymupdf.PDF_REDACT_TEXT_NONE,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;don't&amp;nbsp;touch&amp;nbsp;text&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc.ez_save(&quot;images_stripped.pdf&quot;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h3 data-end=&quot;69&quot; data-start=&quot;39&quot; data-ke-size=&quot;size23&quot;&gt;&lt;br /&gt;  이미지 완전 제거: Redaction 주석&lt;/h3&gt;
&lt;p data-end=&quot;192&quot; data-start=&quot;71&quot; data-ke-size=&quot;size16&quot;&gt;redaction 주석을 사용하면, 페이지 내 모든 이미지를 완전히 삭제하고 텍스트 및 벡터 그래픽만 남길 수 있습니다.&lt;br /&gt;&amp;rarr; 시각 요소를 최소화한 극단적인 파일 용량 절감이 가능합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;240&quot; data-start=&quot;199&quot; data-ke-size=&quot;size26&quot;&gt;  4. 고급 저장 옵션 (Advanced Save Options)&lt;/h2&gt;
&lt;p data-end=&quot;314&quot; data-start=&quot;242&quot; data-ke-size=&quot;size16&quot;&gt;지금까지 수행한 scrub(), 이미지 다운샘플링, 폰트 서브세팅 등은 모두 메모리 상에서만 적용된 작업입니다.&lt;br /&gt;만약 참조되지 않는 객체(&amp;ldquo;유령 객체&amp;rdquo;)를 물리적으로 제거하거나, 내부 스트림(이미지, 폰트 등)을 압축하지 않으면, 파일 크기는 여전히 최적화되기 전과 크게 다르지 않을 수 있습니다.&lt;/p&gt;
&lt;h3 data-end=&quot;482&quot; data-start=&quot;442&quot; data-ke-size=&quot;size23&quot;&gt;✅ PyMuPDF Pro의 Document.save() 옵션 활용하기&lt;/h3&gt;
&lt;p data-end=&quot;569&quot; data-start=&quot;484&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro의 save() 메서드는 다음과 같은 &lt;b&gt;최적화 파라미터&lt;/b&gt;를 통해&lt;br /&gt;&lt;b&gt;불필요한 객체 제거 및 스트림 압축&lt;/b&gt;을 수행할 수 있습니다:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;파라미터설명
&lt;table style=&quot;border-collapse: collapse; width: 100%;&quot; border=&quot;1&quot; data-end=&quot;812&quot; data-start=&quot;571&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody data-end=&quot;812&quot; data-start=&quot;605&quot;&gt;
&lt;tr data-end=&quot;655&quot; data-start=&quot;605&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;619&quot; data-start=&quot;605&quot;&gt;garbage=3&lt;/td&gt;
&lt;td data-col-size=&quot;md&quot; data-end=&quot;655&quot; data-start=&quot;619&quot;&gt;사용되지 않는 객체를 찾아 &lt;b&gt;제거 및 중복 제거&lt;/b&gt; 수행&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;715&quot; data-start=&quot;656&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;673&quot; data-start=&quot;656&quot;&gt;deflate=True&lt;/td&gt;
&lt;td data-end=&quot;715&quot; data-start=&quot;673&quot; data-col-size=&quot;md&quot;&gt;압축되지 않은 스트림(이미지, 폰트 등)에 &lt;b&gt;zlib 압축&lt;/b&gt; 적용&lt;/td&gt;
&lt;/tr&gt;
&lt;tr data-end=&quot;812&quot; data-start=&quot;716&quot;&gt;
&lt;td data-col-size=&quot;sm&quot; data-end=&quot;737&quot; data-start=&quot;716&quot;&gt;use_objstms=True&lt;/td&gt;
&lt;td data-col-size=&quot;md&quot; data-end=&quot;812&quot; data-start=&quot;737&quot;&gt;PDF 내 텍스트 기반 객체를 &lt;b&gt;스트림 구조로 전환하여 추가 압축&lt;/b&gt; 수행 &amp;rarr; 보통 &lt;b&gt;추가로 25% 이상&lt;/b&gt; 용량 절감 가능&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;920&quot; data-start=&quot;819&quot; data-ke-size=&quot;size16&quot;&gt;이러한 옵션들을 조합하면 &lt;b&gt;최종 저장 시 진짜로 작고 효율적인 PDF&lt;/b&gt;를 생성할 수 있습니다.&lt;br /&gt;필요하다면 save() 전체 파라미터를 적용한 예제 코드도 제공해 드릴게요.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc.save(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;garbage&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;3&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;de-duplicate&amp;nbsp;and&amp;nbsp;drop&amp;nbsp;unreferenced&amp;nbsp;objects&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;deflate&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;zlib-compress&amp;nbsp;any&amp;nbsp;loose&amp;nbsp;streams&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;use_objstms&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;convert&amp;nbsp;text&amp;nbsp;objects&amp;nbsp;into&amp;nbsp;compressible&amp;nbsp;streams&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Or&amp;nbsp;simply:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc.ez_save(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;span style=&quot;color: #000000; font-size: 1.44em; letter-spacing: -1px;&quot;&gt;  ez_save()로 간편하게 최종 저장&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;ez_save() 메서드는 위에서 설명한 모든 최적화 옵션을 &lt;/span&gt;&lt;b&gt;내부적으로 자동 적용&lt;/b&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;하여, &lt;/span&gt;&lt;b&gt;디스크에 저장되는 PDF가 실제로 모든 최적화를 반영&lt;/b&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;하도록 보장해줍니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;span style=&quot;color: #000000; font-size: 1.62em; letter-spacing: -1px;&quot;&gt;✅ 결론&lt;br /&gt;&lt;/span&gt;&lt;b&gt;불필요한 요소 제거&lt;/b&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;, &lt;/span&gt;&lt;b&gt;이미지 최적화&lt;/b&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;, &lt;/span&gt;&lt;b&gt;폰트 서브세팅&lt;/b&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;을 결합하면 &lt;/span&gt;&lt;b&gt;과도하게 큰 PDF 파일을 작고 효율적인 문서로 탈바꿈&lt;/b&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;시킬 수 있습니다. 이러한 최적화는 특히&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;이메일 첨부, &lt;/span&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;모바일 앱용 경량 문서, &lt;/span&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;웹에 업로드할 PDF에 유용하게 활용할 수 있습니다.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;PyMuPDF Pro의 직관적인 API&lt;/b&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;는 이 모든 강력한 최적화 기법들을 &lt;/span&gt;&lt;b&gt;간단한 코드로 손쉽게 구현&lt;/b&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;할 수 있게 해줍니다.&lt;/span&gt;&lt;span style=&quot;color: #333333; letter-spacing: 0px;&quot;&gt;이제 콘텐츠 품질에 집중하고, 파일 크기나 전송 문제는 PyMuPDF Pro에게 맡기세요.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;&lt;/div&gt;
&lt;h3 data-end=&quot;634&quot; data-start=&quot;619&quot; data-ke-size=&quot;size23&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;  더 알아보기&lt;/span&gt;&lt;/h3&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;735&quot; data-start=&quot;635&quot; data-ke-size=&quot;size16&quot;&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;제품에 대해 궁금하신 내용은 언제든 문의해주세요!&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif;&quot;&gt;&lt;a href=&quot;https://epapyrus.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&amp;gt; 홈페이지 바로가기&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>pdf용랑줄이기</category>
      <category>PDF파이썬라이브러리</category>
      <category>PyMuPDFPro</category>
      <category>파이썬라이브러리</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/428</guid>
      <comments>https://epapyrus.tistory.com/428#entry428comment</comments>
      <pubDate>Thu, 7 Aug 2025 11:26:25 +0900</pubDate>
    </item>
    <item>
      <title>'PyMuPDF Pro'로 PDF에 워터마크 삽입하기 완벽 가이드: 샘플 코드 포함</title>
      <link>https://epapyrus.tistory.com/427</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;무피디에프프로 복사.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/JX3fq/btsPDYej7Ik/fonPMfOFeFYEzZK5lw9Kd0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/JX3fq/btsPDYej7Ik/fonPMfOFeFYEzZK5lw9Kd0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/JX3fq/btsPDYej7Ik/fonPMfOFeFYEzZK5lw9Kd0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FJX3fq%2FbtsPDYej7Ik%2FfonPMfOFeFYEzZK5lw9Kd0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;무피디에프프로 복사.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-end=&quot;160&quot; data-start=&quot;111&quot; data-ke-size=&quot;size26&quot;&gt;  PDF 워터마킹 완전 가이드: PyMuPDF Pro로 구현하는 텍스트/이미지 워터마크&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h3 data-end=&quot;178&quot; data-start=&quot;162&quot; data-ke-size=&quot;size23&quot;&gt;워터마킹이 중요한 이유&lt;/h3&gt;
&lt;p data-end=&quot;215&quot; data-start=&quot;180&quot; data-ke-size=&quot;size16&quot;&gt;PDF 워터마킹은 지적 재산권 보호, 브랜딩, 문서 보안 유지를 위해 필수적인 기술입니다.&lt;br /&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;기밀 비즈니스 문서에 'CONFIDENTIAL' 표시를 하거나, &lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;보고서에 회사 로고를 삽입하거나, &lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;창작물을 보호하기 위해 워터마크를 추가하는 경우 등 &lt;/span&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;워터마크는 문서 보안에 빼놓을 수 없는 &lt;/span&gt;&lt;b&gt;전문적이고 효과적인 수단&lt;/b&gt;&lt;span style=&quot;letter-spacing: 0px;&quot;&gt;입니다.&lt;/span&gt;&lt;/p&gt;
&lt;h2 data-end=&quot;432&quot; data-start=&quot;398&quot; data-ke-size=&quot;size26&quot;&gt;  PyMuPDF Pro: 빠르고 강력한 PDF 워터마킹 도구&lt;/h2&gt;
&lt;p data-end=&quot;497&quot; data-start=&quot;434&quot; data-ke-size=&quot;size16&quot;&gt;기능이 제한적인 다른 라이브러리 제품과 달리, PyMuPDF Pro는 다음과 같은 장점을 제공합니다:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;586&quot; data-start=&quot;499&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;511&quot; data-start=&quot;499&quot;&gt;빠른 처리 속도&lt;/li&gt;
&lt;li data-end=&quot;536&quot; data-start=&quot;512&quot;&gt;텍스트 및 이미지 워터마크 모두 지원&lt;/li&gt;
&lt;li data-end=&quot;555&quot; data-start=&quot;537&quot;&gt;광범위한 사용자 정의 옵션&lt;/li&gt;
&lt;li data-end=&quot;586&quot; data-start=&quot;556&quot;&gt;대량 처리(batch processing)까지 지원&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;591&quot; data-start=&quot;588&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;607&quot; data-start=&quot;593&quot; data-ke-size=&quot;size26&quot;&gt;⚙️ 개발 환경 설정&lt;/h2&gt;
&lt;p data-end=&quot;630&quot; data-start=&quot;609&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro 설치는 매우 간단합니다:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;pre id=&quot;code_1754442831892&quot; class=&quot;python&quot; data-ke-language=&quot;python&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;pip install pymupdf​&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-end=&quot;720&quot; data-start=&quot;665&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;PyMuPDF Pro는 종속성이 거의 없으며 Windows, macOS, Linux 등 다양한 운영체제에서 작동합니다.&lt;/b&gt;&lt;br /&gt;이미지 워터마크를 사용하려면, &lt;b&gt;추가적인 이미지 처리 기능을 위해 Pillow 라이브러리&lt;/b&gt;를 함께 설치하는 것이 좋습니다:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;pre id=&quot;code_1754442863014&quot; class=&quot;python&quot; data-ke-language=&quot;python&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;pip install pillow&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-end=&quot;772&quot; data-start=&quot;754&quot; data-ke-size=&quot;size23&quot;&gt;필요한 기본 import:&lt;/h3&gt;
&lt;div&gt;
&lt;pre id=&quot;code_1754442879437&quot; class=&quot;python&quot; data-ke-language=&quot;python&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;import pymupdf 
import os 
from datetime import datetime&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr data-end=&quot;847&quot; data-start=&quot;844&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;868&quot; data-start=&quot;849&quot; data-ke-size=&quot;size26&quot;&gt;  워터마크의 종류 이해하기&lt;/h2&gt;
&lt;p data-end=&quot;901&quot; data-start=&quot;870&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro에서는 다음 두 가지 워터마크를 지원합니다:&lt;/p&gt;
&lt;h3 data-end=&quot;918&quot; data-start=&quot;903&quot; data-ke-size=&quot;size23&quot;&gt;1. 텍스트 워터마크&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;991&quot; data-start=&quot;919&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;956&quot; data-start=&quot;919&quot;&gt;저작권, 기밀 표시, 타임스탬프 등 텍스트 기반 정보에 적합&lt;/li&gt;
&lt;li data-end=&quot;991&quot; data-start=&quot;957&quot;&gt;가볍고 커스터마이징이 쉬우며, 파일 용량 증가가 거의 없음&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;1008&quot; data-start=&quot;993&quot; data-ke-size=&quot;size23&quot;&gt;2. 이미지 워터마크&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1070&quot; data-start=&quot;1009&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1035&quot; data-start=&quot;1009&quot;&gt;로고, 서명 등 시각적 요소 삽입에 적합&lt;/li&gt;
&lt;li data-end=&quot;1070&quot; data-start=&quot;1036&quot;&gt;시각적 효과가 크지만 위치/크기/용량을 신중히 고려해야 함&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1144&quot; data-start=&quot;1072&quot; data-ke-size=&quot;size16&quot;&gt;  PyMuPDF Pro좌표계: 각 페이지의 좌측 상단이 (0, 0)&lt;br /&gt;&amp;rarr; &lt;b&gt;정확한 위치 지정에 필수적으로 이해해야 하는 개념&lt;/b&gt;&lt;/p&gt;
&lt;hr data-end=&quot;1149&quot; data-start=&quot;1146&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;1171&quot; data-start=&quot;1151&quot; data-ke-size=&quot;size26&quot;&gt;✏️ 기본 텍스트 워터마크 예제&lt;/h2&gt;
&lt;p data-end=&quot;1218&quot; data-start=&quot;1173&quot; data-ke-size=&quot;size16&quot;&gt;아래는 다양한 워터마크 삽입 예시를 샘플 코드와 함께 소개해드립니다&lt;/p&gt;
&lt;p data-end=&quot;1218&quot; data-start=&quot;1173&quot; data-ke-size=&quot;size16&quot;&gt;PDF 전체 페이지에 &quot;CONFIDENTIAL&quot;이라는 텍스트 워터마크를 삽입하는 경우:&lt;/p&gt;
&lt;div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0px; padding: 0px; border: none; background-color: #fafafa; border-radius: 4px; height: 604px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr style=&quot;height: 604px;&quot;&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5; height: 604px;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0px; text-align: left; height: 604px;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;add_text_watermark(input_pdf,&amp;nbsp;output_pdf,&amp;nbsp;watermark_text):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Get&amp;nbsp;page&amp;nbsp;dimensions&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.rect&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Calculate&amp;nbsp;center&amp;nbsp;position&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page_rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;y&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page_rect.height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;text&amp;nbsp;watermark&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(x,&amp;nbsp;y),&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Position&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;watermark_text,&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;50&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;),&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Light&amp;nbsp;gray&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rotate&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;90&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Vertical&amp;nbsp;orientation&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;watermarked&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;add_text_watermark(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;test.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;CONFIDENTIAL&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0px 2px 4px 0px; height: 604px;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이 기본 함수는 PDF 문서 열기, 페이지 순회, 위치 계산, 그리고 사용자 지정 형식으로 텍스트 삽입하기와 같은 핵심 개념을 포함하고 있습니다.&lt;/p&gt;
&lt;hr data-end=&quot;1787&quot; data-start=&quot;1784&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;1832&quot; data-start=&quot;1789&quot; data-ke-size=&quot;size26&quot;&gt;  고급 텍스트 워터마크: 다중 텍스트, 타임스탬프, 페이지 번호 포함&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;보다&amp;nbsp;고급&amp;nbsp;텍스트&amp;nbsp;워터마크를&amp;nbsp;만들기&amp;nbsp;위해,&lt;br /&gt;폰트를&amp;nbsp;커스터마이징하고,&amp;nbsp;여러&amp;nbsp;줄&amp;nbsp;워터마크를&amp;nbsp;생성하거나,&amp;nbsp;동적인&amp;nbsp;콘텐츠를&amp;nbsp;추가할&amp;nbsp;수&amp;nbsp;있습니다.&lt;/p&gt;
&lt;div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;from&lt;/span&gt;&amp;nbsp;datetime&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;datetime&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;advanced_text_watermark(input_pdf,&amp;nbsp;output_pdf):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Get&amp;nbsp;current&amp;nbsp;timestamp&amp;nbsp;for&amp;nbsp;dynamic&amp;nbsp;watermark&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timestamp&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;datetime.now().strftime(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;%Y-%m-%d&amp;nbsp;%H:%M&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.rect&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Main&amp;nbsp;watermark&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;main_text&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;CONFIDENTIAL&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(page_rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;,&amp;nbsp;page_rect.height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;10&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;main_text,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;8&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;),&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Red&amp;nbsp;color&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rotate&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;90&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;stroke_opacity&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;render_mode&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;outline&amp;nbsp;the&amp;nbsp;font&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontname&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Courier-Bold&quot;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Bold&amp;nbsp;font&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Timestamp&amp;nbsp;watermark&amp;nbsp;in&amp;nbsp;corner&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;span style=&quot;color: #0099cc;&quot;&gt;20&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;30&lt;/span&gt;),&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;top-left&amp;nbsp;corner&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Generated:&amp;nbsp;{timestamp}&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;10&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rotate&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Page&amp;nbsp;number&amp;nbsp;watermark&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(page_rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;30&lt;/span&gt;),&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;top-right&amp;nbsp;corner&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Page&amp;nbsp;{page_num&amp;nbsp;+&amp;nbsp;1}&amp;nbsp;of&amp;nbsp;{doc.page_count}&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;10&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rotate&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;advanced_text_watermark(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;test.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;위 샘플 코드는 &lt;b&gt;각 페이지에 서로 다른 위치, 색상, 내용의 워터마크를 여러 개 삽입하는 방법&lt;/b&gt;을 보여줍니다.&lt;/div&gt;
&lt;/div&gt;
&lt;hr data-end=&quot;2834&quot; data-start=&quot;2831&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;2853&quot; data-start=&quot;2836&quot; data-ke-size=&quot;size26&quot;&gt;  이미지 워터마크 삽입&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;이미지&amp;nbsp;워터마크를&amp;nbsp;추가할&amp;nbsp;때는&amp;nbsp;약간&amp;nbsp;다른&amp;nbsp;방식이&amp;nbsp;필요합니다.&lt;br /&gt;다음은&amp;nbsp;로고나&amp;nbsp;이미지를&amp;nbsp;PDF에&amp;nbsp;삽입하는&amp;nbsp;방법입니다:&lt;/p&gt;
&lt;div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;add_image_watermark(input_pdf,&amp;nbsp;output_pdf,&amp;nbsp;watermark_image):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;create&amp;nbsp;a&amp;nbsp;pixmap&amp;nbsp;from&amp;nbsp;the&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pixmap&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Pixmap(watermark_image)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.rect&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Calculate&amp;nbsp;scaling&amp;nbsp;to&amp;nbsp;fit&amp;nbsp;image&amp;nbsp;appropriately&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;scale_x&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page_rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;*&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;pixmap.width&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;30%&amp;nbsp;of&amp;nbsp;page&amp;nbsp;width&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;scale_y&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page_rect.height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;*&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;pixmap.height&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;30%&amp;nbsp;of&amp;nbsp;page&amp;nbsp;height&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;scale&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;min(scale_x,&amp;nbsp;scale_y)&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Maintain&amp;nbsp;aspect&amp;nbsp;ratio&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Calculate&amp;nbsp;position&amp;nbsp;(center&amp;nbsp;of&amp;nbsp;page)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;img_width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pixmap.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;*&lt;/span&gt;&amp;nbsp;scale&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;img_height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pixmap.height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;*&lt;/span&gt;&amp;nbsp;scale&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(page_rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;img_width)&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;y&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(page_rect.height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;img_height)&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Define&amp;nbsp;the&amp;nbsp;rectangle&amp;nbsp;where&amp;nbsp;image&amp;nbsp;will&amp;nbsp;be&amp;nbsp;placed&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;target_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Rect(x,&amp;nbsp;y,&amp;nbsp;x&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;img_width,&amp;nbsp;y&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;img_height)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;the&amp;nbsp;pixmap&amp;nbsp;image&amp;nbsp;at&amp;nbsp;the&amp;nbsp;back&amp;nbsp;of&amp;nbsp;the&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_image(target_rect,&amp;nbsp;pixmap&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;pixmap,&amp;nbsp;overlay&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;add_image_watermark(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;test.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;logo_watermarked.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;logo.png&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-end=&quot;3602&quot; data-start=&quot;3534&quot; data-ke-size=&quot;size16&quot;&gt;  &lt;b&gt;참고&lt;/b&gt;:워터마크 이미지에 &lt;b&gt;투명도를 적용하고 싶다면&lt;/b&gt;,&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;161&quot; data-start=&quot;76&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;116&quot; data-start=&quot;76&quot;&gt;&lt;b&gt;Pillow 라이브러리&lt;/b&gt;를 사용해 이미지를 사전 처리하거나,&lt;/li&gt;
&lt;li data-end=&quot;161&quot; data-start=&quot;117&quot;&gt;**PNG 이미지 자체에 투명도(알파 채널)**를 포함시키는 것이 좋습니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;264&quot; data-start=&quot;163&quot; data-ke-size=&quot;size16&quot;&gt;또한, 워터마크를 insert_image로 삽입할 때&lt;br /&gt;&amp;rarr; overlay=False 옵션을 설정하면,&lt;br /&gt;이미지가 &lt;b&gt;페이지의 다른 모든 내용 뒤쪽(배경)에 삽입&lt;/b&gt;됩니다.&lt;/p&gt;
&lt;hr data-end=&quot;3607&quot; data-start=&quot;3604&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;3630&quot; data-start=&quot;3609&quot; data-ke-size=&quot;size26&quot;&gt;  위치 전략 및 레이아웃 정리&lt;/h2&gt;
&lt;p data-end=&quot;3669&quot; data-start=&quot;3632&quot; data-ke-size=&quot;size16&quot;&gt;중앙, 모서리 등 다양한 위치 전략을 함수형으로 구성해 삽입 가능:&lt;/p&gt;
&lt;div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;position_watermarks(input_pdf,&amp;nbsp;output_pdf):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;positions&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'center'&lt;/span&gt;:&amp;nbsp;lambda&amp;nbsp;rect:&amp;nbsp;(rect.width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;,&amp;nbsp;rect.height&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'bottom_left'&lt;/span&gt;:&amp;nbsp;lambda&amp;nbsp;rect:&amp;nbsp;(&lt;span style=&quot;color: #0099cc;&quot;&gt;50&lt;/span&gt;,&amp;nbsp;rect.height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;50&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'bottom_right'&lt;/span&gt;:&amp;nbsp;lambda&amp;nbsp;rect:&amp;nbsp;(rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;150&lt;/span&gt;,&amp;nbsp;rect.height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;50&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'top_left'&lt;/span&gt;:&amp;nbsp;lambda&amp;nbsp;rect:&amp;nbsp;(&lt;span style=&quot;color: #0099cc;&quot;&gt;50&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;50&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;'top_right'&lt;/span&gt;:&amp;nbsp;lambda&amp;nbsp;rect:&amp;nbsp;(rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;150&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;50&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.rect&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Add&amp;nbsp;large&amp;nbsp;watermark&amp;nbsp;at&amp;nbsp;center&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;center_pos&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;positions[&lt;span style=&quot;color: #63a35c;&quot;&gt;'center'&lt;/span&gt;](page_rect)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;center_pos,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;DRAFT&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;60&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;9&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rotate&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Add&amp;nbsp;small&amp;nbsp;copyright&amp;nbsp;notice&amp;nbsp;in&amp;nbsp;bottom&amp;nbsp;right&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;br_pos&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;positions[&lt;span style=&quot;color: #63a35c;&quot;&gt;'bottom_right'&lt;/span&gt;](page_rect)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;br_pos,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&amp;copy;&amp;nbsp;2025&amp;nbsp;Your&amp;nbsp;Company&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;12&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;4&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;4&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;4&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rotate&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;position_watermarks(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;test.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;hr data-end=&quot;3824&quot; data-start=&quot;3821&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;3855&quot; data-start=&quot;3826&quot; data-ke-size=&quot;size26&quot;&gt;  스타일링 예시: 반투명 배경 + 장식 요소&lt;/h2&gt;
&lt;div&gt;
&lt;div&gt;&lt;b&gt;만약 상업적인 목적으로 워터마크를 만든다면, 시각적 요소에 세심한 주의가 필요합니다.&lt;/b&gt;&lt;br /&gt;아래는 &lt;b&gt;은은한 워터마크&lt;/b&gt;를 만드는 방법입니다:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;styled_watermark(input_pdf,&amp;nbsp;output_pdf,&amp;nbsp;watermark_text):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.rect&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Semi-transparent&amp;nbsp;background&amp;nbsp;rectangle&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bg_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Rect(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect.width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;120&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect.height&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;30&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect.width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;120&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect.height&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;30&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Add&amp;nbsp;background&amp;nbsp;with&amp;nbsp;border&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.draw_rect(bg_rect,&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;9&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;9&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;9&lt;/span&gt;),&amp;nbsp;fill&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;95&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;95&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;95&lt;/span&gt;),&amp;nbsp;width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Add&amp;nbsp;main&amp;nbsp;watermark&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(page_rect.width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;80&lt;/span&gt;,&amp;nbsp;page_rect.height&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;watermark_text,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;16&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;6&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;6&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;6&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Add&amp;nbsp;decorative&amp;nbsp;elements&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.draw_line(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pymupdf.Point(page_rect.width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;,&amp;nbsp;page_rect.height&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;15&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pymupdf.Point(page_rect.width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;,&amp;nbsp;page_rect.height&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;15&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.draw_line(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pymupdf.Point(page_rect.width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;,&amp;nbsp;page_rect.height&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;15&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pymupdf.Point(page_rect.width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;,&amp;nbsp;page_rect.height&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;15&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;styled_watermark(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;test.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;SAMPLE&amp;nbsp;DOCUMENT&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;hr data-end=&quot;4028&quot; data-start=&quot;4025&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;4050&quot; data-start=&quot;4030&quot; data-ke-size=&quot;size26&quot;&gt;  회전 텍스트 워터마크 삽입&lt;/h2&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;많은 워터마크는 아래와 같이 &lt;b&gt;문서 전체 페이지에 걸쳐 큰 텍스트를 대각선으로 삽입&lt;/b&gt;하는 방식으로 사용됩니다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;8e0aeea0cf9ca6808c6590ae94e984f479dfa4f0-1656x1840 (1).webp&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;1200&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cY3RWt/btsPIvWGR0m/yhB2Xoj5yW6MzqiWpkKykK/img.webp&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cY3RWt/btsPIvWGR0m/yhB2Xoj5yW6MzqiWpkKykK/img.webp&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cY3RWt/btsPIvWGR0m/yhB2Xoj5yW6MzqiWpkKykK/img.webp&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcY3RWt%2FbtsPIvWGR0m%2FyhB2Xoj5yW6MzqiWpkKykK%2Fimg.webp&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;1200&quot; data-filename=&quot;8e0aeea0cf9ca6808c6590ae94e984f479dfa4f0-1656x1840 (1).webp&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;1200&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;p data-end=&quot;76&quot; data-start=&quot;34&quot; data-ke-size=&quot;size16&quot;&gt;그렇다면 &lt;b&gt;PyMuPDF Pro에서 텍스트 회전을 어떻게 적용할 수 있을까요?&lt;/b&gt;&lt;/p&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;159&quot; data-start=&quot;78&quot; data-ke-size=&quot;size16&quot;&gt;기본적으로, 지정된 행렬(matrix)을 사용해 텍스트를 변형(morph)해야 하며,&lt;br /&gt;이를 위해 &lt;b&gt;간단한 수학 계산이 필요합니다.&lt;/b&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;61&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;math&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;add_rotated_text_watermark(input_pdf,&amp;nbsp;output_pdf,&amp;nbsp;watermark_text):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;choose&amp;nbsp;desired&amp;nbsp;font&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;font&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Font(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;tiro&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_font(fontname&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;myfont&quot;&lt;/span&gt;,&amp;nbsp;fontbuffer&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;font.buffer)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;font_size&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;choose&amp;nbsp;2&amp;nbsp;points&amp;nbsp;to&amp;nbsp;define&amp;nbsp;a&amp;nbsp;line&amp;nbsp;along&amp;nbsp;which&amp;nbsp;to&amp;nbsp;insert&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p1&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Point(&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;750&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p2&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Point(&lt;span style=&quot;color: #0099cc;&quot;&gt;500&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;100&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;compute&amp;nbsp;angle&amp;nbsp;of&amp;nbsp;line&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cos,&amp;nbsp;sin&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;(p2&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;p1).unit&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theta&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;math.degrees(math.atan2(sin,&amp;nbsp;cos))&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;define&amp;nbsp;matrix&amp;nbsp;to&amp;nbsp;rotate&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mat&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Matrix(&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;theta)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;we&amp;nbsp;want&amp;nbsp;to&amp;nbsp;insert&amp;nbsp;this&amp;nbsp;text&amp;nbsp;along&amp;nbsp;the&amp;nbsp;line&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;watermark_text&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#f&quot;This&amp;nbsp;text&amp;nbsp;inserted&amp;nbsp;at&amp;nbsp;{round(-theta,1)}&amp;deg;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Optional:&amp;nbsp;Shrink&amp;nbsp;/&amp;nbsp;stretch&amp;nbsp;text&amp;nbsp;to&amp;nbsp;fit&amp;nbsp;along&amp;nbsp;the&amp;nbsp;line&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;---------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;length&amp;nbsp;of&amp;nbsp;line&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;line_len&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;abs(p2&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;p1)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text_len&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;font.text_length(text,&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;font_size)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;scale&amp;nbsp;factor&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;scale&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;line_len&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;text_len&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;scale&amp;nbsp;matrix&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;scale_mat&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Matrix(scale,&amp;nbsp;scale)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;mat&amp;nbsp;*=&amp;nbsp;scale_mat&amp;nbsp;&amp;nbsp;#&amp;nbsp;(un-)comment&amp;nbsp;to&amp;nbsp;see&amp;nbsp;its&amp;nbsp;effect&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;---------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p1,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;text,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;font_size,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontname&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;myfont&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fill_opacity&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;3&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;stroke_opacity&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;3&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fill&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;border_width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;02&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;render_mode&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;morph&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(p1,&amp;nbsp;mat),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#page.draw_line(p1,&amp;nbsp;p2,&amp;nbsp;color=(1,&amp;nbsp;0,&amp;nbsp;0))&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;watermarked&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;add_rotated_text_watermark(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;sample.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;CONFIDENTIAL&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr data-end=&quot;4206&quot; data-start=&quot;4203&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;4234&quot; data-start=&quot;4208&quot; data-ke-size=&quot;size26&quot;&gt;  여러 PDF 파일 일괄 워터마킹 처리&lt;/h2&gt;
&lt;div&gt;
&lt;div&gt;여러 파일에 워터마크를 삽입해야 할 경우,&lt;br /&gt;일괄 처리(batch processing)를 사용하면 &lt;b&gt;시간을 절약하고 작업의 일관성&lt;/b&gt;을 유지할 수 있습니다.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;batch_watermark_directory(input_dir,&amp;nbsp;output_dir,&amp;nbsp;watermark_text):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Create&amp;nbsp;output&amp;nbsp;directory&amp;nbsp;if&amp;nbsp;it&amp;nbsp;doesn't&amp;nbsp;exist&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;os.makedirs(output_dir,&amp;nbsp;exist_ok&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Process&amp;nbsp;all&amp;nbsp;PDF&amp;nbsp;files&amp;nbsp;in&amp;nbsp;the&amp;nbsp;input&amp;nbsp;directory&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pdf_files&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;[f&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;f&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;os.listdir(input_dir)&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;f.lower().endswith(&lt;span style=&quot;color: #63a35c;&quot;&gt;'.pdf'&lt;/span&gt;)]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;i,&amp;nbsp;filename&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enumerate(pdf_files,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;1&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;input_path&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.join(input_dir,&amp;nbsp;filename)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_filename&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;watermarked_{filename}&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output_path&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;os.path.join(output_dir,&amp;nbsp;output_filename)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Processing&amp;nbsp;{i}/{len(pdf_files)}:&amp;nbsp;{filename}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.rect&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Add&amp;nbsp;watermark&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(page_rect.width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;,&amp;nbsp;page_rect.height&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;watermark_text,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;40&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;8&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;8&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;8&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;✓&amp;nbsp;Successfully&amp;nbsp;processed:&amp;nbsp;{filename}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;e:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;✗&amp;nbsp;Error&amp;nbsp;processing&amp;nbsp;{filename}:&amp;nbsp;{str(e)}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Usage&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;batch_watermark_directory(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;./input_pdfs&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;./watermarked_pdfs&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;CONFIDENTIAL&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr data-end=&quot;4422&quot; data-start=&quot;4419&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;4439&quot; data-start=&quot;4424&quot; data-ke-size=&quot;size26&quot;&gt; 오류 처리 및 예외 상황 대응&lt;/h2&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;124&quot; data-start=&quot;53&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;탄탄한 오류 처리&lt;/b&gt;는 워터마킹 작업이 &lt;b&gt;안정적으로 실행되고, 예기치 않은 상황에서도 중단 없이 작동하도록&lt;/b&gt; 도와줍니다.&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;robust_watermarking(input_pdf,&amp;nbsp;output_pdf,&amp;nbsp;watermark_text):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Check&amp;nbsp;if&amp;nbsp;input&amp;nbsp;file&amp;nbsp;exists&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;not&lt;/span&gt;&amp;nbsp;os.path.exists(input_pdf):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;raise&lt;/span&gt;&amp;nbsp;FileNotFoundError(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Input&amp;nbsp;PDF&amp;nbsp;not&amp;nbsp;found:&amp;nbsp;{input_pdf}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;document&amp;nbsp;with&amp;nbsp;error&amp;nbsp;handling&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Check&amp;nbsp;if&amp;nbsp;document&amp;nbsp;is&amp;nbsp;encrypted&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;doc.needs_pass:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Warning:&amp;nbsp;{input_pdf}&amp;nbsp;is&amp;nbsp;password&amp;nbsp;protected.&amp;nbsp;Skipping...&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Check&amp;nbsp;if&amp;nbsp;document&amp;nbsp;has&amp;nbsp;pages&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;doc.page_count&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Warning:&amp;nbsp;{input_pdf}&amp;nbsp;has&amp;nbsp;no&amp;nbsp;pages.&amp;nbsp;Skipping...&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.rect&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Handle&amp;nbsp;pages&amp;nbsp;with&amp;nbsp;zero&amp;nbsp;dimensions&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;page_rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;or&lt;/span&gt;&amp;nbsp;page_rect.height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Warning:&amp;nbsp;Page&amp;nbsp;{page_num&amp;nbsp;+&amp;nbsp;1}&amp;nbsp;has&amp;nbsp;invalid&amp;nbsp;dimensions.&amp;nbsp;Skipping...&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Add&amp;nbsp;watermark&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(page_rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;,&amp;nbsp;page_rect.height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;2&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;watermark_text,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;min(&lt;span style=&quot;color: #0099cc;&quot;&gt;50&lt;/span&gt;,&amp;nbsp;page_rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;10&lt;/span&gt;),&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Adaptive&amp;nbsp;font&amp;nbsp;size&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rotate&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;45&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;page_error:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Error&amp;nbsp;processing&amp;nbsp;page&amp;nbsp;{page_num&amp;nbsp;+&amp;nbsp;1}:&amp;nbsp;{str(page_error)}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;continue&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;with&amp;nbsp;error&amp;nbsp;handling&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;✓&amp;nbsp;Successfully&amp;nbsp;watermarked:&amp;nbsp;{input_pdf}&amp;nbsp;-&amp;gt;&amp;nbsp;{output_pdf}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;&amp;nbsp;Exception&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;e:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;✗&amp;nbsp;Error&amp;nbsp;watermarking&amp;nbsp;{input_pdf}:&amp;nbsp;{str(e)}&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;robust_watermarking(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;test.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;CONFIDENTIAL&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;hr data-end=&quot;4516&quot; data-start=&quot;4513&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;4547&quot; data-start=&quot;4518&quot; data-ke-size=&quot;size26&quot;&gt;  실전 예제: 회사 문서에 브랜드/로고 삽입&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;4584&quot; data-start=&quot;4549&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;4584&quot; data-start=&quot;4549&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;4558&quot; data-start=&quot;4549&quot;&gt;헤더: 회사명&lt;/li&gt;
&lt;li data-end=&quot;4570&quot; data-start=&quot;4559&quot;&gt;푸터: 기밀 문구&lt;/li&gt;
&lt;li data-end=&quot;4584&quot; data-start=&quot;4571&quot;&gt;우상단: 로고 이미지&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;os&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;def&lt;/span&gt;&amp;nbsp;corporate_branding_watermark(input_pdf,&amp;nbsp;output_pdf,&amp;nbsp;company_name,&amp;nbsp;logo_path&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;None&lt;/span&gt;):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(input_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page_num&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;range&lt;/span&gt;(doc.page_count):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[page_num]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.rect&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Company&amp;nbsp;name&amp;nbsp;in&amp;nbsp;header&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;span style=&quot;color: #0099cc;&quot;&gt;20&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;20&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;company_name,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;12&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;3&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;3&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;7&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontname&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;helvetica-bold&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Confidentiality&amp;nbsp;notice&amp;nbsp;in&amp;nbsp;footer&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_text(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;span style=&quot;color: #0099cc;&quot;&gt;20&lt;/span&gt;,&amp;nbsp;page_rect.height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;20&lt;/span&gt;),&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;This&amp;nbsp;document&amp;nbsp;contains&amp;nbsp;confidential&amp;nbsp;and&amp;nbsp;proprietary&amp;nbsp;information.&quot;&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fontsize&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;8&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;color&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;(&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;0.&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;5&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Optional&amp;nbsp;logo&amp;nbsp;watermark&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;logo_path&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;and&lt;/span&gt;&amp;nbsp;os.path.exists(logo_path):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;create&amp;nbsp;a&amp;nbsp;pixmap&amp;nbsp;from&amp;nbsp;the&amp;nbsp;image&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pixmap&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Pixmap(logo_path)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;logo_rect&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.Rect(&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;60&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;10&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page_rect.width&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;10&lt;/span&gt;,&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0099cc;&quot;&gt;60&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;page.insert_image(logo_rect,&amp;nbsp;pixmap&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;pixmap,&amp;nbsp;overlay&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;except&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;pass&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Continue&amp;nbsp;without&amp;nbsp;logo&amp;nbsp;if&amp;nbsp;there's&amp;nbsp;an&amp;nbsp;error&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.save(output_pdf)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doc.&lt;span style=&quot;color: #066de2;&quot;&gt;close&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;corporate_branding_watermark(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;test.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;output.pdf&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;Artifex&amp;nbsp;Software&amp;nbsp;Inc.&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;logo.png&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div data-message-model-slug=&quot;gpt-4o&quot; data-message-id=&quot;8d53ba0e-0112-4def-bd9d-1543bd6ed226&quot; data-message-author-role=&quot;assistant&quot;&gt;
&lt;div&gt;
&lt;div&gt;&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;59&quot; data-start=&quot;40&quot; data-ke-size=&quot;size26&quot;&gt;✅ 가장 좋은 실전적용 및 팁&lt;/h2&gt;
&lt;p data-end=&quot;110&quot; data-start=&quot;60&quot; data-ke-size=&quot;size16&quot;&gt;PDF 워터마킹을 구현할 때, &lt;b&gt;최적의 결과를 얻기 위해서는 다음을 참고해주세요&lt;/b&gt;:&lt;/p&gt;
&lt;h3 data-end=&quot;131&quot; data-start=&quot;112&quot; data-ke-size=&quot;size23&quot;&gt;  적절한 투명도 설정&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;233&quot; data-start=&quot;132&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;174&quot; data-start=&quot;132&quot;&gt;워터마크는 &lt;b&gt;눈에 띄면서도 문서 가독성을 해치지 않아야&lt;/b&gt; 합니다.&lt;/li&gt;
&lt;li data-end=&quot;233&quot; data-start=&quot;175&quot;&gt;이미지 워터마크는 &lt;b&gt;투명도 20~30%&lt;/b&gt;, 텍스트 워터마크는 &lt;b&gt;연한 회색 계열&lt;/b&gt;이 적절합니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;254&quot; data-start=&quot;235&quot; data-ke-size=&quot;size23&quot;&gt;  문서 레이아웃 고려&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;341&quot; data-start=&quot;255&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;295&quot; data-start=&quot;255&quot;&gt;워터마크는 &lt;b&gt;중요한 콘텐츠를 가리지 않도록 배치&lt;/b&gt;해야 합니다.&lt;/li&gt;
&lt;li data-end=&quot;341&quot; data-start=&quot;296&quot;&gt;다양한 문서 유형에 대해 &lt;b&gt;위치 테스트&lt;/b&gt;를 통해 일관된 배치를 확인하세요.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;361&quot; data-start=&quot;343&quot; data-ke-size=&quot;size23&quot;&gt;  명확한 파일명 규칙&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;433&quot; data-start=&quot;362&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;401&quot; data-start=&quot;362&quot;&gt;워터마크된 파일은 &lt;b&gt;명확하고 이해하기 쉬운 파일명&lt;/b&gt;을 사용하세요.&lt;/li&gt;
&lt;li data-end=&quot;433&quot; data-start=&quot;402&quot;&gt;타임스탬프나 버전 정보를 추가하면 관리가 편리합니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;449&quot; data-start=&quot;435&quot; data-ke-size=&quot;size23&quot;&gt;  버전 관리&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;519&quot; data-start=&quot;450&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;487&quot; data-start=&quot;450&quot;&gt;&lt;b&gt;원본 파일과 워터마크 처리된 파일을 분리&lt;/b&gt; 보관하세요.&lt;/li&gt;
&lt;li data-end=&quot;519&quot; data-start=&quot;488&quot;&gt;체계적인 폴더 구조를 사용해 관리 효율성을 높이세요.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;533&quot; data-start=&quot;521&quot; data-ke-size=&quot;size23&quot;&gt;  테스트&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;581&quot; data-start=&quot;534&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;581&quot; data-start=&quot;534&quot;&gt;중요한 파일을 대량 처리하기 전, 반드시 &lt;b&gt;샘플 문서로 충분히 테스트&lt;/b&gt;하세요.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;598&quot; data-start=&quot;583&quot; data-ke-size=&quot;size23&quot;&gt;  성능 최적화&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;661&quot; data-start=&quot;599&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;661&quot; data-start=&quot;599&quot;&gt;대량 처리 시에는 &lt;b&gt;작은 단위로 나눠 처리&lt;/b&gt;하고, &lt;b&gt;진행 상황을 추적&lt;/b&gt;할 수 있는 로직을 고려하세요.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-end=&quot;674&quot; data-start=&quot;663&quot; data-ke-size=&quot;size23&quot;&gt;  보안&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;768&quot; data-start=&quot;675&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;716&quot; data-start=&quot;675&quot;&gt;사용자가 워터마크를 제거할 수 있으니 필요한 경우 &lt;b&gt;추가 보안 조치&lt;/b&gt;(예: 암호화, 디지털 서명)를 함께 고려하세요.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h2 data-end=&quot;782&quot; data-start=&quot;775&quot; data-ke-size=&quot;size26&quot;&gt;✅ 결론&lt;/h2&gt;
&lt;p data-end=&quot;944&quot; data-start=&quot;784&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;PyMuPDF Pro는 간단한 텍스트 삽입부터 복잡한 다중 요소 브랜드 워터마킹까지 확장 가능한 강력하고 유연한 기반&lt;/b&gt;을 제공합니다. 라이브러리의 &lt;b&gt;빠른 처리 속도&lt;/b&gt;와 &lt;b&gt;광범위한 사용자 정의 옵션&lt;/b&gt; 덕분에, &lt;b&gt;단일 파일 작업&lt;/b&gt;은 물론 &lt;b&gt;대규모 일괄 처리&lt;/b&gt;에도 적합합니다.&lt;/p&gt;
&lt;p data-end=&quot;990&quot; data-start=&quot;946&quot; data-ke-size=&quot;size16&quot;&gt;이 가이드를 통해 배운 기술들은 다음과 같은 다양한 활용에 적용할 수 있습니다:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1036&quot; data-start=&quot;992&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1004&quot; data-start=&quot;992&quot;&gt;기업 문서 보호&lt;/li&gt;
&lt;li data-end=&quot;1022&quot; data-start=&quot;1005&quot;&gt;학술 논문 초안 워터마킹&lt;/li&gt;
&lt;li data-end=&quot;1036&quot; data-start=&quot;1023&quot;&gt;브랜드 로고 삽입 등&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1129&quot; data-start=&quot;1038&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;텍스트와 이미지 워터마크의 조합&lt;/b&gt;, 여기에 &lt;b&gt;오류 처리 및 최적화 기법&lt;/b&gt;을 더하면,&lt;br /&gt;&lt;b&gt;신뢰성 있고 효율적인 워터마킹 시스템&lt;/b&gt;을 구축할 수 있습니다.&lt;/p&gt;
&lt;h3 data-end=&quot;1149&quot; data-start=&quot;1136&quot; data-ke-size=&quot;size23&quot;&gt;  핵심 포인트&lt;/h3&gt;
&lt;p data-end=&quot;1247&quot; data-start=&quot;1151&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;효과적인 워터마킹은 가시성과 사용성을 균형 있게 조절해야 합니다.&lt;/b&gt;&lt;br /&gt;&amp;rarr; 문서를 &lt;b&gt;보호하고 브랜드를 강조&lt;/b&gt;하되, &lt;b&gt;전문적인 외관과 가독성&lt;/b&gt;은 유지해야 합니다.&lt;/p&gt;
&lt;h2 data-end=&quot;1410&quot; data-start=&quot;1400&quot; data-ke-size=&quot;size26&quot;&gt;  시작하기&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1474&quot; data-start=&quot;1412&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1441&quot; data-start=&quot;1412&quot;&gt;이 가이드의 &lt;b&gt;기본 예제&lt;/b&gt;부터 적용해보고,&lt;/li&gt;
&lt;li data-end=&quot;1474&quot; data-start=&quot;1442&quot;&gt;필요에 따라 점진적으로 &lt;b&gt;고급 기능&lt;/b&gt;을 활용하세요.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1565&quot; data-start=&quot;1476&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;PyMuPDF Pro의 강력한 API&lt;/b&gt;와 이 가이드의 패턴을 활용하면,&lt;br /&gt;여러분의 필요에 맞춘 &lt;b&gt;정교한 PDF 워터마킹 솔루션&lt;/b&gt;을 직접 구현할 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;1565&quot; data-start=&quot;1476&quot; data-ke-size=&quot;size16&quot;&gt;도움이 되셨다면 다음 시리즈도 기대해주세요 :)&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>pdf보안</category>
      <category>PDF워터마크</category>
      <category>pdf추출</category>
      <category>PDF파이썬라이브러리</category>
      <category>PyMuPDFPro</category>
      <category>워터마크</category>
      <category>워터마킹</category>
      <category>파이썬라이브러리</category>
      <category>파이썬워터마크</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/427</guid>
      <comments>https://epapyrus.tistory.com/427#entry427comment</comments>
      <pubDate>Wed, 6 Aug 2025 10:56:00 +0900</pubDate>
    </item>
    <item>
      <title>'PyMuPDF Pro'로 PDF 문서에서 표 추출하기: 샘플 코드 포함</title>
      <link>https://epapyrus.tistory.com/426</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;Extracting Tables from PDFs.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/5jxRj/btsPDYrhioi/KMsxOOfAOtAGlOoesP8q6K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/5jxRj/btsPDYrhioi/KMsxOOfAOtAGlOoesP8q6K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/5jxRj/btsPDYrhioi/KMsxOOfAOtAGlOoesP8q6K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F5jxRj%2FbtsPDYrhioi%2FKMsxOOfAOtAGlOoesP8q6K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;Extracting Tables from PDFs.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-end=&quot;120&quot; data-start=&quot;79&quot; data-ke-size=&quot;size26&quot;&gt;  PyMuPDF Pro를 활용한 PDF 표 추출: 실무 중심 활용 가이드&lt;/h2&gt;
&lt;p data-end=&quot;437&quot; data-start=&quot;122&quot; data-ke-size=&quot;size16&quot;&gt;오늘은 &lt;b&gt;PyMuPDF Pro를 이용해 PDF 문서에서 표를 추출하는 과정&lt;/b&gt;을 살펴보고, 이를 다양한 실무 환경에서 어떻게 활용할 수 있는지에 대해 설명합니다.&lt;br /&gt;많은 PDF 문서(특히 스프레드시트나 데이터 내보내기 결과물에서 생성된 문서)는 **구조화된 표(table)**를 포함하고 있으며, 이를 &lt;b&gt;가공 가능한 형식으로 변환&lt;/b&gt;하는 것이 중요합니다.&lt;br /&gt;이 글에서는 표 추출의 중요성과 대표적인 활용 사례, 그리고 PyMuPDF Pro의 향상된 기능(예: Markdown 변환, pandas DataFrame 내보내기 등)이 이 과정을 어떻게 지원하는지를 설명합니다.&lt;/p&gt;
&lt;hr data-end=&quot;442&quot; data-start=&quot;439&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;462&quot; data-start=&quot;444&quot; data-ke-size=&quot;size23&quot;&gt;✅ 표 추출이 중요한 이유&lt;/h3&gt;
&lt;p data-end=&quot;621&quot; data-start=&quot;464&quot; data-ke-size=&quot;size16&quot;&gt;금융, 학계, 기업 환경 등에서 접하게 되는 많은 문서들은 스프레드시트나 시스템에서 &lt;b&gt;데이터를 내보내 생성된 PDF&lt;/b&gt;인 경우가 많습니다. 이 문서들은 표 형식을 포함하고 있지만, PDF 자체는 &lt;b&gt;고정된 레이아웃 출력용 포맷&lt;/b&gt;이기 때문에 &lt;b&gt;표 구조를 유지하지는 않습니다.&lt;/b&gt;&lt;/p&gt;
&lt;p data-end=&quot;667&quot; data-start=&quot;623&quot; data-ke-size=&quot;size16&quot;&gt;따라서 표 데이터를 &lt;b&gt;정확하게 추출하여 구조화된 형식으로 변환&lt;/b&gt;하는 것은&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;703&quot; data-start=&quot;668&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;678&quot; data-start=&quot;668&quot;&gt;자동화 처리&lt;/li&gt;
&lt;li data-end=&quot;703&quot; data-start=&quot;679&quot;&gt;세부 분석&lt;br /&gt;등의 업무에 필수적입니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr data-end=&quot;708&quot; data-start=&quot;705&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;727&quot; data-start=&quot;710&quot; data-ke-size=&quot;size23&quot;&gt;  대표적인 활용 사례&lt;/h3&gt;
&lt;p data-end=&quot;745&quot; data-start=&quot;729&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;1. 인보이스 처리&lt;/b&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;790&quot; data-start=&quot;746&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;790&quot; data-start=&quot;746&quot;&gt;청구서 또는 영수증에 포함된 항목별 정보를 자동 추출하여 재무 기록을 효율화&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;810&quot; data-start=&quot;792&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;2. 연구 데이터 추출&lt;/b&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;841&quot; data-start=&quot;811&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;841&quot; data-start=&quot;811&quot;&gt;논문 속 표 데이터를 추출하여 수작업 입력을 최소화&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;861&quot; data-start=&quot;843&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;3. 컴플라이언스 감사&lt;/b&gt;&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;903&quot; data-start=&quot;862&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;903&quot; data-start=&quot;862&quot;&gt;보고서에서 구조화된 데이터를 신속히 추출하여 규제 요건 준수 여부 검토&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;969&quot; data-start=&quot;905&quot; data-ke-size=&quot;size16&quot;&gt;이처럼, PDF의 정적인 내용을 &lt;b&gt;동적인 구조화 데이터&lt;/b&gt;로 전환하면 &lt;b&gt;업무 효율성이 획기적으로 향상&lt;/b&gt;됩니다.&lt;/p&gt;
&lt;hr data-end=&quot;974&quot; data-start=&quot;971&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;999&quot; data-start=&quot;976&quot; data-ke-size=&quot;size23&quot;&gt;  PyMuPDF Pro의 표 추출 기능&lt;/h3&gt;
&lt;p data-end=&quot;1120&quot; data-start=&quot;1001&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro는 PDF의 각 페이지(Page 객체)에 대해 find_tables()라는 강력한 메서드를 제공합니다.&lt;br /&gt;이 기능은 복잡한 PDF 구조 속에서도 표를 탐지하고 추출하는 작업을 &lt;b&gt;단순화&lt;/b&gt;합니다.&lt;/p&gt;
&lt;h4 data-end=&quot;1133&quot; data-start=&quot;1122&quot; data-ke-size=&quot;size20&quot;&gt;주요 기능:&lt;/h4&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-end=&quot;1688&quot; data-start=&quot;1135&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li data-end=&quot;1239&quot; data-start=&quot;1135&quot;&gt;&lt;b&gt;Markdown 변환&lt;/b&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1239&quot; data-start=&quot;1159&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1193&quot; data-start=&quot;1159&quot;&gt;탐지된 표를 Markdown 형식의 텍스트로 변환 가능&lt;/li&gt;
&lt;li data-end=&quot;1239&quot; data-start=&quot;1197&quot;&gt;특히 **LLM(GPT 등)**과의 연동 시 자동화된 후속 처리에 유용함&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1433&quot; data-start=&quot;1241&quot;&gt;&lt;b&gt;pandas DataFrame 내보내기&lt;/b&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1433&quot; data-start=&quot;1275&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1338&quot; data-start=&quot;1275&quot;&gt;find_tables() 메서드를 통해 &lt;b&gt;pandas의 DataFrame 형식으로 직접 추출 가능&lt;/b&gt;&lt;/li&gt;
&lt;li data-end=&quot;1385&quot; data-start=&quot;1342&quot;&gt;이후 Excel, JSON, CSV 등 다양한 포맷으로 쉽게 변환 가능&lt;/li&gt;
&lt;li data-end=&quot;1433&quot; data-start=&quot;1389&quot;&gt;Pandas의 데이터 처리 기능과 연계하여 정제 및 분석을 손쉽게 수행 가능&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1576&quot; data-start=&quot;1435&quot;&gt;&lt;b&gt;Python 리스트 형태로 추출&lt;/b&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1576&quot; data-start=&quot;1465&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1511&quot; data-start=&quot;1465&quot;&gt;각 표를 &lt;b&gt;리스트의 리스트(list of lists)&lt;/b&gt; 형태로 추출 가능&lt;/li&gt;
&lt;li data-end=&quot;1576&quot; data-start=&quot;1515&quot;&gt;각 셀의 텍스트와 위치 정보(Bounding Box)를 함께 제공 &amp;rarr; 시각화 또는 위치 기반 후처리에 유리&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li data-end=&quot;1688&quot; data-start=&quot;1578&quot;&gt;&lt;b&gt;헤더 자동 인식 기능&lt;/b&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1688&quot; data-start=&quot;1602&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1643&quot; data-start=&quot;1602&quot;&gt;표의 **열 제목(헤더)**을 자동으로 탐지하여, 데이터 행과 구분&lt;/li&gt;
&lt;li data-end=&quot;1688&quot; data-start=&quot;1647&quot;&gt;Markdown 또는 pandas 변환 시 헤더 정보가 명확하게 반영됨&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr data-end=&quot;1693&quot; data-start=&quot;1690&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h3 data-end=&quot;1707&quot; data-start=&quot;1695&quot; data-ke-size=&quot;size23&quot;&gt;  샘플 코드&lt;/h3&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;PDF&amp;nbsp;document&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;example.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;doc[&lt;span style=&quot;color: #0099cc;&quot;&gt;0&lt;/span&gt;]&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Process&amp;nbsp;the&amp;nbsp;first&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Detect&amp;nbsp;tables&amp;nbsp;on&amp;nbsp;the&amp;nbsp;page&amp;nbsp;using&amp;nbsp;table&amp;nbsp;finder&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;tables&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.find_tables()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;not&lt;/span&gt;&amp;nbsp;tables.tables:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;No&amp;nbsp;tables&amp;nbsp;found&amp;nbsp;on&amp;nbsp;this&amp;nbsp;page.&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;index,&amp;nbsp;table&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;enumerate(tables):&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;\nTable&amp;nbsp;{index+1}&amp;nbsp;found:&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Convert&amp;nbsp;the&amp;nbsp;table&amp;nbsp;to&amp;nbsp;Markdown&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;md_table&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;table.to_markdown()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;\nMarkdown&amp;nbsp;representation:&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(md_table)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Convert&amp;nbsp;the&amp;nbsp;table&amp;nbsp;to&amp;nbsp;a&amp;nbsp;pandas&amp;nbsp;DataFrame&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df_table&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;table.to_pandas()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;\nPandas&amp;nbsp;DataFrame:&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(df_table)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Optional:&amp;nbsp;Export&amp;nbsp;to&amp;nbsp;CSV,&amp;nbsp;JSON,&amp;nbsp;or&amp;nbsp;Excel&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;df_table.to_csv(f&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;table_{index+1}.csv&quot;&lt;/span&gt;,&amp;nbsp;index&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;df_table.to_excel(f&quot;table_{index+1}.xlsx&quot;,&amp;nbsp;index=False)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;df_table.to_json(f&quot;table_{index+1}.json&quot;,&amp;nbsp;orient=&quot;records&quot;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;\nTable&amp;nbsp;extraction&amp;nbsp;complete!&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: right; margin-top: -13px; margin-right: 5px; font-size: 9px; font-style: italic;&quot;&gt;&lt;a style=&quot;color: #e5e5e5text-decoration:none;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;Colored by Color Scripter&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;PyMuPDF Pro의 find_tables()를 이용하여 PDF에서 표를 추출하고, Markdown과 pandas DataFrame으로 변환하는 예시는 다음과 같습니다:&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 data-end=&quot;57&quot; data-start=&quot;46&quot; data-ke-size=&quot;size26&quot;&gt;  예제 설명&lt;/h2&gt;
&lt;p data-end=&quot;244&quot; data-start=&quot;59&quot; data-ke-size=&quot;size16&quot;&gt;이 예제에서는 스크립트가 PDF 파일을 열고, 첫 번째 페이지에서 find_tables 메서드를 사용해 표를 식별한 뒤, &lt;b&gt;각 표를 Markdown 형식과 pandas DataFrame 형식&lt;/b&gt;으로 변환합니다.&lt;br /&gt;이러한 &lt;b&gt;이중 접근 방식&lt;/b&gt;은 &lt;b&gt;빠른 데이터 미리보기&lt;/b&gt;와 &lt;b&gt;후속 데이터 처리&lt;/b&gt; 모두를 가능하게 합니다.&lt;/p&gt;
&lt;hr data-end=&quot;249&quot; data-start=&quot;246&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;258&quot; data-start=&quot;251&quot; data-ke-size=&quot;size26&quot;&gt;✅ 결론&lt;/h2&gt;
&lt;p data-end=&quot;396&quot; data-start=&quot;260&quot; data-ke-size=&quot;size16&quot;&gt;PDF는 본래 고정 레이아웃을 위한 포맷이기 때문에 &lt;b&gt;표를 정확히 추출하는 것이 어렵고 복잡&lt;/b&gt;할 수 있습니다.&lt;br /&gt;하지만 PyMuPDF의 고급 기능인 find_tables 메서드는 이러한 문제를 &lt;b&gt;효율적이고 효과적으로 해결&lt;/b&gt;해줍니다.&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;502&quot; data-start=&quot;398&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;448&quot; data-start=&quot;398&quot;&gt;Markdown으로 변환하면 &lt;b&gt;LLM(대규모 언어 모델)과의 연동에 유리&lt;/b&gt;하고,&lt;/li&gt;
&lt;li data-end=&quot;502&quot; data-start=&quot;449&quot;&gt;pandas DataFrame으로 내보내면 &lt;b&gt;강력한 데이터 분석 및 가공&lt;/b&gt;이 가능합니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;571&quot; data-start=&quot;504&quot; data-ke-size=&quot;size16&quot;&gt;결과적으로, 이 기능은 &lt;b&gt;정적인 PDF 내용을 구조화되고 분석 가능한 데이터로 손쉽게 변환&lt;/b&gt;할 수 있도록 도와줍니다.&lt;/p&gt;
&lt;hr data-end=&quot;576&quot; data-start=&quot;573&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;h2 data-end=&quot;590&quot; data-start=&quot;578&quot; data-ke-size=&quot;size26&quot;&gt;  더 알아보기&lt;/h2&gt;
&lt;p data-end=&quot;635&quot; data-start=&quot;592&quot; data-ke-size=&quot;size16&quot;&gt;PyMuPDF의 향상된 기능에 대해 더 알고 싶다면 아래 문서를 참고해보세요:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;868&quot; data-start=&quot;637&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;690&quot; data-start=&quot;637&quot;&gt;&lt;a href=&quot;https://artifex.com/blog/table-recognition-extraction-from-pdfs-pymupdf-python&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;b&gt;Table Recognition and Extraction With PyMuPDF&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li data-end=&quot;756&quot; data-start=&quot;691&quot;&gt;&lt;a href=&quot;https://artifex.com/blog/solving-common-issues-with-table-detection-and-extraction&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;b&gt;Solving Common Issues With Table Detection and Extraction&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li data-end=&quot;846&quot; data-start=&quot;757&quot;&gt;&lt;b&gt;PyMuPDF 공식 문서&lt;/b&gt;: &lt;a href=&quot;https://pymupdf.readthedocs.io/&quot;&gt;https://pymupdf.readthedocs.io/&lt;/a&gt;&lt;/li&gt;
&lt;li data-end=&quot;868&quot; data-start=&quot;847&quot;&gt;&lt;b&gt;커뮤니티 포럼 및 토론 참여&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>PDF데이터추출</category>
      <category>pdf추출</category>
      <category>PyMuPDFPro</category>
      <category>python</category>
      <category>데이터추출</category>
      <category>문서데이터추출</category>
      <category>텍스트추출</category>
      <category>파이썬</category>
      <category>파이썬라이브러리</category>
      <category>파이썬텍스트추출</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/426</guid>
      <comments>https://epapyrus.tistory.com/426#entry426comment</comments>
      <pubDate>Fri, 1 Aug 2025 15:43:47 +0900</pubDate>
    </item>
    <item>
      <title>'PyMuPDF Pro'를 활용한 PDF 양식 자동 작성 및 flatten 처리 자동화: 코드 샘플 포함</title>
      <link>https://epapyrus.tistory.com/425</link>
      <description>&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-filename=&quot;무피디에프프로_2.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/eiSt82/btsPCjXIO3W/FSMGhREJZMcivCpYVECh8k/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/eiSt82/btsPCjXIO3W/FSMGhREJZMcivCpYVECh8k/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/eiSt82/btsPCjXIO3W/FSMGhREJZMcivCpYVECh8k/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FeiSt82%2FbtsPCjXIO3W%2FFSMGhREJZMcivCpYVECh8k%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;608&quot; data-filename=&quot;무피디에프프로_2.png&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;608&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-end=&quot;67&quot; data-start=&quot;47&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;플래튼(Flatten, 평면화) 왜 중요한가요?&lt;/b&gt;&lt;/h3&gt;
&lt;p data-end=&quot;223&quot; data-start=&quot;69&quot; data-ke-size=&quot;size16&quot;&gt;세금 신고서, 계약서, 인사 서류처럼 각종 &lt;b&gt;양식을 자주 다루는 업무&lt;/b&gt;를 하다 보면, 반복적인 수작업 입력이 얼마나 번거로운지 잘 아실 겁니다.&lt;br /&gt;이런 작업을 자동화하면 &lt;b&gt;시간을 절약할 수 있고, 입력 오류를 줄이며, 문서 전반에 걸쳐 일관성을 유지&lt;/b&gt;할 수 있습니다.&lt;/p&gt;
&lt;p data-end=&quot;415&quot; data-start=&quot;225&quot; data-ke-size=&quot;size16&quot;&gt;하지만 양식을 한 번 작성한 뒤에도 계속 수정 가능하게 두는 것이 과연 바람직할까요?&lt;br /&gt;많은 업무 흐름에서는 &lt;b&gt;실수로 인한 편집을 방지하고, 데이터 무결성을 유지하며, 서명된 문서를 안전하게 보호&lt;/b&gt;하기 위해 &lt;b&gt;양식 필드를 잠그는 작업&lt;/b&gt;이 필요합니다.&lt;br /&gt;이때 사용하는 방식이 바로 **플래튼(Flattening, 평면화)**입니다.&lt;/p&gt;
&lt;p data-end=&quot;601&quot; data-start=&quot;417&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;PyMuPDF Pro&lt;/b&gt;는 PDF 양식을 자동으로 작성하고, 사용 목적에 따라 다양한 방식으로 플래튼 처리를 할 수 있도록 지원합니다.&lt;br /&gt;어떤 방법은 &lt;b&gt;데이터 추출을 위한 메타데이터를 유지&lt;/b&gt;하고, 어떤 방법은 &lt;b&gt;줌 배율에 상관없이 문서의 안정적인 표시&lt;/b&gt;를 보장합니다.&lt;br /&gt;이 글에서는 그 다양한 방식들을 함께 살펴보겠습니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;h3 data-end=&quot;636&quot; data-start=&quot;608&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;왜 PDF 양식 자동화가 필요한가요?&lt;/b&gt;&lt;/h3&gt;
&lt;p data-end=&quot;729&quot; data-start=&quot;638&quot; data-ke-size=&quot;size16&quot;&gt;PDF 양식은 다양한 산업과 분야에서 널리 사용되고 있으며, 자동화를 통해 복잡한 프로세스를 간단하게 만들 수 있습니다.&lt;br /&gt;대표적인 활용 사례는 다음과 같습니다:&lt;/p&gt;
&lt;p data-end=&quot;907&quot; data-start=&quot;731&quot; data-ke-size=&quot;size16&quot;&gt;✅ &lt;b&gt;업무 자동화&lt;/b&gt; &amp;ndash; 정형화된 데이터를 기반으로 대량 문서를 빠르게 채워 넣을 수 있습니다&lt;br /&gt;✅ &lt;b&gt;전자 서명 및 규정 준수&lt;/b&gt; &amp;ndash; 서명 후 문서가 임의로 수정되지 않도록 보호할 수 있습니다&lt;br /&gt;✅ &lt;b&gt;정부 및 세무 양식&lt;/b&gt; &amp;ndash; 표준화된 방식으로 양식을 작성하면서, 필요 시 데이터를 쉽게 내보낼 수 있습니다&lt;/p&gt;
&lt;p data-end=&quot;1012&quot; data-start=&quot;909&quot; data-ke-size=&quot;size16&quot;&gt;양식이 작성된 이후에는 보통 더 이상 사용자가 수정할 필요가 없기 때문에, 다양한 플래튼 기법을 활용해 &lt;b&gt;접근성은 유지하면서도, 데이터는 안정적으로 보존&lt;/b&gt;할 수 있도록 해야 합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 data-end=&quot;1043&quot; data-start=&quot;1019&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;PyMuPDF Pro가 제공하는 기능&lt;/b&gt;&lt;/h3&gt;
&lt;p data-end=&quot;1098&quot; data-start=&quot;1045&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;PyMuPDF Pro&lt;/b&gt;는 PDF 양식을 자동으로 작성하고, 다양한 플래튼 처리 방법을 제공합니다:&lt;/p&gt;
&lt;h4 data-end=&quot;1121&quot; data-start=&quot;1100&quot; data-ke-size=&quot;size20&quot;&gt;✅ 필드를 읽기 전용으로 설정&lt;/h4&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1221&quot; data-start=&quot;1122&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1190&quot; data-start=&quot;1122&quot;&gt;사용자가 편집할 수는 없지만, &lt;b&gt;프로그래밍 방식으로 필드 데이터를 추출&lt;/b&gt;할 수 있습니다 (예: CSV 내보내기)&lt;/li&gt;
&lt;li data-end=&quot;1221&quot; data-start=&quot;1191&quot;&gt;&lt;b&gt;기록 보관이 중요한 업무&lt;/b&gt;에 적합한 방식입니다&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 data-end=&quot;1262&quot; data-start=&quot;1223&quot; data-ke-size=&quot;size20&quot;&gt;✅ bake() 함수로 필드 데이터를 페이지 콘텐츠에 포함&lt;/h4&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1357&quot; data-start=&quot;1263&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1308&quot; data-start=&quot;1263&quot;&gt;양식 필드를 &lt;b&gt;고정된 텍스트로 변환&lt;/b&gt;하면서도 &lt;b&gt;검색은 그대로 가능&lt;/b&gt;&lt;/li&gt;
&lt;li data-end=&quot;1357&quot; data-start=&quot;1309&quot;&gt;&lt;b&gt;확대해도 깨지지 않는 정밀한 표시&lt;/b&gt;와 &lt;b&gt;레이아웃 안정성&lt;/b&gt; 확보에 유리합니다&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 data-end=&quot;1379&quot; data-start=&quot;1359&quot; data-ke-size=&quot;size20&quot;&gt;✅ PDF를 이미지로 렌더링&lt;/h4&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-end=&quot;1449&quot; data-start=&quot;1380&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1412&quot; data-start=&quot;1380&quot;&gt;문서 상호작용을 &lt;b&gt;완전히 차단하고 내용을 고정&lt;/b&gt;&lt;/li&gt;
&lt;li data-end=&quot;1449&quot; data-start=&quot;1413&quot;&gt;❌ 다만 이 경우 &lt;b&gt;텍스트 검색 및 추출이 불가능&lt;/b&gt;해집니다&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1538&quot; data-start=&quot;1451&quot; data-ke-size=&quot;size16&quot;&gt;각 방식은 목적에 따라 선택해야 합니다.&lt;br /&gt;어떤 방식은 &lt;b&gt;데이터 접근성과 보존&lt;/b&gt;에 중점을 두고, 어떤 방식은 &lt;b&gt;문서 안정성과 보안&lt;/b&gt;을 우선시합니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 data-end=&quot;1587&quot; data-start=&quot;1545&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;구현 예시: CSV 파일을 이용한 PDF 작성 및 플래튼 처리&lt;/b&gt;&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;1608&quot; data-start=&quot;1589&quot;&gt;&lt;b&gt;1단계: CSV 파일 준비&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-end=&quot;1663&quot; data-start=&quot;1610&quot; data-ke-size=&quot;size16&quot;&gt;CSV 파일을 사용하면 필드 이름과 값을 구조적으로 관리할 수 있어, 자동화에 매우 유리합니다.&lt;/p&gt;
&lt;p data-end=&quot;1684&quot; data-start=&quot;1665&quot; data-ke-size=&quot;size16&quot;&gt;- 예시 form_data.csv:&lt;/p&gt;
&lt;table style=&quot;border-collapse: collapse; width: 100%;&quot; border=&quot;1&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 100%;&quot;&gt;&lt;br /&gt;field_name,value &lt;br /&gt;Name,John&amp;nbsp;Doe &lt;br /&gt;Date,01/06/2025 &lt;br /&gt;Address,123&amp;nbsp;Elm&amp;nbsp;Street &lt;br /&gt;Consent,Yes &lt;br /&gt;Choice,Option&amp;nbsp;A&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div data-message-model-slug=&quot;gpt-4o&quot; data-message-id=&quot;e272988e-9d7d-426d-829b-272b44b64846&quot; data-message-author-role=&quot;assistant&quot;&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li data-end=&quot;62&quot; data-start=&quot;39&quot;&gt;&lt;b&gt;2단계: PDF 처리 자동화&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;&lt;span&gt;이 스크립트는&amp;nbsp;&lt;/span&gt;모든 페이지를 순차적으로 탐색하며&lt;span&gt;,&amp;nbsp;&lt;/span&gt;CSV 데이터로 양식 필드를 채운 뒤, 적절한 방식으로 **플래튼 처리(평면화)**를 적용합니다.&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;colorscripter-code&quot; style=&quot;color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; position: relative !important; overflow: auto;&quot;&gt;
&lt;table class=&quot;colorscripter-code-table&quot; style=&quot;margin: 0; padding: 0; border: none; background-color: #fafafa; border-radius: 4px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; data-ke-align=&quot;alignLeft&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;padding: 6px; border-right: 2px solid #e5e5e5;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; word-break: normal; text-align: right; color: #666; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;1&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;2&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;3&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;4&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;5&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;6&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;7&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;8&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;9&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;10&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;11&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;12&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;13&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;14&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;15&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;16&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;17&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;18&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;19&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;20&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;21&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;22&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;23&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;24&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;25&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;26&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;27&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;28&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;29&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;30&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;31&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;32&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;33&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;34&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;35&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;36&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;37&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;38&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;39&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;40&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;41&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;42&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;43&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;44&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;45&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;46&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;47&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;48&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;49&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;50&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;51&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;52&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;53&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;54&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;55&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;56&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;57&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;58&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;59&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;60&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;61&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;62&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;63&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;64&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;65&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;66&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;67&lt;/div&gt;
&lt;div style=&quot;line-height: 130%;&quot;&gt;68&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 6px 0; text-align: left;&quot;&gt;
&lt;div style=&quot;margin: 0; padding: 0; color: #010101; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace !important; line-height: 130%;&quot;&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;pymupdf&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;import&lt;/span&gt;&amp;nbsp;csv&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Load&amp;nbsp;the&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;fillable_form.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Read&amp;nbsp;data&amp;nbsp;from&amp;nbsp;CSV&amp;nbsp;into&amp;nbsp;a&amp;nbsp;Python&amp;nbsp;dictionary&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;data&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;{}&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;with&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;form_data.csv&quot;&lt;/span&gt;,&amp;nbsp;newline&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;''&lt;/span&gt;,&amp;nbsp;encoding&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #63a35c;&quot;&gt;'utf-8'&lt;/span&gt;)&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;as&lt;/span&gt;&amp;nbsp;csvfile:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;reader&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;csv.DictReader(csvfile)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;row&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;reader:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data[row[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;field_name&quot;&lt;/span&gt;]]&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;row[&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;value&quot;&lt;/span&gt;]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Iterate&amp;nbsp;over&amp;nbsp;all&amp;nbsp;pages&amp;nbsp;and&amp;nbsp;process&amp;nbsp;fields&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;doc:&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;field&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;page.widgets():&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;field.field_name&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;data:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;value&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;data[field.field_name]&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Handling&amp;nbsp;checkboxes&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;field.field_type&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&amp;nbsp;PDF_WIDGET_TYPE_CHECKBOX:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;value&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;field.on_state():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;field.field_value&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;value&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;field.field_value&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #066de2;&quot;&gt;False&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Handling&amp;nbsp;radio&amp;nbsp;buttons&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;elif&lt;/span&gt;&amp;nbsp;field.field_type&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&amp;nbsp;PDF_WIDGET_TYPE_RADIOBUTTON:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;if&lt;/span&gt;&amp;nbsp;value&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;field.on_state():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;field.field_value&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;value&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Handling&amp;nbsp;other&amp;nbsp;fields&amp;nbsp;types&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;field.field_value&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;value&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Choose&amp;nbsp;the&amp;nbsp;appropriate&amp;nbsp;flattening&amp;nbsp;method:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Option&amp;nbsp;1:&amp;nbsp;Set&amp;nbsp;fields&amp;nbsp;to&amp;nbsp;read-only&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;doc:&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;field&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;page.widgets():&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;field.flags&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&amp;nbsp;PDF_FIELD_IS_READ_ONLY&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Option&amp;nbsp;2:&amp;nbsp;Flatten&amp;nbsp;using&amp;nbsp;bake():&amp;nbsp;convert&amp;nbsp;fields&amp;nbsp;to&amp;nbsp;searchable&amp;nbsp;text&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc.bake()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;the&amp;nbsp;modified&amp;nbsp;PDF&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;doc.save(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;flattened_form.pdf&quot;&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Option&amp;nbsp;3:&amp;nbsp;Flatten&amp;nbsp;by&amp;nbsp;converting&amp;nbsp;all&amp;nbsp;pages&amp;nbsp;to&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Open&amp;nbsp;a&amp;nbsp;new&amp;nbsp;empty&amp;nbsp;PDF&amp;nbsp;to&amp;nbsp;receive&amp;nbsp;the&amp;nbsp;page&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;imaged&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;pymupdf.&lt;span style=&quot;color: #066de2;&quot;&gt;open&lt;/span&gt;()&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Render&amp;nbsp;each&amp;nbsp;page&amp;nbsp;into&amp;nbsp;an&amp;nbsp;image&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;for&lt;/span&gt;&amp;nbsp;page&amp;nbsp;&lt;span style=&quot;color: #a71d5d;&quot;&gt;in&lt;/span&gt;&amp;nbsp;doc:&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;width,&amp;nbsp;height&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.rect.br&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Make&amp;nbsp;output&amp;nbsp;page&amp;nbsp;with&amp;nbsp;same&amp;nbsp;size&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;img_page&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;imaged.new_page(width&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;width,&amp;nbsp;height&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;height)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Render&amp;nbsp;input&amp;nbsp;page&amp;nbsp;with&amp;nbsp;desired&amp;nbsp;resolution&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pix&amp;nbsp;&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&amp;nbsp;page.get_pixmap(dpi&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0099cc;&quot;&gt;300&lt;/span&gt;)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Insert&amp;nbsp;image&amp;nbsp;into&amp;nbsp;output&amp;nbsp;page&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;img_page.insert_image(page.rect,&amp;nbsp;pixmap&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;pix)&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;#&amp;nbsp;Save&amp;nbsp;imaged&amp;nbsp;PDF&amp;nbsp;making&amp;nbsp;sure&amp;nbsp;to&amp;nbsp;compress&amp;nbsp;the&amp;nbsp;images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0 6px; white-space: pre; line-height: 130%;&quot;&gt;imaged.save(&lt;span style=&quot;color: #63a35c;&quot;&gt;&quot;imaged_form.pdf&quot;&lt;/span&gt;,&amp;nbsp;deflate&lt;span style=&quot;color: #0086b3;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #a71d5d;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #066de2;&quot;&gt;True&lt;/span&gt;)&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;vertical-align: bottom; padding: 0 2px 4px 0;&quot;&gt;&lt;a style=&quot;text-decoration: none; color: white;&quot; href=&quot;http://colorscripter.com/info#e&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;font-size: 9px; word-break: normal; background-color: #e5e5e5; color: white; border-radius: 10px; padding: 1px;&quot;&gt;cs&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;154&quot; data-start=&quot;64&quot; data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 data-end=&quot;63&quot; data-start=&quot;40&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;적절한 플래튼 방식 선택하기&lt;/b&gt;&lt;/h3&gt;
&lt;p data-end=&quot;86&quot; data-start=&quot;65&quot; data-ke-size=&quot;size16&quot;&gt;그렇다면 어떤 방식을 선택해야 할까요?&lt;/p&gt;
&lt;p data-end=&quot;169&quot; data-start=&quot;88&quot; data-ke-size=&quot;size16&quot;&gt;✔ &lt;b&gt;나중에 필드 데이터를 추출할 계획이 있다면?&lt;/b&gt;&lt;br /&gt;&amp;rarr; 필드를 **읽기 전용(read-only)**으로 설정해 접근 가능하도록 유지하세요.&lt;/p&gt;
&lt;p data-end=&quot;271&quot; data-start=&quot;171&quot; data-ke-size=&quot;size16&quot;&gt;✔ &lt;b&gt;인터랙티브 요소는 제거하되, 확대해도 레이아웃이 깨지지 않길 원한다면?&lt;/b&gt;&lt;br /&gt;&amp;rarr; bake() 함수를 사용해 필드를 &lt;b&gt;페이지에 삽입하면서 검색 가능&lt;/b&gt;하게 유지하세요.&lt;/p&gt;
&lt;p data-end=&quot;364&quot; data-start=&quot;273&quot; data-ke-size=&quot;size16&quot;&gt;✔ &lt;b&gt;프로그래밍 방식의 수정조차 완전히 막고 싶다면?&lt;/b&gt;&lt;br /&gt;&amp;rarr; 문서를 &lt;b&gt;정적인 이미지로 변환&lt;/b&gt;하세요. 이 경우 &lt;b&gt;검색 및 텍스트 추출도 불가능&lt;/b&gt;해집니다.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style6&quot; /&gt;
&lt;h3 data-end=&quot;381&quot; data-start=&quot;371&quot; data-ke-size=&quot;size23&quot;&gt;&lt;b&gt;결론&lt;/b&gt;&lt;/h3&gt;
&lt;p data-end=&quot;480&quot; data-start=&quot;383&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;PyMuPDF Pro&lt;/b&gt;를 활용하면 PDF 양식 작성과 플래튼 작업을 &lt;b&gt;빠르고 효율적이며 유연하게&lt;/b&gt; 자동화할 수 있습니다.&lt;br /&gt;이 도구를 통해 다음과 같은 작업이 가능합니다:&lt;/p&gt;
&lt;p data-end=&quot;587&quot; data-start=&quot;482&quot; data-ke-size=&quot;size16&quot;&gt;✅ &lt;b&gt;CSV 파일을 이용해 양식을 동적으로 채우기&lt;/b&gt;&lt;br /&gt;✅ &lt;b&gt;접근성, 보안, 정밀도에 맞는 플래튼 방식 선택&lt;/b&gt;&lt;br /&gt;✅ bake()를 활용해 &lt;b&gt;검색 가능성과 문서 안정성 유지&lt;/b&gt;&lt;/p&gt;
&lt;p data-end=&quot;693&quot; data-start=&quot;589&quot; data-ke-size=&quot;size16&quot;&gt;계약서 보안, 세무 문서 처리, 인사 양식 자동화 등 어떤 목적이든,&lt;br /&gt;이 접근 방식은 &lt;b&gt;문서 관리 효율을 높이는 동시에 데이터 접근성과 보존 방식에 대한 제어력을 유지&lt;/b&gt;해 줍니다.&lt;/p&gt;
&lt;hr data-end=&quot;698&quot; data-start=&quot;695&quot; data-ke-style=&quot;style1&quot; /&gt;
&lt;p data-is-only-node=&quot;&quot; data-is-last-node=&quot;&quot; data-end=&quot;758&quot; data-start=&quot;700&quot; data-ke-size=&quot;size16&quot;&gt;&lt;b&gt;직접 해보고 싶으신가요?&lt;/b&gt;&lt;br /&gt;여러분만의 PDF와 CSV 파일을 준비해 바로 자동화를 시작해보세요!&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
      <category>PyMuPDF Pro</category>
      <category>PyMuPDFPro</category>
      <category>python</category>
      <category>Pythonflattern</category>
      <category>pythonlibrary</category>
      <category>파이썬</category>
      <category>파이썬라이브러리</category>
      <category>파이썬평탄화</category>
      <category>파이썬플래튼</category>
      <category>플래튼</category>
      <author>이파피루스</author>
      <guid isPermaLink="true">https://epapyrus.tistory.com/425</guid>
      <comments>https://epapyrus.tistory.com/425#entry425comment</comments>
      <pubDate>Thu, 31 Jul 2025 10:38:15 +0900</pubDate>
    </item>
  </channel>
</rss>