stianlik
Forum Replies Created
-
Forum: Plugins
In reply to: [PDF Thumbnails] program generates blank thumbnailsFor the first test, I opened the file using LibreOffice, set background to white and saved the file. However, LibreOffice did not handle the PDF too well, some of the text got scrambled. It looks like the PDF originally was generated using Word, so it may be possible to fix the background using Word.
In my second test, I simply opened the PDF using Evince, and chose print to PDF, and uploaded the “printed” file. Evince gave good results. I’m testing on Linux, but I assume there is similar functionality in Windows or OSX.
Forum: Plugins
In reply to: [PDF Thumbnails] Images Missing from ThumbnailThank you for the information. I tested the plugin on my test environment, with a random PDF, including images, but I was not able to reproduce the error. On my system, the images are rendered. I tested using the following versions:
WordPress 4.6.1
imagick module version 3.1.2
ImageMagick 6.7.7-10 2014-03-06 Q16 https://www.imagemagick.orgI see that you have a more recent version if ImageMagick. I will try to update ImageMagick library to see if I am able to reproduce the error.
Forum: Plugins
In reply to: [PDF Thumbnails] program generates blank thumbnailsThe problem is that the PDF does not have a background, and the transparency is rendered as black. I did not find any good solutions to handle this type of PDF, other than saving the PDF with a white background before uploading. You can observe the same problem by using ImageMagick in the command line:
`
convert 275_tp1_integration_web_statique_html_css.pdf[0] foo.jpg
`
Currently, it does not seem to be a good solution that handles these PDFs using imagick. I was able to avoid the issue by opening the file in a PDF-editor and setting page background to white. Marking the issue as resolved.
Forum: Plugins
In reply to: [PDF Thumbnails] program generates blank thumbnailsThan you. I can confirm that I’m getting the same error on my side. Will look into the issue.
Forum: Plugins
In reply to: [PDF Thumbnails] Images Missing from ThumbnailI have not changed the functionality for generating PDFs lately, so I suspect it may be a WordPress-update, or system update that’s causing this behavior. I will look into the issue in my test environment.
Can you post your version of WordPress and ImageMagick here? Also, your web host provider, in case there is some correlation.
Forum: Plugins
In reply to: [PDF Thumbnails] Target New Window for Link?Yes, it is possible now. I just uploaded version 2.2.0, where you can specify
title
,target
, anddownload
attributes for your link. I.e.[pdf_thumbnails_link id="172" target="_blank"]
- This reply was modified 8 years, 4 months ago by stianlik.
Forum: Plugins
In reply to: [PDF Thumbnails] program generates blank thumbnailsI can try. Do you have a PDF available for testing? It’s hard to pinpoint the reason before I’m able to reproduce the problem. It could be related to the file size, is this a large PDF? The code I use to generate a thumbnail is as follows:
$imagick = new Imagick($filename); $imagick->setIteratorIndex(0); $imagick->setImageFormat('jpg'); return $imagick->getImageBlob();
Other than that, it’s mostly just code to update metadata for WordPress, not directly related to image generation.
Image generation can be overridden by the
pdf_thumbnails_generate_image_blob
filter as described under developer API for this plugin. If you feel confident coding PHP, I suggest using that filter and see if you can figure out how Imagick handles the uploaded files that are failing, maybe you can get some useful debugging information from there.- This reply was modified 8 years, 5 months ago by stianlik.
Forum: Plugins
In reply to: [PDF Thumbnails] Attachment ID, where I can get it?Not as a part of this plugin, but you can use the built-in functionality from WordPress. I.e. use the “Add media” button to insert the thumbnail image, and choose “Link to: Custom URL”. That should give you pretty much the same result.
Forum: Plugins
In reply to: [PDF Thumbnails] Attachment ID, where I can get it?Yes, you can create a link to your PDF, displaying as an image of the first page of the PDF you uploaded by adding
[pdf_thumbnails_link id="172"]
to your post, where172
is the ID of your PDF, i.e. the attachment ID.The attachment ID can be found as follows:
1. Go into your media library by clicking “Media” in the main menu
2. Find your PDF in the list and click on the PDF icon
3. Look foritem=SOMETHING
in your address bar, i.e. you will see.../upload.php?item=172
if the attachment ID is172
Forum: Plugins
In reply to: [PDF Thumbnails] ACF Front End EditorYou can paste the code into functions.php and it should work. However, it would be better to do this from a plugin so that the functionality is separate from your theme. If you’d like to go with a plugin, you can follow the instructions in the plugin handbook.
Forum: Plugins
In reply to: [PDF Thumbnails] Amazon S3No activity in 2 months, marking this as resolved.
Forum: Plugins
In reply to: [PDF Thumbnails] CMYK PDF thumbnail saturation problemNo activity in 4 months, marking this as resolved.
Forum: Reviews
In reply to: [PDF Thumbnails] Nice JobThanks! Links are now supported using the pdf_thumbnails_link shortcode, e.g.
[pdf_thumbnails_link id="1234" size="medium"]
.Forum: Plugins
In reply to: [PDF Thumbnails] How to implement PDF thumbnailThanks! I have added the functionality to version 2.1.0, see the plugin page for documentation.
Forum: Plugins
In reply to: [PDF Thumbnails] ACF Front End EditorSorry, I should have used
$attachmentId
in the sample, please see the updated sample above. Other than that, your function should be correct.