Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Create thumbnail image (jpg/png) of PDF file using Python

1,264 views
Skip to first unread message

sophie_newbie

unread,
Nov 20, 2007, 12:36:56 PM11/20/07
to
Is there any way to do this directly within python?

If not is there any other good way to achieve it?

Thanks in advance for any help!

Robin Becker

unread,
Nov 20, 2007, 1:01:17 PM11/20/07
to pytho...@python.org

I have used ghostscript from within python to do this sort of thing. You may get
problems if the fonts are too exotic, but otherwise it works quite well. If that
sounds OK I can send you a script that I use.
--
Robin Becker

davis...@gmail.com

unread,
Nov 20, 2007, 4:09:54 PM11/20/07
to

Take a look at PIL -- http://www.pythonware.com/products/pil/. Among
other things, it allows you to easily create thumbnails.

--Nathan Davis

sophie_newbie

unread,
Nov 21, 2007, 1:16:55 PM11/21/07
to

I think I've solved this problem using a piece of software called
imageMagick. Good stuff so it is.

golf...@gmail.com

unread,
Jun 14, 2012, 1:35:27 PM6/14/12
to
On Wednesday, November 21, 2007 1:16:55 PM UTC-5, sophie_newbie wrote:
> On Nov 20, 5:36 pm, sophie_newbie
> wrote:
> > Is there any way to do this directly within python?
> >
> > If not is there any other good way to achieve it?
> >
> > Thanks in advance for any help!
>
> I think I've solved this problem using a piece of software called
> imageMagick. Good stuff so it is.

Interesting. I wonder if GS can be used to convert PDF To JPG and JPG back to PDF? Pillow is a better alternative to PIL if you are in need of compiling on a Mac.
Message has been deleted

Chris Angelico

unread,
Jun 16, 2012, 6:43:51 AM6/16/12
to pytho...@python.org
On Fri, Jun 15, 2012 at 9:15 AM, Dennis Lee Bieber
<wlf...@ix.netcom.com> wrote:
>        PDF is not an "image" file format; it is a "program" describing how
> to render each page. Some of the page contents can be image bitmap data,
> but a "proper" PDF has text AS text.

Plus, JPG is very poor at handling text. It's designed for photos and
photo-like images.

I would recommend using PNG for the bitmapped side.

ChrisA
0 new messages