HPDF_Image_GetColorSpace (HPDF_Image image) { HPDF_Name n; HPDF_PTRACE ((" HPDF_Image_GetColorSpace\n")); n = HPDF_Dict_GetItem (image, "ColorSpace", HPDF_OCLASS_NAME); if (!n) { HPDF_Array a; HPDF_Error_Reset(image->error); a = HPDF_Dict_GetItem (image, "ColorSpace", HPDF_OCLASS_ARRAY); if (a) { n = HPDF_Array_GetItem (a, 0, HPDF_OCLASS_NAME); } } if (!n) { HPDF_CheckError (image->error); return NULL; } return n->value; }
HPDF_ResetError (HPDF_Doc pdf) { if (!HPDF_Doc_Validate (pdf)) return; HPDF_Error_Reset (&pdf->error); }
HPDF_FreeDoc (HPDF_Doc pdf) { HPDF_PTRACE ((" HPDF_FreeDoc\n")); if (HPDF_Doc_Validate (pdf)) { if (pdf->xref) { HPDF_Xref_Free (pdf->xref); pdf->xref = NULL; } if (pdf->font_mgr) { HPDF_List_Free (pdf->font_mgr); pdf->font_mgr = NULL; } if (pdf->fontdef_list) CleanupFontDefList (pdf); HPDF_MemSet(pdf->ttfont_tag, 0, 6); pdf->pdf_version = HPDF_VER_13; pdf->outlines = NULL; pdf->catalog = NULL; pdf->root_pages = NULL; pdf->cur_pages = NULL; pdf->cur_page = NULL; pdf->encrypt_on = HPDF_FALSE; pdf->cur_page_num = 0; pdf->cur_encoder = NULL; pdf->def_encoder = NULL; pdf->page_per_pages = 0; if (pdf->page_list) { HPDF_List_Free (pdf->page_list); pdf->page_list = NULL; } pdf->encrypt_dict = NULL; pdf->info = NULL; HPDF_Error_Reset (&pdf->error); if (pdf->stream) { HPDF_Stream_Free (pdf->stream); pdf->stream = NULL; } } }
HPDF_FreeDocAll (HPDF_Doc pdf) { HPDF_PTRACE ((" HPDF_FreeDocAll\n")); if (HPDF_Doc_Validate (pdf)) { HPDF_FreeDoc (pdf); if (pdf->fontdef_list) FreeFontDefList (pdf); if (pdf->encoder_list) FreeEncoderList (pdf); pdf->compression_mode = HPDF_COMP_NONE; HPDF_Error_Reset (&pdf->error); } }