static void showobject(int num, int gen) { fz_error error; fz_obj *obj; if (!xref) die(fz_throw("no file specified")); error = pdf_loadobject(&obj, xref, num, gen); if (error) die(error); if (pdf_isstream(xref, num, gen)) { printf("%d %d obj\n", num, gen); fz_debugobj(obj); printf("stream\n"); showstream(num, gen); printf("endstream\n"); printf("endobj\n\n"); } else { printf("%d %d obj\n", num, gen); fz_debugobj(obj); printf("endobj\n\n"); } fz_dropobj(obj); }
static void lispmeta(fz_metanode *node, int level) { fz_node *child; indent(level); printf("(meta "); if (node->name) { fz_debugobj(node->name); } if (node->dict) { printf("\n"); fz_debugobj(node->dict); } printf("\n"); for (child = node->super.first; child; child = child->next) lispnode(child, level + 1); indent(level); printf(")\n"); }
void pdf_debugoutline(pdf_outline *outline, int level) { int i; while (outline) { for (i = 0; i < level; i++) putchar(' '); if (outline->title) printf("%s ", outline->title); else printf("<nil> "); if (outline->link) fz_debugobj(outline->link->dest); else printf("<nil>\n"); if (outline->child) pdf_debugoutline(outline->child, level + 2); outline = outline->next; } }
void pdf_debugstore(pdf_store *store) { pdf_item *item; pdf_item *next; struct refkey *key; int i; printf("-- resource store contents --\n"); for (i = 0; i < fz_hashlen(store->hash); i++) { key = fz_hashgetkey(store->hash, i); item = fz_hashgetval(store->hash, i); if (key && item) { printf("store[%d] (%d %d R) = %p\n", i, key->oid, key->gen, item->val); } } for (item = store->root; item; item = next) { next = item->next; printf("store[*] "); fz_debugobj(item->key); printf(" = %p\n", item->val); } store->root = nil; }
static void showtrailer(void) { if (!xref) die(fz_throw("no file specified")); printf("trailer\n"); fz_debugobj(xref->trailer); printf("\n"); }
void showtrailer(void) { if (!src) die(fz_throw("no file specified")); printf("trailer\n"); fz_debugobj(src->trailer); printf("\n"); }
static void printglobalinfo(void) { printf("\nPDF-%d.%d\n", xref->version / 10, xref->version % 10); if (info->u.info.obj) { printf("Info object (%d %d R):\n", fz_tonum(info->ref), fz_togen(info->ref)); fz_debugobj(fz_resolveindirect(info->u.info.obj)); } if (cryptinfo->u.crypt.obj) { printf("\nEncryption object (%d %d R):\n", fz_tonum(cryptinfo->ref), fz_togen(cryptinfo->ref)); fz_debugobj(cryptinfo->u.crypt.obj); } printf("\nPages: %d\n\n", pagecount); }
void pdf_debugpagetree(pdf_pagetree *pages) { int i; printf("<<\n /Type /Pages\n /Count %d\n /Kids [\n", pages->count); for (i = 0; i < pages->count; i++) { printf(" %% page %d\n", i + 1); printf(" "); fz_debugobj(pages->pref[i]); } printf(" ]\n>>\n"); }
void showobject(int num, int gen) { fz_error *error; fz_obj *obj; if (!src) die(fz_throw("no file specified")); error = pdf_loadobject(&obj, src, num, gen); if (error) die(error); /* print the stream raw if we're binary */ if (pdf_isstream(src, num, gen) && showbinary) { showstream(num, gen); } else { printf("%d %d obj\n", num, gen); fz_debugobj(obj); printf("\n"); if (pdf_isstream(src, num, gen)) { printf("stream\n"); showstream(num, gen); printf("endstream\n"); } printf("endobj\n\n"); } fz_dropobj(obj); }