How to use the refextract.references.pdf.IncompleteCoordinatesError function in refextract

To help you get started, we’ve selected a few refextract examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inspirehep / refextract / refextract / references / View on Github external
def _destination_position(pdf, destination):
    Gives a tuple (page, column, -y, x) representing the position of the

    This representation is useful for sorting named destinations and
    assumes the text has at most 2 columns
    pagewidth = pdf.getPage(
    if not destination.left or not
        raise IncompleteCoordinatesError(destination)
    # assuming max 2 columns
    column = (2 * destination.left) // pagewidth
    return (pdf.getDestinationPageNumber(destination),
            column,, destination.left)