Jean Magnan de Bornier on  wrote...
| Le 23 ao=FBt =E0 09:10:00 Anthony Thyssen <[EMAIL PROTECTED]> =E9crit=
|  notamment:
| 
| | Jean Magnan de Bornier on  wrote...
| | | | | The problem here is that "program" creates a file foo.png, doesn't =
| send
| | | | | to standard input; I guess in this case pipe cannot help..?
| | | | |
| | | | If you are using, BASH you can have program write to /dev/stdout
| | | | (this file does not exist but handled internally by bash)
| | |=20
| | | Thanks to all!
| | | My "program" is not BASH anf doesn't seem to be able to deliver to stdo=
| ut;
| | | I will habe to stick to some roundabout way...
| >
| | NOT the program, the shell running the pipeline!
| >
| |    echo $SHELL
| >
| | will output something like
| >
| |    /usr/bash
| >
| Well I use zsh.
| 
| Let me be more specific. Some days ago I posted a message about "pdf to png
| and size problem" and I got no solution here; on a french list someone advi=
| sed
| me to use pdftoppm, and I found that this worked as I want:
| 
| $ pdftoppm  foo.pdf tex; convert tex-000001.ppm foo.png; rm *.ppm=20
| 
| The last command is necessary if I want to use this several times without
| bothering about numbering in the ppm file name, and I thought that if this
| file could be a temporary one (and piped) there would be no need to
| destroy it at the end. However this command works well, but pdftoppm
| doesn't have much flexibility in file names or anything else...
| 
Ok.. Now that you are more specific...

NO  you can NOT pipe this as it is creating its own filesnames,
one per page, based on a given 'basename'.   You can NOT redirect
this to a pipe.

HOWEVER.  If this is a script (sh, bash or zsh) you can do this..

=======8<--------
#!/bin/sh

input="$1"
output="$2"

TMPDIR=/tmp/pdf_pages_$$
trap 'rm -rf $TMPDIR; exit 1' 1 2 3 15
trap 'rm -rf $TMPDIR; exit 0' 0

mkdir $TMPDIR

pdftoppm -r 300 -f 1 -l 1 "$input" $TMPDIR/tex

convert tex-000001.ppm "$output"

exit 0
=======8<--------


The 'trap's in the above ensures the files are cleaned up on
any exit (except a unstoppable kill or '9' signal).

For more info see
 IM Examples, API and scripting, Better Scripting
   http://www.imagemagick.org/Usage/api/#scripts

And as an example see  IM Scripts
   http://www.imagemagick.org/Usage/scripts/
such as
   jigsaw   de-pixelate


  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
  "Ye castle looks awfully like a home page to thy eyes! Castle bricks doth
   not fit down ye old ethernet cable, though stupidity, apparently, does."
                        --- Dave Connors <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to