Re: convert pdf to png
- From: Carl K <carl@xxxxxxxxxxxxxxxxx>
- Date: Wed, 26 Dec 2007 12:32:06 -0600
Grant Edwards wrote:
On 2007-12-25, Diez B. Roggisch <deets@xxxxxxxxxxxxx> wrote:Carl K schrieb:Grant Edwards wrote:So what? I'm not sure about current HD speeds, but a couple of years ago these were about 30MByte/s - and should be faster today. Which equals 240MBit/s, much more than your user's internet connection. and this is raw IO speed, not counting disk caches.On 2007-12-24, Carl K <carl@xxxxxxxxxxxxxxxxx> wrote:maybe, but I wouldn't be so sure.
Use subprocess.If it is a multi page pdf Imagemagick will do:I need python code to do this. It is going to be run on a
convert file.pdf page-%03d.png
someone else's shared host web server, security and
performance is an issue. So I would rather not run stuff via
popen.
Trying to eliminate popen because of the overhead when running
ghostscript to render PDF (I assume convert uses gs?) is about
like trimming an elephants toenails to save weight.
currently the pdf is created in a python StringIO buffer and returned to the browser; so it never becomes a file. using convert means I have to first save it as a file, convert from file to file, read the file, delete the 2 files. so 6 file operations where before there were none. That may be more of a load than the ghostscript part.
Unless the file is really huge (or the server is overloaded),
The server is already overloaded,
the bytes will probably never even hit a platter. If you're
using any even remotely modern OS, short-lived tempfiles used
as you desdcribe are basically just memory-buffers with a
filesystem API.
Good point. Not that I am willing to risk it (just using the pdf is not such a bad option) but I am wondering if it would make sense to create a ramdrive for something like this. if memory is needed, swap would happen, which should be better than creating files.
Carl K
.
- Follow-Ups:
- Re: convert pdf to png
- From: Diez B. Roggisch
- Re: convert pdf to png
- References:
- convert pdf to png
- From: Carl K
- Re: convert pdf to png
- From: Jaap Spies
- Re: convert pdf to png
- From: Carl K
- Re: convert pdf to png
- From: Grant Edwards
- Re: convert pdf to png
- From: Carl K
- Re: convert pdf to png
- From: Diez B. Roggisch
- Re: convert pdf to png
- From: Grant Edwards
- convert pdf to png
- Prev by Date: Re: Writing Oracle Output to a File
- Next by Date: Re: how to generate html table from "table" data?
- Previous by thread: Re: convert pdf to png
- Next by thread: Re: convert pdf to png
- Index(es):
Relevant Pages
|