Beispiel #1
0
void pdfapp_close(pdfapp_t *app)
{
	if (app->cache)
		fz_free_glyph_cache(app->cache);
	app->cache = NULL;

	if (app->image)
		fz_drop_pixmap(app->image);
	app->image = NULL;

	if (app->outline)
		pdf_free_outline(app->outline);
	app->outline = NULL;

	if (app->xref)
	{
		if (app->xref->store)
			pdf_free_store(app->xref->store);
		app->xref->store = NULL;

		pdf_free_xref(app->xref);
		app->xref = NULL;
	}

	if (app->xps)
	{
		xps_free_context(app->xps);
		app->xps = NULL;
	}

	fz_flush_warnings();
}
Beispiel #2
0
static mume_tocitem_t* _pdf_doc_get_toc_tree(struct _pdf_doc *self)
{
    pdf_outline *outline;
    mume_tocitem_t *item = NULL;

    outline = pdf_load_outline(self->xref);
    if (outline) {
        item = _pdf_doc_build_toc_tree(self, NULL, outline);
        pdf_free_outline(outline);
    }

    return item;
}
Beispiel #3
0
void pdfapp_close(pdfapp_t *app)
{
#if 0
	if (app->page)
		pdf_droppage(app->page);
	app->page = nil;

	if (app->image)
		fz_droppixmap(app->image);
	app->image = nil;

/*	if (app->outline)
		pdf_dropoutline(app->outline);
	app->outline = nil;*/

	if (app->xref->store)
		pdf_dropstore(app->xref->store);
	app->xref->store = nil;

	pdf_closexref(app->xref);
	app->xref = nil;
#else
	if (app->cache)
		fz_free_glyph_cache(app->cache);
	app->cache = NULL;

	if (app->image)
		fz_drop_pixmap(app->image);
	app->image = NULL;

	if (app->outline)
		pdf_free_outline(app->outline);
	app->outline = NULL;

	if (app->xref)
	{
		if (app->xref->store)
			pdf_free_store(app->xref->store);
		app->xref->store = NULL;

		pdf_free_xref(app->xref);
		app->xref = NULL;
	}

	fz_flush_warnings();
#endif

}