Commit 71c1563b authored by Kristian Høgsberg's avatar Kristian Høgsberg

Thu Apr 21 00:15:30 2005 Kristian Høgsberg <krh@redhat.com>

        * glib/poppler-document.cc (poppler_document_new_from_file): Add
        output device (cairo or splash) to PopplerDocument and initialize
        it in the constructor.

        * glib/poppler-page.cc (splash_render_to_pixbuf,
        cairo_render_to_pixbuf): Use output device from associated poppler
        document instead of creating a new one.

        * poppler-glib.pc.in (Requires): Add Requires: field.

        * poppler/Page.cc (loadThumb): Remove unecessary and buggy call to
        Stream::addFilters(), reported by Ryan Lortie (#3046).
parent c6328cbc
Thu Apr 21 00:15:30 2005 Kristian Høgsberg <krh@redhat.com>
* glib/poppler-document.cc (poppler_document_new_from_file): Add
output device (cairo or splash) to PopplerDocument and initialize
it in the constructor.
* glib/poppler-page.cc (splash_render_to_pixbuf,
cairo_render_to_pixbuf): Use output device from associated poppler
document instead of creating a new one.
* poppler-glib.pc.in (Requires): Add Requires: field.
* poppler/Page.cc (loadThumb): Remove unecessary and buggy call to
Stream::addFilters(), reported by Ryan Lortie (#3046).
2005-04-13 Jeff Muizelaar <jrmuizel@nit.ca>
* qt/poppler-page.cc (Page::getText):
......
Next Release
TODO:
- Use zlib for flate streams by default
- Performance fixes for glib+cairo
DONE:
- First simple cut at qt wrapper, including getText() for
getting text from a page.
- More glib functionality: meta data, set page orientation,
print to PS
- Bug fixes
Release 0.2.0 (Tue Apr 5 12:32:10 EDT 2005)
- Add glib wrapper for poppler, which will use cairo rendering
......
......@@ -105,6 +105,15 @@ poppler_document_new_from_file (const char *uri,
document->doc = newDoc;
#if defined (HAVE_CAIRO)
document->output_dev = new CairoOutputDevImage ();
#elif defined (HAVE_SPLASH)
SplashColor white;
white.rgb8 = splashMakeRGB8 (0xff, 0xff, 0xff);
document->output_dev = new SplashOutputDev(splashModeRGB8, gFalse, white);
#endif
document->output_dev->startDoc(document->doc->getXRef ());
return document;
}
......@@ -133,6 +142,7 @@ poppler_document_finalize (GObject *object)
{
PopplerDocument *document = POPPLER_DOCUMENT (object);
delete document->output_dev;
delete document->doc;
}
......
......@@ -29,14 +29,6 @@
#include <GfxState.h>
#include <TextOutputDev.h>
#if defined (HAVE_CAIRO)
#include <CairoOutputDevImage.h>
#endif
#if defined (HAVE_SPLASH)
#include <SplashOutputDev.h>
#endif
#include "poppler.h"
#include "poppler-private.h"
......@@ -185,9 +177,7 @@ cairo_render_to_pixbuf (PopplerPage *page,
guchar *pixbuf_data, *cairo_data, *dst;
int x, y;
output_dev = new CairoOutputDevImage ();
output_dev->startDoc(page->document->doc->getXRef ());
output_dev = page->document->output_dev;
page->page->displaySlice(output_dev, 72.0 * scale, 72.0 * scale,
poppler_page_get_rotate (page),
......@@ -225,8 +215,6 @@ cairo_render_to_pixbuf (PopplerPage *page,
src++;
}
}
delete output_dev;
}
#elif defined (HAVE_SPLASH)
......@@ -240,7 +228,6 @@ splash_render_to_pixbuf (PopplerPage *page,
int dest_x, int dest_y)
{
SplashOutputDev *output_dev;
SplashColor white;
SplashBitmap *bitmap;
SplashColorPtr color_ptr;
int splash_width, splash_height, splash_rowstride;
......@@ -248,10 +235,7 @@ splash_render_to_pixbuf (PopplerPage *page,
guchar *pixbuf_data, *dst;
int x, y;
white.rgb8 = splashMakeRGB8 (0xff, 0xff, 0xff);
output_dev = new SplashOutputDev(splashModeRGB8, gFalse, white);
output_dev->startDoc(page->document->doc->getXRef ());
output_dev = page->document->output_dev;
page->page->displaySlice(output_dev, 72.0 * scale, 72.0 * scale,
poppler_page_get_rotate (page),
......@@ -293,8 +277,6 @@ splash_render_to_pixbuf (PopplerPage *page,
src++;
}
}
delete output_dev;
}
#endif
......
#ifndef __POPPLER_PRIVATE_H__
#define __POPPLER_PRIVATE_H__
#include <config.h>
#include <PDFDoc.h>
#include <PSOutputDev.h>
#include <Link.h>
#if defined (HAVE_CAIRO)
#include <CairoOutputDevImage.h>
#elif defined (HAVE_SPLASH)
#include <SplashOutputDev.h>
#endif
struct _PopplerDocument
{
GObject parent_instance;
PDFDoc *doc;
#if defined (HAVE_CAIRO)
CairoOutputDevImage *output_dev;
#elif defined (HAVE_SPLASH)
SplashOutputDev *output_dev;
#endif
};
struct _PopplerPSFile
......
......@@ -6,6 +6,7 @@ includedir=@includedir@
Name: poppler
Description: GLib wrapper for poppler
Version: @VERSION@
Requires: gobject-2.0 gdk-pixbuf-2.0
Libs: -L${libdir} -lpoppler -lpoppler-glib
Cflags: -I${includedir}/poppler/glib
......@@ -82,7 +82,7 @@ CairoFont::CairoFont(GfxFont *gfxFont, XRef *xref, FT_Library lib) {
fontType = gfxFont->getType();
tmpFileName = NULL;
if (gfxFont->getEmbeddedFontID(&embRef)) {
if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL)) {
error(-1, "Couldn't create temporary font file");
......
......@@ -447,8 +447,6 @@ GBool Page::loadThumb(unsigned char **data_out,
goto fail1;
}
str->addFilters(&fetched_thumb);
pixbufdata = (unsigned char *) gmalloc(pixbufdatasize);
p = pixbufdata;
imgstr = new ImageStream(str, width,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment