def METHOD_NAME(input: str, errors: str = 'strict') -> tuple[bytes, int]:
    """Convert input string to bytes in PdfDocEncoding."""
    error_marker = b'?' if errors == 'replace' else b'\xad'
    success, pdfdoc = utf8_to_pdf_doc(input, error_marker)
    if success:
        return pdfdoc, len(input)
    if errors == 'ignore':
        pdfdoc = pdfdoc.replace(b'\xad', b'')
        return pdfdoc, len(input)
    if errors == 'replace':
        return pdfdoc, len(input)
    if errors == 'strict':
        if input.startswith('\xfe\xff') or input.startswith('\xff\xfe'):
            raise UnicodeEncodeError(
                'pdfdoc',
                input,
                0,
                2,
                "strings beginning with byte order marks cannot be encoded in pdfdoc",
            )
        # libqpdf doesn't return what character caused the error, and Python
        # needs this, so make an educated guess and raise an exception based
        # on that.
        offending_index = _find_first_index(input, PDFDOC_ENCODABLE)
        raise UnicodeEncodeError(
            'pdfdoc',
            input,
            offending_index,
            offending_index + 1,
            "character cannot be represented in pdfdoc encoding",
        )
    raise LookupError(errors)