Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sphinx warnings and error #760

Merged
merged 4 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ All notable changes in pdfminer.six will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [20220506]
## [Unreleased]

### Fixed

- Sphinx errors during building of documentation ([#760](https://github.com/pdfminer/pdfminer.six/pull/760))

## [20220524]

### Fixed

Expand Down
11 changes: 7 additions & 4 deletions docs/source/howto/acro_forms.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _acro_forms:

How to extract AcroForm interactive form fields from a PDF using PDFMiner
********************************
*************************************************************************

Before you start, make sure you have :ref:`installed pdfminer.six<install>`.

Expand Down Expand Up @@ -78,14 +78,16 @@ How it works:
doc = PDFDocument(parser)

- Get the catalog
(the catalog contains references to other objects defining the document structure, see section 7.7.2 of PDF 32000-1:2008 specs: https://www.adobe.com/devnet/pdf/pdf_reference.html)

(the catalog contains references to other objects defining the document structure, see section 7.7.2 of PDF 32000-1:2008 specs: https://www.adobe.com/devnet/pdf/pdf_reference.html)

.. code-block:: python

res = resolve1(doc.catalog)

- Check if the catalog contains the AcroForm key and raise ValueError if not
(the PDF does not contain Acroform type of interactive forms if this key is missing in the catalog, see section 12.7.2 of PDF 32000-1:2008 specs)

(the PDF does not contain Acroform type of interactive forms if this key is missing in the catalog, see section 12.7.2 of PDF 32000-1:2008 specs)

.. code-block:: python

Expand Down Expand Up @@ -119,7 +121,8 @@ How it works:
values = resolve1(value)

- Call the value(s) decoding method as needed
(a single field can hold multiple values, for example a combo box can hold more than one value at time)

(a single field can hold multiple values, for example a combo box can hold more than one value at time)

.. code-block:: python

Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/commandline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pdf2txt.py

.. argparse::
:module: tools.pdf2txt
:func: maketheparser
:func: create_parser
:prog: python tools/pdf2txt.py

.. _api_dumppdf:
Expand Down
4 changes: 2 additions & 2 deletions docs/source/reference/highlevel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ extract_text_to_fp
.. autofunction:: extract_text_to_fp


.. _api_extract_pages:

extract_pages
=============

.. currentmodule:: pdfminer.high_level
.. autofunction:: extract_pages

.. _api_extract_pages:
8 changes: 6 additions & 2 deletions tools/pdf2txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def extract_text(
return outfp


def parse_args(args: Optional[List[str]]) -> argparse.Namespace:
def create_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description=__doc__, add_help=True)
parser.add_argument(
"files",
Expand Down Expand Up @@ -272,7 +272,11 @@ def parse_args(args: Optional[List[str]]) -> argparse.Namespace:
"Only used when output_type is xml.",
)

parsed_args = parser.parse_args(args=args)
return parser


def parse_args(args: Optional[List[str]]) -> argparse.Namespace:
parsed_args = create_parser().parse_args(args=args)

# Propagate parsed layout parameters to LAParams object
if parsed_args.no_laparams:
Expand Down