else
EXPANDBB(job->boundingBox, job->pageBoundingBox);
+ /* update job->width and job->height with margins */
+ job->width = job->boundingBox.UR.x + job->boundingBox.LL.x;
+ job->height = job->boundingBox.UR.y + job->boundingBox.LL.y;
+
if (job->rotation) {
if (job->flags & GVRENDER_Y_GOES_DOWN) {
job->translation.x = -job->pageBox.UR.x - job->pageBoundingBox.LL.y / job->scale.y;
bool bg_transparent_p = FALSE;
int bgcolor = 0;
gdImagePtr im = NULL;
- int width, height;
/* FIXME - ... */
fprintf(stderr, "%s: using existing GD image\n", job->common->cmdname);
im = (gdImagePtr) (job->output_file);
} else {
- /* device size with margins all around */
- width = job->pageBoundingBox.UR.x + job->pageBoundingBox.LL.x;
- height = job->pageBoundingBox.UR.y + job->pageBoundingBox.LL.y;
-
if (truecolor_p) {
if (job->common->verbose)
fprintf(stderr,
"%s: allocating a %dK TrueColor GD image\n",
job->common->cmdname,
- ROUND(width * height * 4 / 1024.));
- im = gdImageCreateTrueColor(width, height);
+ ROUND(job->width * job->height * 4 / 1024.));
+ im = gdImageCreateTrueColor(job->width, job->height);
} else {
if (job->common->verbose)
fprintf(stderr,
"%s: allocating a %dK PaletteColor GD image\n",
- job->common->cmdname, ROUND(width * height / 1024.));
- im = gdImageCreate(width, height);
+ job->common->cmdname, ROUND(job->width * job->height / 1024.));
+ im = gdImageCreate(job->width, job->height);
}
}
job->surface = (void *) im;
{
cairo_t *cr;
cairo_surface_t *surface;
- double width, height;
#if defined(HAVE_FENV_H) && defined(HAVE_FESETENV) && defined(HAVE_FEGETENV) && defined(HAVE_FEDISABLEEXCEPT)
/* cairo generates FE_INVALID and other exceptions we
cr = (cairo_t *) job->surface; /* might be NULL */
- /* device size with margins all around */
- width = job->pageBoundingBox.UR.x + job->pageBoundingBox.LL.x;
- height = job->pageBoundingBox.UR.y + job->pageBoundingBox.LL.y;
-
switch (job->render.id) {
#ifdef CAIRO_HAS_PNG_FUNCTIONS
case FORMAT_PNG:
if (!cr) {
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- width, height);
+ (double)(job->width), (double)(job->height));
cr = cairo_create(surface);
cairo_surface_destroy (surface);
}
case FORMAT_PS:
if (!cr) {
surface = cairo_ps_surface_create_for_stream (writer,
- job->output_file, width, height);
+ job->output_file, (double)(job->width), (double)(job->height));
cr = cairo_create(surface);
cairo_surface_destroy (surface);
}
case FORMAT_PDF:
if (!cr) {
surface = cairo_pdf_surface_create_for_stream (writer,
- job->output_file, width, height);
+ job->output_file, (double)(job->width), (double)(job->height));
cr = cairo_create(surface);
cairo_surface_destroy (surface);
}
case FORMAT_SVG:
if (!cr) {
surface = cairo_svg_surface_create_for_stream (writer,
- job->output_file, width, height);
+ job->output_file, (double)(job->width), (double)(job->height));
cr = cairo_create(surface);
cairo_surface_destroy (surface);
}