PDF sizes and actual content

I am currently using php imagick to convert some PDF to images. This works well for small details that the images are "sliced" during output.

This is due to the difference in the information contained in the PDF and the actual size of the content.

PDF reports are a 612x792 72ppi document, but when I export an image from it through a preview on mac, the image will be 1651x1275. How is this possible?

Obviously, the export is correct because the image is viewed correctly in these sizes. Can a PDF file just be erroneously encoded when the width and height have been mixed up? How can I detect this through code? In addition, exporting images has a different (much larger) size, approximately two times its size. This leads me to think that some information is not being read properly with imagick.

Basically, I would like to know if there is a way to determine the actual size of the PDF content so that the images exported from it are in better quality.

Thank!

EDIT: (code added)

<?php
$im = new Imagick();
$im->readImage("SomeTest.pdf");
$im->setImageColorspace(255);
$im->setCompression(Imagick::COMPRESSION_JPEG);
$im->setCompressionQuality(60);
$im->setImageFormat('jpeg');
$im->writeImages("SampleImage.jpg");
?>

Used pdf file: http://www.pantone.com/pages/MYP_mypantone/software_downloader.aspx?f=3

Also, here is the imagick output from the identImage () function, which seems a bit wrong when looking at the file size.

Array
(
    [imageName] => /tmp/magick-XXehkI8e
    [format] => PDF (Portable Document Format)
    [geometry] => Array
        (
            [width] => 612
            [height] => 792
        )

    [type] => TrueColor
    [colorSpace] => RGB
    [resolution] => Array
        (
            [x] => 72
            [y] => 72
        )

    [units] => Undefined
    [fileSize] => 50mb
    [compression] => Undefined
    [signature] => 9426f3fc4f45afd71941435a37d585d01e01d32458f3ca241e72892c2f7f35d5
)
+3
2

PDF PDF ( , Reader .).

ImageMagick ( ass-u-me imagick) GhostScript PDF . GhostScript PDF . , - .

- ? PDF [s] .


gs 8.71 PDF , . GhostScript ?

+1

, PDF . , - , , .

PDF , ( ).

" ? PDF , , !" . PDF , . 300 8.5 "x11" PDF , , 8.5 "x11", ( ) - "" , . , PDF- ( ) , .

, PDF- 96 100%, 96 . PDF 1800 dpi, 1800 .

300 100% PDF, 100% 96 , 96 . 300 / 100% PDF, 100% 1800 , 300 dpi.

, , , ,, , 8.5 "x 11" PDF 612 x 792, 1 PDF 1/72 . , , ~ 194 dpi.

+2

All Articles