Needs review
Project:
PDFPreview
Version:
7.x-2.1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2012 at 16:40 UTC
Updated:
10 Aug 2016 at 22:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jtwalters commentedProbably need to adjust the density args... this requires a patch.
at line 216 of pdfpreview.module I've added:
Let me know if that helps.
Comment #2
jtwalters commentedNote: The density arg won't work unless it is prepended as the first argument (before the pdf file argument)...the default density may not be suitable. You would need to modify the code that calls convert.
Comment #3
Daguntzi commentedI've got the same problem and I don't know how to solve it!! Please help!
Comment #4
jtwalters commentedLine 227 of 7.x-2.1 is probably responsible for this:
$command = escapeshellarg($source) . ' ' . implode(' ', $args) . ' ' . escapeshellarg($dest);You need to specify a higher density argument for the resulting image to be sharper. Something like this (untested):
$command = '-density 150 ' . escapeshellarg($source) . ' ' . implode(' ', $args) . ' ' . escapeshellarg($dest);Comment #5
jakob123 commentedAttached is a patch to make the raster density configurable by the user.
Works fine here, I'm using 300dpi which gives good quality even for large (1024x1024) previews. It's quite slow (several seconds for one PDF!) an uses a lot of RAM, so I would recommend trying 150dpi first.
Please test the patch so this can be set to "reviewed & tested by the community"!
If you don't know how to apply the patch, I have also attached the complete patched "pdfpreview.module" file.
Comment #6
stefan.norman commentedI have tested the patch in #5. Solution works fine.
Attaching same patch for 7.x-2.1
Comment #7
pbuyle commentedWith commit 1c18fc2 made for #2300203: Remote files not supported, PDF Preview uses
_imagemagick_convertinstead of_imagemagick_convert_exec(). Preprending options before the input is not possible when using_imagemagick_convert. It's a short-coming of the ImageMagick module itself.The patch for this issue needs a re-roll for the latest 7.x-2.x branch. Also relevant is the removal of the
pdfpreview_qualityvariable, the generalimagemagick_qualityvariable is now used (thanks to_imagemagick_convert).Comment #8
nbuonin commentedI had this problem as well. What worked for me was changing the image format settings in the manage display menu for the content type.
What I realized was the the module assigned the stock "medium" image format to the generated jpg. The image was essentially being rendered twice, first by ImageMagick and then again by Drupal, resulting in a pretty scuzzy looking image.
I set the image format to none, and then used to containing div to constrain the image to the size needed.
Comment #9
joelstein commentedHere's a patch which takes the good stuff from #6 and works with the ImageMagick patch at #1022444-3: Some ImageMagick options should precede the source file, which makes it possible to prepend the 'density' option before the source argument.