Imagemagick does only create JPGs from the first page of multipage PDFs

gb5256_2

Joined: 2007-11-22
Posts: 7
Posted: Thu, 2007-11-22 08:55

hello Out there,

The PDF Workflow works genereally pretty good, so the Imagemagick and the Ghostscript is installed properly.
But if I upload a PDF it is creating a JPG only from the first Page of the PDF.
I do know that Imagemagick is able to do multipage (input.pdf output-%d.jpg) conversions.

As I'm working with a lot of PDFs and nearly all of them are multipage, this is an essential thing for me.
I love the software and appretiate your work here very much, but this would keep me from using it.

I do not know if the architecture of gallery2 is capable of doing such things.
Furthermore this is a rented server, so I do not have direct access to imagemagicks configs to change something (Well, I can ask my hoster to do so, but this is not very convinient).

Does anybody have a hint for me how to set this up? (If possible at all...)

Thanks everybody in advance.

gb5256-2


Gallery version (not just "2"): 2.2.3
PHP version (e.g. 5.1.6): 5.1
PHPInfo Link (see FAQ):
Webserver (e.g. Apache 1.3.33): Apache
Database (e.g. MySql 5.0.32): 5.0.32
Activated toolkits (e.g. NetPbm, GD): NetPM, GD, Imagemagick with Ghostscript
Operating system (e.g. Linux): Linux
Browser (e.g. Firefox 2.0): Firefox 2, newest

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2007-11-22 14:32

- the idea wasn't really to provide a viewer for PDF pages. why not use acrobat reader for that? it integrates nicely into the browser.
- there's the "thumbnail page" module which allows you to specify which page should be used for the preview image (and for the thumbnail).
- you could write a module for g2 to create an image for each PDF page. it could probably use a "derivative" image for each page.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
gb5256_2

Joined: 2007-11-22
Posts: 7
Posted: Thu, 2007-11-22 17:24

Thank you for your reply.
I know that this is not ment to be a PDF viewer.
But I have some multipage PDFs which show fotos.
So the advantage of your system here would be, that I could comment the "pdf" with my partners and that those comments are stored online. This is not possible when opening a PDF in the browser.
So I will have a look about how the command is given to the imagemagick and how the image is coming back to G2.
As said before, Imagemagick does create multiple jpgs from multipage pdfs.

So I will be back and post what I found out.

Thanks anybody.
(If somebody has some more hints for me, I would appreciate it very much.)

Thanks,
gb5256-2

 
gb5256_2

Joined: 2007-11-22
Posts: 7
Posted: Thu, 2007-11-22 19:32

Hello Vailant,

perhaps you could give me one more hint.

Here is what I found out so far.

The command:

Quote:
-convert input.pdf output-%d.jpg

creates multiple jpgs (one for each page).

Afterwards the command

Quote:
convert -background none -gravity Center output-%d.jpg -append outputNew.jpg

should join them togther to one (very long) jpg.

That would be already a very good solution for me as my pdfs are not very long.

Furthermore of course I have to adjust the

Quote:
$page = 0

in the imagemagicktool.class so that it not only imports the first page.
But this is a minor problem I think.

Right now, I would need a hint where my statement about joining the jpgs should happen.

Pleeeeese some hint...

thanks in advance.

gb5256-2

 
gb5256_2

Joined: 2007-11-22
Posts: 7
Posted: Mon, 2007-11-26 13:30

Hello?

Is there anybody out there who could give me a hint?
I'm not loogking for a complete solution (well, would be cool).
All I need is seom explanation where something like this should take place.

I think it should be somewhere after line 560 in the imagemagickToolkit.class.

Can anybody help me?

thanks in advance to everybody involved.

gb5256_2

 
jesperf

Joined: 2010-11-10
Posts: 1
Posted: Wed, 2010-11-10 09:11

I know this is a old post. But I am curious ... did you find a solution?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2010-11-10 12:40

pdf support requires imagemagick to be compile with ghostscript support.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2