Get the keys of PDF dict object at 'xref'. Use -1 for the PDF trailer.
(self, xref)
| 7961 | return (type, text) |
| 7962 | |
| 7963 | def xref_get_keys(self, xref): |
| 7964 | """Get the keys of PDF dict object at 'xref'. Use -1 for the PDF trailer.""" |
| 7965 | pdf = _as_pdf_document(self) |
| 7966 | xreflen = mupdf.pdf_xref_len( pdf) |
| 7967 | if not _INRANGE(xref, 1, xreflen-1) and xref != -1: |
| 7968 | raise ValueError( MSG_BAD_XREF) |
| 7969 | if xref > 0: |
| 7970 | obj = mupdf.pdf_load_object( pdf, xref) |
| 7971 | else: |
| 7972 | obj = mupdf.pdf_trailer( pdf) |
| 7973 | n = mupdf.pdf_dict_len( obj) |
| 7974 | rc = [] |
| 7975 | if n == 0: |
| 7976 | return rc |
| 7977 | for i in range(n): |
| 7978 | key = mupdf.pdf_to_name( mupdf.pdf_dict_get_key( obj, i)) |
| 7979 | rc.append(key) |
| 7980 | return rc |
| 7981 | |
| 7982 | def xref_is_font(self, xref): |
| 7983 | """Check if xref is a font object.""" |