librelist archives

« back to archive

Is Wand able to handle multipages PDF files ?

Is Wand able to handle multipages PDF files ?

From:
Date:
2014-09-24 @ 15:41
Hi all,

I'm writting a python script that uses Wand to crop and resize images 
extracted from PDF files with Ghostscript.
But I would enjoy to know if I can completly replace Ghostscript with 
Wand's methods.

My Ghostscript command (launched from the Python script) take those arguments :
- Resolution to use.
- Page's number (as my PDF files are multipage ones)
- frame (PDF trimbox or PDF mediabox)
The result is dumped as a PNG file that is loaded again to apply croping 
and resizing with Wand.

Could I extract PDF images directly in memory using wand and then work on it ?

Sincerely.

Re: [wand] Is Wand able to handle multipages PDF files ?

From:
Hong Minhee
Date:
2014-09-24 @ 15:56
Hi,

Wand treat each page of PDF as single image of Image.sequence.  You can 
learn more about sequence from the guide docs:

  http://docs.wand-py.org/en/0.3.8/guide/sequence.html


Thanks,
Minhee

On Sep 25, 2014, at 12:41 AM, bruno.vasta@free.fr wrote:

> Hi all,
> 
> I'm writting a python script that uses Wand to crop and resize images 
extracted from PDF files with Ghostscript.
> But I would enjoy to know if I can completly replace Ghostscript with 
Wand's methods.
> 
> My Ghostscript command (launched from the Python script) take those arguments :
> - Resolution to use.
> - Page's number (as my PDF files are multipage ones)
> - frame (PDF trimbox or PDF mediabox)
> The result is dumped as a PNG file that is loaded again to apply croping
and resizing with Wand.
> 
> Could I extract PDF images directly in memory using wand and then work on it ?
> 
> Sincerely.

Re: [wand] Is Wand able to handle multipages PDF files ?

From:
Date:
2014-09-26 @ 09:24
Iside note that I was doing something stupide.

Before, my script was using GhostScript as a external command to perform 
images extraction.
And what I was trying to do, to optimise process time, was to use Wand 
(then ImageMagick) to extract images without using my GhostScript command.
But...ImageMagick delegate to GhostScript to extract images from PDF files !
Then instead of optimising process time, I'm increasing process time...

I discovered this because I had a color profile problem, and seeking about
this I discovered that ImageMagick was using GhostScript.

What you think ?

Sincerely

----- Mail original -----
De: "bruno vasta" <bruno.vasta@free.fr>
À: wand@librelist.com
Envoyé: Vendredi 26 Septembre 2014 10:53:30
Objet: Re: [wand] Is Wand able to handle multipages PDF files ?

Hi,

Nice ! I did not found this while reading the doc.
Thanks a lot !

Sincerely.

----- Mail original -----
De: "Hong Minhee" <minhee@dahlia.kr>
À: wand@librelist.com
Envoyé: Mercredi 24 Septembre 2014 17:56:15
Objet: Re: [wand] Is Wand able to handle multipages PDF files ?

Hi,

Wand treat each page of PDF as single image of Image.sequence.  You can 
learn more about sequence from the guide docs:

  http://docs.wand-py.org/en/0.3.8/guide/sequence.html


Thanks,
Minhee

On Sep 25, 2014, at 12:41 AM, bruno.vasta@free.fr wrote:

> Hi all,
> 
> I'm writting a python script that uses Wand to crop and resize images 
extracted from PDF files with Ghostscript.
> But I would enjoy to know if I can completly replace Ghostscript with 
Wand's methods.
> 
> My Ghostscript command (launched from the Python script) take those arguments :
> - Resolution to use.
> - Page's number (as my PDF files are multipage ones)
> - frame (PDF trimbox or PDF mediabox)
> The result is dumped as a PNG file that is loaded again to apply croping
and resizing with Wand.
> 
> Could I extract PDF images directly in memory using wand and then work on it ?
> 
> Sincerely.

Re: [wand] Is Wand able to handle multipages PDF files ?

From:
Date:
2014-09-26 @ 08:53
Hi,

Nice ! I did not found this while reading the doc.
Thanks a lot !

Sincerely.

----- Mail original -----
De: "Hong Minhee" <minhee@dahlia.kr>
À: wand@librelist.com
Envoyé: Mercredi 24 Septembre 2014 17:56:15
Objet: Re: [wand] Is Wand able to handle multipages PDF files ?

Hi,

Wand treat each page of PDF as single image of Image.sequence.  You can 
learn more about sequence from the guide docs:

  http://docs.wand-py.org/en/0.3.8/guide/sequence.html


Thanks,
Minhee

On Sep 25, 2014, at 12:41 AM, bruno.vasta@free.fr wrote:

> Hi all,
> 
> I'm writting a python script that uses Wand to crop and resize images 
extracted from PDF files with Ghostscript.
> But I would enjoy to know if I can completly replace Ghostscript with 
Wand's methods.
> 
> My Ghostscript command (launched from the Python script) take those arguments :
> - Resolution to use.
> - Page's number (as my PDF files are multipage ones)
> - frame (PDF trimbox or PDF mediabox)
> The result is dumped as a PNG file that is loaded again to apply croping
and resizing with Wand.
> 
> Could I extract PDF images directly in memory using wand and then work on it ?
> 
> Sincerely.