WordPress.org

Ready to get started?Download WordPress

Forums

Media Library Assistant
[Feature Request] PDF Thumbnail (9 posts)

  1. Trevsweb
    Member
    Posted 1 year ago #

    Really loving the plugin great work. Is it possible to add a feature?
    Trying to make the thumbnails generated by the wordpress media library a bit more palatable for working with A LOT of PDFs.

    Google has a great converter via their googledocs viewer. I was wondering if you could add a bulk thumbnail generator that would add image previews of the pdf document I upload. I could do the (convert on the fly) process but I don't want to constantly rely on the googledocs service and slow down the user experience so a cached thumbnail would be lovely.

    https://docs.google.com/viewer?url=http://www.website.com/wp-content/uploads/2013/01/00001.pdf&a=bi&pagenumber=1&w=250

    I managed to just copy one test file but my php skills are poor tbh and would not be at a level to add this into an automated process without your help.

    $doc2copy = 'http://www.website.com/wp-content/uploads/2013/01/00001.pdf';
    
    $file = 'https://docs.google.com/viewer?url=$doc2copy&a=bi&pagenumber=1&w=250';
    $newfile = 'img/full1_1_3.png';
    
    if (!copy($file, $newfile)) {
        echo "failed to copy $file...\n";
    }

    If this feature could be added that would be awesome :)
    If not your plugin has already solved so many problems for me.
    Thank you.

    http://wordpress.org/extend/plugins/media-library-assistant/

  2. David Lingren
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the kind words and for your suggestion. I'm glad the plugin is useful for you.

    I haven't had any experience with the converter or PDF thumbnails, but I'll have a look and see if there's something I can do. I am traveling until 2/12/2013 and do not have access to my development system, so it will be a while until I can investigate. I will post an update to this topic as soon as I have news.

  3. Trevsweb
    Member
    Posted 1 year ago #

    I read your post. To be honest, I thought you might not reply until you got back. Safe travels.

  4. David Lingren
    Member
    Plugin Author

    Posted 1 year ago #

    I am back from my travels and looking into this topic. I think it's feasible to enhance the [mla_gallery] shortcode to generate thumbnails from Google Drive viewer on-the-fly. I'll have to give more thought to caching thumbnail images, since storing multiple representations of non-image files is not supported by WordPress.

    In the interim, I have an additional question for you. Your example URL includes some parameters I can't find documentation for; "a=", "pagenumber=" and "w=". Can you tell me where to find the most complete documentation of viewer parameters? Thanks!

  5. Trevsweb
    Member
    Posted 1 year ago #

    https://forrst.com/posts/PDF_thumbnails_with_Google_Docs-6G6

    This is where I got the original code from. I have done a search and cannot find how or where he got the information to do the width or linking parameters which is a little annoying. I will post if I find something.

    Thanks for getting back to me.

  6. David Lingren
    Member
    Plugin Author

    Posted 1 year ago #

    I am working on this, but I wanted to share the following with you. I was able to get a good result by creating a custom markup template with the following in the "item" segment:

    <[+itemtag+] class='gallery-item'><br />
    	<[+icontag+] class='gallery-icon'><br />
    		<a href='[+filelink_url+]' title='[+title+]'><img src='http://docs.google.com/viewer?url=[+filelink_url+]&a=bi&pagenumber=1&w=200'></a><br />
    	</[+icontag+]><br />
    	<[+captiontag+] class='wp-caption-text gallery-caption'><br />
    		[+caption+]<br />
    	</[+captiontag+]><br />
    </[+itemtag+]><br />

    I'll work on a way to do this without a custom template, but it was fun to see the template in action...

  7. David Lingren
    Member
    Plugin Author

    Posted 1 year ago #

    I have just released version 1.13, which includes Google File Viewer support. Please let me know if you have any issues with the new feature, questions or further suggestions.

    This version doesn't support caching of thumbnail images; the performance seems good and the service should be reliable.

    Thanks again for your interest, your patience and for using the plugin.

  8. Trevsweb
    Member
    Posted 1 year ago #

    Excellent I will test this out tomorrow. Thank you for putting your time and effort into this great plugin

  9. Trevsweb
    Member
    Posted 1 year ago #

    Just testing the MLA Gallery out. it works excellently :D
    Many thanks for adding this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.