X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fev-poppler.cc;h=2e0e46a88a5e900d4181152b3f0d2c5f9bf8b2c8;hb=f09959b414ef0f5112f7c6277a23606e432e2389;hp=d4372ad6be7cbb1ffa66488676efc127697c6d52;hpb=1a07ffc563175aaa64af6c8e872c24b1ac3e8ea7;p=evince.git diff --git a/pdf/ev-poppler.cc b/pdf/ev-poppler.cc index d4372ad6..2e0e46a8 100644 --- a/pdf/ev-poppler.cc +++ b/pdf/ev-poppler.cc @@ -25,7 +25,9 @@ #include #include #include +#ifdef HAVE_CAIRO_PDF #include +#endif #include #include "ev-poppler.h" @@ -51,7 +53,9 @@ typedef struct { typedef struct { EvFileExporterFormat format; PopplerPSFile *ps_file; +#ifdef HAVE_CAIRO_PDF cairo_t *pdf_cairo; +#endif } PdfPrintContext; struct _PdfDocumentClass @@ -1425,11 +1429,13 @@ pdf_document_find_iface_init (EvDocumentFindIface *iface) static const gboolean supported_formats[] = { TRUE, /* EV_FILE_FORMAT_PS */ +#ifdef HAVE_CAIRO_PDF #ifdef HAVE_POPPLER_PAGE_RENDER TRUE, /* EV_FILE_FORMAT_PDF */ #else FALSE, /* EV_FILE_FORMAT_PDF */ #endif +#endif }; static void @@ -1442,12 +1448,12 @@ pdf_print_context_free (PdfPrintContext *ctx) poppler_ps_file_free (ctx->ps_file); ctx->ps_file = NULL; } - +#ifdef HAVE_CAIRO_PDF if (ctx->pdf_cairo) { cairo_destroy (ctx->pdf_cairo); ctx->pdf_cairo = NULL; } - +#endif g_free (ctx); } @@ -1487,11 +1493,13 @@ pdf_document_file_exporter_begin (EvFileExporter *exporter, break; case EV_FILE_FORMAT_PDF: { +#ifdef HAVE_CAIRO_PDF cairo_surface_t *surface; surface = cairo_pdf_surface_create (filename, width, height); ctx->pdf_cairo = cairo_create (surface); cairo_surface_destroy (surface); +#endif } break; default: @@ -1518,7 +1526,9 @@ pdf_document_file_exporter_do_page (EvFileExporter *exporter, EvRenderContext *r #ifdef HAVE_POPPLER_PAGE_RENDER poppler_page_render (poppler_page, ctx->pdf_cairo); #endif +#ifdef HAVE_CAIRO_PDF cairo_show_page (ctx->pdf_cairo); +#endif break; default: g_assert_not_reached ();