X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=tiff%2Ftiff-document.c;h=36847aa45f3173cdd2fd79bf6cafdf016654336a;hb=efa870dac2fdad4dd736b16e79b3c8e4e33b6055;hp=137833be58cf98c48a871706467bfdf79f8cad34;hpb=b7abdba401b7aec50e93ecd1df1ce76cb1f315c1;p=evince.git diff --git a/tiff/tiff-document.c b/tiff/tiff-document.c index 137833be..36847aa4 100644 --- a/tiff/tiff-document.c +++ b/tiff/tiff-document.c @@ -22,7 +22,6 @@ #include #include -#include #include "tiffio.h" #include "tiff2ps.h" @@ -43,8 +42,7 @@ struct _TiffDocument TIFF *tiff; gint n_pages; EvOrientation orientation; - FILE *ps_export_file; - gint ps_export_pages; + TIFF2PSContext *ps_export_ctx; }; typedef struct _TiffDocumentClass TiffDocumentClass; @@ -417,10 +415,7 @@ tiff_document_ps_export_begin (EvPSExporter *exporter, const char *filename, { TiffDocument *document = TIFF_DOCUMENT (exporter); - document->ps_export_file = g_fopen (filename, "w"); - if (document->ps_export_file == NULL) - return; - document->ps_export_pages = 0; + document->ps_export_ctx = tiff2ps_context_new(filename); } static void @@ -428,14 +423,12 @@ tiff_document_ps_export_do_page (EvPSExporter *exporter, int page) { TiffDocument *document = TIFF_DOCUMENT (exporter); - if (document->ps_export_file == NULL) + if (document->ps_export_ctx == NULL) return; if (TIFFSetDirectory (document->tiff, page) != 1) return; - TIFF2PS (document->ps_export_file, - document->tiff, - 0, 0, 0, 0, 0, - &document->ps_export_pages); + tiff2ps_process_page (document->ps_export_ctx, document->tiff, + 0, 0, 0, 0, 0); } static void @@ -443,12 +436,9 @@ tiff_document_ps_export_end (EvPSExporter *exporter) { TiffDocument *document = TIFF_DOCUMENT (exporter); - if (document->ps_export_file == NULL) + if (document->ps_export_ctx == NULL) return; - if (document->ps_export_pages) - TIFFPSTail (document->ps_export_file, - document->ps_export_pages); - fclose (document->ps_export_file); + tiff2ps_context_finalize(document->ps_export_ctx); } static void