diff options
Diffstat (limited to 'coders/pdf.c')
-rw-r--r-- | coders/pdf.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/coders/pdf.c b/coders/pdf.c index f7da070..6cf9963 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2020 GraphicsMagick Group +% Copyright (C) 2003-2021 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -1005,7 +1005,8 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) FormatString(buffer,"/ProcSet %lu 0 R >>\n",object+3); (void) WriteBlobString(image,buffer); FormatString(buffer,"/MediaBox [0 0 %ld %ld]\n", - media_info.width,media_info.height); + (long int)(((media_info.width * dx_resolution) / x_resolution) + 0.5), + (long int)(((media_info.height * dy_resolution) / y_resolution) + 0.5)); (void) WriteBlobString(image,buffer); FormatString(buffer,"/CropBox [%ld %ld %ld %ld]\n",geometry.x,geometry.y, geometry.x+geometry.width,geometry.y+geometry.height); @@ -1045,9 +1046,9 @@ static unsigned int WritePDFImage(const ImageInfo *image_info,Image *image) FormatString(buffer,"(%.1024s) Tj\n",labels[i]); (void) WriteBlobString(image,buffer); (void) WriteBlobString(image,"ET\n"); - MagickFreeResourceLimitedMemory(labels[i]); + MagickFreeMemory(labels[i]); } - MagickFreeResourceLimitedMemory(labels); + MagickFreeMemory(labels); } FormatString(buffer,"%g 0 0 %g %ld %ld cm\n",x_scale,y_scale,geometry.x, geometry.y); |