Hi,
when pdf2svg uses poppler to render a pdf to a cairo svg surface, embedded images are downscaled by CairoOutputDev::downscaleSurface which results in poor image quality. Please find attached a simple patch preventing downscaling for svg surfaces. Works for me.
Could this be useful for other scalable surface types, too?

Regards,
Jan
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index fae0136..10c61e9 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -1730,10 +1730,15 @@ cairo_surface_t *CairoOutputDev::downscaleSurface(cairo_surface_t *orig_surface)
   int scaledHeight;
   int scaledWidth;
   GBool res;
+  cairo_surface_type_t surface_type;
 
   if (printing)
     return NULL;
 
+  surface_type = cairo_surface_get_type(cairo_get_target(cairo));
+  if (surface_type == CAIRO_SURFACE_TYPE_SVG) 
+    return NULL;
+
   orig_width = cairo_image_surface_get_width (orig_surface);
   orig_height = cairo_image_surface_get_height (orig_surface);
   getScaledSize (orig_width, orig_height, &scaledWidth, &scaledHeight);
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to