### Install pdf2docx from PyPI Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/installation.md Use this command for a fresh installation of the pdf2docx library. ```default $ pip install pdf2docx ``` -------------------------------- ### Install pdf2docx from Local Source Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/installation.md After cloning or downloading the source code, navigate to the root directory and use this command to install pdf2docx. ```default $ python setup.py install ``` -------------------------------- ### Install pdf2docx from GitHub Source Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/installation.md Install pdf2docx directly from the master branch on GitHub. This may result in a version newer than the latest PyPI release. ```default $ pip install git+git://github.com/ArtifexSoftware/pdf2docx.git@master --upgrade ``` -------------------------------- ### Convert PDF Pages by Start Index Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.cli.md Converts a PDF to DOCX starting from the second page (index 1). If omitted, the start index defaults to the first page. ```bash $ pdf2docx convert test.pdf test.docx --start=1 ``` -------------------------------- ### Install pdf2docx in Develop Mode Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/installation.md Install pdf2docx locally in developing mode, which is useful for making changes to the library. ```default $ python setup.py develop ``` -------------------------------- ### Install Furo Theme Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/README.md Install the Furo theme for Sphinx. This is a prerequisite for building the HTML documentation. ```bash pip install furo ``` -------------------------------- ### Launch pdf2docx GUI Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.gui.md To launch the GUI, use this command in your terminal. Ensure pdf2docx is installed. ```default $ pdf2docx gui ``` -------------------------------- ### Upgrade pdf2docx from PyPI Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/installation.md Run this command to upgrade to the latest version of pdf2docx if it's already installed. ```default $ pip install --upgrade pdf2docx ``` -------------------------------- ### Enable Multi-Processing for PDF to DOCX Conversion Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.convert.md Utilize multi-processing for faster conversion of PDFs with many pages. This feature works with continuous pages specified by 'start' and 'end'. ```python cv.convert(docx_file, multi_processing=True) ``` ```python cv.convert(docx_file, multi_processing=True, cpu_count=4) ``` -------------------------------- ### Convert Specific Page Range by Start and End Index Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.cli.md Converts a PDF to DOCX, specifically targeting pages from the second (index 1) to the third (index 2). ```bash $ pdf2docx convert test.pdf test.docx --start=1 --end=3 ``` -------------------------------- ### Extract Tables from PDF Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.table.md Use the Converter class to open a PDF and extract tables. Specify the start and end page numbers for extraction. Remember to close the converter after use. ```python from pdf2docx import Converter pdf_file = '/path/to/sample.pdf' cv = Converter(pdf_file) tables = cv.extract_tables(start=0, end=1) cv.close() for table in tables: print(table) ``` -------------------------------- ### Convert Specified PDF Page Ranges to DOCX Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.convert.md Convert specific pages or ranges of pages from a PDF to DOCX using the convert() method with 'start', 'end', or 'pages' arguments. ```python # convert from the second page to the end (by default) cv.convert(docx_file, start=1) ``` ```python # convert from the first page (by default) to the third (end=3, excluded) cv.convert(docx_file, end=3) ``` ```python # convert from the second page and the third cv.convert(docx_file, start=1, end=3) ``` ```python # convert the first, third and 5th pages cv.convert(docx_file, pages=[0,2,4]) ``` -------------------------------- ### Build All HTML Documentation Assets Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/README.md Build all HTML documentation, including static assets like CSS, from the Sphinx project. Use this if you have updated static files. ```bash sphinx-build -a -b html . build/html ``` -------------------------------- ### Build HTML Documentation Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/README.md Build the HTML documentation from the Sphinx project located in the 'docs' directory. The output will be in the 'build/html' directory. ```bash sphinx-build -b html . build/html ``` -------------------------------- ### Show Help for pdf2docx CLI Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.cli.md Displays the help message for the pdf2docx command-line tool, outlining available commands and options. ```bash $ pdf2docx --help ``` -------------------------------- ### Enable Multi-Processing for Conversion Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.cli.md Converts a PDF to DOCX using multi-processing with the default number of CPU cores. ```bash $ pdf2docx convert test.pdf test.docx --multi_processing=True ``` -------------------------------- ### pdf2docx.main Module Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/api/pdf2docx.md API documentation for the main module, likely containing the primary conversion entry points. ```APIDOC ## pdf2docx.main Module ### Description This module likely contains the main entry points and core logic for the pdf2docx conversion process. ``` -------------------------------- ### Enable Multi-Processing with Specific CPU Count Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.cli.md Converts a PDF to DOCX using multi-processing and specifies the number of CPU cores to utilize. ```bash $ pdf2docx convert test.pdf test.docx --multi_processing=True --cpu_count=4 ``` -------------------------------- ### Convert PDF Pages with Non-Zero-Based Indexing Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.cli.md Converts a PDF to DOCX using 1-based indexing for page ranges, targeting pages from the first to the third. ```bash $ pdf2docx convert test.pdf test.docx --start=1 --end=3 --zero_based_index=False ``` -------------------------------- ### Convert All Pages of a PDF Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.cli.md Converts all pages from a specified PDF file to a DOCX file using the 'convert' command. ```bash $ pdf2docx convert test.pdf test.docx ``` -------------------------------- ### Convert Encrypted PDF to DOCX Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.convert.md Convert password-protected PDF files by providing the password when initializing the Converter class. ```python cv = Converter(pdf_file, password) cv.convert(docx_file) cv.close() ``` -------------------------------- ### Convert PDF to DOCX using parse() Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.convert.md An alternative method using the parse() function to convert a PDF file to DOCX format. ```python from pdf2docx import parse pdf_file = '/path/to/sample.pdf' docx_file = 'path/to/sample.docx' # convert pdf to docx parse(pdf_file, docx_file) ``` -------------------------------- ### pdf2docx.text Package Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/api/pdf2docx.md API documentation for the text package, including Char, Line, Lines, Spans, TextBlock, and TextSpan modules. ```APIDOC ## pdf2docx.text Package ### Description This package contains modules for handling text elements within PDF documents. ### Submodules - **pdf2docx.text.Char**: Module for representing individual characters. - **pdf2docx.text.Line**: Module for representing a line of text. - **pdf2docx.text.Lines**: Module for managing collections of text lines. - **pdf2docx.text.Spans**: Module for managing collections of text spans. - **pdf2docx.text.TextBlock**: Module for representing a block of text. - **pdf2docx.text.TextSpan**: Module for representing a span of text. ``` -------------------------------- ### pdf2docx.converter Module Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/api/pdf2docx.md API documentation for the converter module. ```APIDOC ## pdf2docx.converter Module ### Description This module provides functionality for converting PDF documents to DOCX format. ``` -------------------------------- ### pdf2docx.table Package Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/api/pdf2docx.md API documentation for the table package, including modules for Border, Cell, Cells, Row, Rows, TableBlock, TableStructure, and TablesConstructor. ```APIDOC ## pdf2docx.table Package ### Description This package provides modules for parsing and reconstructing table structures from PDF documents. ### Submodules - **pdf2docx.table.Border**: Module for defining table borders. - **pdf2docx.table.Cell**: Module for representing individual table cells. - **pdf2docx.table.Cells**: Module for managing collections of cells. - **pdf2docx.table.Row**: Module for representing table rows. - **pdf2docx.table.Rows**: Module for managing collections of rows. - **pdf2docx.table.TableBlock**: Module for representing a block of table content. - **pdf2docx.table.TableStructure**: Module for defining the overall structure of a table. - **pdf2docx.table.TablesConstructor**: Module responsible for constructing tables. ``` -------------------------------- ### Convert All PDF Pages to DOCX Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.convert.md Use the Converter class to convert all pages of a PDF file to a DOCX file. Ensure the Converter is closed after use. ```python from pdf2docx import Converter pdf_file = '/path/to/sample.pdf' docx_file = 'path/to/sample.docx' # convert pdf to docx cv = Converter(pdf_file) cv.convert(docx_file) # all pages by default cv.close() ``` -------------------------------- ### pdf2docx.shape Package Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/api/pdf2docx.md API documentation for the shape package, including Path, Paths, Shape, and Shapes modules. ```APIDOC ## pdf2docx.shape Package ### Description This package contains modules for handling shapes within PDF documents. ### Submodules - **pdf2docx.shape.Path**: Module for representing and manipulating paths. - **pdf2docx.shape.Paths**: Module for managing collections of paths. - **pdf2docx.shape.Shape**: Module for representing general shapes. - **pdf2docx.shape.Shapes**: Module for managing collections of shapes. ``` -------------------------------- ### Convert PDF Pages by End Index Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.cli.md Converts a PDF to DOCX up to the third page (index 2). If omitted, the end index defaults to the last page. ```bash $ pdf2docx convert test.pdf test.docx --end=3 ``` -------------------------------- ### Convert Specific Pages by Number Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/quickstart.cli.md Converts a PDF to DOCX by specifying a comma-separated list of page numbers (0-based index). ```bash $ pdf2docx convert test.pdf test.docx --pages=0,2,4 ``` -------------------------------- ### Uninstall pdf2docx Source: https://github.com/artifexsoftware/pdf2docx/blob/master/docs/installation.md Use this command to remove the pdf2docx library from your system. ```default $ pip uninstall pdf2docx ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.