I'd like to produce image files (JPG would be mostly
prefered but virtually any other format will make me
happy at this stage) from my work and be able to
present them as a set of slides, "a movie" etc.
Is it doable and if so, how? If not, why not?
--
Vänligen
Konrad
---------------------------------------------------
Sleep - thing used by ineffective people
as a substitute for coffee
Ambition - a poor excuse for not having
enough sence to be lazy
---------------------------------------------------
> I'd like to produce image files (JPG would be mostly
> prefered but virtually any other format will make me
> happy at this stage) from my work and be able to
> present them as a set of slides, "a movie" etc.
>
> Is it doable and if so, how? If not, why not?
Did you simply try the following?
convert image.pdf image.jpg
Convert is in the imagemagick set of programs:
http://www.imagemagick.org/script/index.php
If you are on Linux you'll probably have it already installe. On othe
systems installation is easy.
HTH,
gm
--
Guido Milanese
http://docenti.unicatt.it/milanese_guido
http://www.arsantiqua.org
Alternatively you could create a multipage PDF, which contains one
frame per page. Then create a Flash file from it, using
`swftools' (http://www.swftools.org/), for embedding into html or PDF
(via LaTeX package `movie15' [available on CTAN]).
Either method preserves the original vectorial property and
scalability of the graphics (no rasterization).
Alexander
>I'd like to produce image files (JPG would be mostly
>prefered but virtually any other format will make me
>happy at this stage) from my work and be able to
>present them as a set of slides, "a movie" etc.
>
>Is it doable and if so, how? If not, why not?
JPG?!? I would surely go with png...
Michele
--
>It's because the universe was programmed in C++.
No, no, it was programmed in Forth. See Genesis 1:12:
"And the earth brought Forth ..."
- Robert Israel in sci.math, thread "Why numbers?"
JPG is more commonly used here but the format isn't really
an issue as long as i get to obtain the actuall image files...
Judging from the replies i suspect that i've failed to ask
the right question. I don't wonder about file format nor
do i try to create an actual animation/presentation. That
was only an example, which, obiously, didn't do the job.
Sorry for confusion.
What i was wishing for is a way of obtaining _AN_ image
file, corresponding to whatever there might be in the
image created by PSTricks.
By other words, i'd like to know how to PSTricks-ify an
illustration (to a SOMETHING-file) so that i'll be able
to do _ALL_ of the following.
a) include the image using \includegraphics
b) put the image on a webpage
c) e-mail the image to a friend
d) edit the image in, e.g. Photoshop
e) all i'm not thinking of right now but will do later :)
Is such an operation doable? (I really do hope that i
managed to make myself clear this time.)
I'm thinking to
\documentclass{minimal}
\usepackage{pstricks,...}
\begin{document}
\begin{pspicture}
...
\end{pspicture}
\end{document}
and then
latex file
dvips -E -o file.eps file
Now that you have an EPS file, you can convert it into whatever format
you prefer.
Ciao
Enrico
I'll try to do that and let's hope that it's working. In
any case, that _SEEMS_ like the thing i ment to ask.
Once again - sorry for the confusion and thanks for
the help.
You might also look into the pst-pdf package. While it is designed to
enable you to use pstricks with pdfLaTeX, a useful side-effect is that
it creates PS and PDF documents that contain nothing but your PSTricks
graphics, one to a page. You can extract the page(s) desired and convert
them to whatever format you like. Note that depending on how you create
your PSTricks graphics you might be wise to use the pdfcrop Perl script
along the way (the auto-pst-pdf package is useful for learning about
this), though if you're converting the images to another format it might
be easier to crop them, if necessary, using another tool.
Alan
>Judging from the replies i suspect that i've failed to ask
>the right question. I don't wonder about file format nor
>do i try to create an actual animation/presentation. That
>was only an example, which, obiously, didn't do the job.
>Sorry for confusion.
>
>What i was wishing for is a way of obtaining _AN_ image
>file, corresponding to whatever there might be in the
>image created by PSTricks.
Didn't ImageMagick's convert, which someone suggested, work? How so?
>> JPG?!? I would surely go with png...
>
>JPG is more commonly used here but the format isn't really
>an issue as long as i get to obtain the actuall image files...
The fact is that jpeg is not really well suited for *this* kind of
images: it will probably give you less compression than png and surely
degrade the quality at the same time.
> I have a document that using PSTricks to create some
> fairly advanced images (YMMV, of course). Everything
> works as i'd like it to, when compiling the source code
> to a PDF. As you surely have understood by now, i'm
> not posting solely to inform the usenet community
> about that fact. No, i have an issue and it is as follows.
>
> I'd like to produce image files (JPG would be mostly
> prefered but virtually any other format will make me
> happy at this stage) from my work and be able to
> present them as a set of slides, "a movie" etc.
>
> Is it doable and if so, how? If not, why not?
I think you're looking for the great preview-package:
<http://www.dante.de/CTAN/help/Catalogue/entries/preview.html>.
The purpose it was made for, but not limited to:
<http://www.gnu.org/software/auctex/preview-latex.html>.
I use it to get correctly boundingboxed (e)ps or pdf image files of my
individual PSTricks or pgf/TikZ-pictures to pass them along to publishers
(for \includegraphics'ing) who can't (won't) deal with anything more than
their own (sometimes horrible) style files and some standard packages.
Erik
The preview-package is indeed a very useful package, especially when
used together with pdftex.
When generating images for use in the PGF and TIkZ gallery [1] I
maintain, I use the following command (using Ghostscript):
> gs -dNOPAUSE -r400 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sDEVICE=png16m -sOutputFile=figure.png -dBATCH figure.pdf
(On Windows the command is gswin32c. )
You can change the DPI of the image with the -r option. I usually
create images with high resolution and then downscale them to get
better antialiasing. As input I have a PDF document with a tight
bounding box[2] created using the preview package.
[1] http://www.fauskes.net/pgftikzexamples/
[2] http://www.fauskes.net/nb/latextips/#standaloneEPSPDF
Regards,
Kjell Magne Fauske
use the config file
http://perce.de/LaTeX/pst-pdf/pst-pdf.cfg
and put it in your pst-pdf directory or anywhere else where
TeX will find it. Then use package pst-pdf and run ps4pdf
and you'll get single files like pictureX.eps, when you insert
at the end of your doc \savePics.
Alternative to ps4pdf run
latex <file.tex>
dvips -Ppdf -o <file-pics.ps> <file.dvi>
ps2pdf -dAutoRotatePages=/None <file-pics.ps> <file-pics.pdf>
pdflatex --shell-escape <file.tex>
Herbert
--
http://PSTricks.tug.org
http://tug.org/CTAN/info/math/voss/
>> I have a document that using PSTricks to create some
>> fairly advanced images (YMMV, of course). Everything
>> works as i'd like it to, when compiling the source code
>> to a PDF. As you surely have understood by now, i'm
>> not posting solely to inform the usenet community
>> about that fact. No, i have an issue and it is as follows.
>>
>> I'd like to produce image files (JPG would be mostly
>> prefered but virtually any other format will make me
>> happy at this stage) from my work and be able to
>> present them as a set of slides, "a movie" etc.
>>
>> Is it doable and if so, how? If not, why not?
>
> use the config file
> http://perce.de/LaTeX/pst-pdf/pst-pdf.cfg
>
> and put it in your pst-pdf directory or anywhere else where
> TeX will find it. Then use package pst-pdf and run ps4pdf
> and you'll get single files like pictureX.eps, when you insert
> at the end of your doc \savePics.
I'm getting errors as the command \savePics does not get
recognized as a valied control sequence. My guess is that
i haven't placed the file pst-pdf.cfg in a right spot. Can
there be an other explanation?
I placed the \savePics _exactly_ at the en of the document,
as you told me to - the only line after it is \end{document}.
I tried to put the file in the same directory as an other
CFG-file i've found in the MiKTeX directory structure,
if that's of any help.
> Alternative to ps4pdf run
> latex <file.tex>
> dvips -Ppdf -o <file-pics.ps> <file.dvi>
> ps2pdf -dAutoRotatePages=/None <file-pics.ps> <file-pics.pdf>
> pdflatex --shell-escape <file.tex>
--
I also tried to play around and moved the \savePics outside
the scope of the document. That gave me a better result
while doing the [1] and [2], so get the PS-file looking just
as it's supposed to.
Then, when i try the [3] i get error looking like
Error: /undefinedfilename in (/None)
and then the tale dies. What should i do?
I cannot help you yet, sorry. But:
Please post minimal full example. Also what your OS and program
versions are. Below is a link to gs 8.54 ps2pdf documentation:
http://ghostscript.com/doc/8.54/Ps2pdf.htm
I recommend also to bookmark the base link and spend a few minutes a
day or so familiarizing yourself with gs and its many utilities. I
guarantee it is invested time well spent.
Regards,
Gernot
--
Grrr!! ...Pick a reason...
>> I tried to put the file in the same directory as an other
>> CFG-file i've found in the MiKTeX directory structure,
>> if that's of any help.
did you updated the file data base?
> 1] latex <file.tex>
> 2] dvips -Ppdf -o <file-pics.ps> <file.dvi>
> 3] ps2pdf -dAutoRotatePages=/None <file-pics.ps> <file-pics.pdf>
> 4] pdflatex --shell-escape <file.tex>
>
> I also tried to play around and moved the \savePics outside
> the scope of the document. That gave me a better result
> while doing the [1] and [2], so get the PS-file looking just
> as it's supposed to.
>
> Then, when i try the [3] i get error looking like
> Error: /undefinedfilename in (/None)
> and then the tale dies. What should i do?
you can try it with this example file
\listfiles
\documentclass[a4paper,10pt,ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage{pst-pdf}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(-0.5,-0.75)(2,2)
\psaxes{->}(0,2)
\psline[linewidth=1.5pt](2,2)
\end{pspicture}
\savePics
\end{document}
the \savePics command is only active in the last pdflatex
run and can only work when the image container was succfull
created with the ps2pdf command.
With this example I got a picture1.eps file.
Hi, on my Debian unstable i386 system with TeXLive 2007 I followed the
example (saved as pdftest.tex) and follow the below steps:
,----
| (pst-pdf) ----------------------------------------------------
| (pst-pdf) latex pdftest.tex
| (pst-pdf) dvips -o pdftest-pics.ps pdftest.dvi
| (pst-pdf) ps2pdf pdftest-pics.ps
| (pst-pdf) ----------------------------------------------------
`----
It works, but I do get an error on \savePics in the initial latex run,
which I ignore (press ENTER) and output is successfully created. A
similar error occurs in the last run of "pdflatex --shell-escape
pdftest.tex", shown below. I press ENTER at the question mark and the
program continues to completion.
,----
| ...
| <use pdftest-pics.pdf, page 1>
| ! Undefined control sequence.
| l.14 \savePics
|
| ?
| [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map} <./pdftest-pics.pdf>]
| (./pdftest.aux)
|
| *File List*
| article.cls 2005/09/16 v1.4f Standard LaTeX document class
| size10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
| fontenc.sty
| t1enc.def 2005/09/27 v1.99g Standard LaTeX file
| pst-pdf.sty 2006/08/31 v1.1o PS graphics for pdfLaTeX (RN,HjG)
| graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
| keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
| graphics.sty 2006/02/20 v1.0o Standard LaTeX Graphics (DPC,SPQR)
| trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
| graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
| pdftex.def 2007/01/08 v0.04d Graphics/color for pdfTeX
| pstricks.sty 2006/08/10 v0.32 LaTeX wrapper for `PSTricks' (RN,HV)
| pstricks.tex 2006/12/22 v1.15 `PSTricks' (tvz)
| xcolor.sty 2005/12/21 v2.09 LaTeX color extensions (UK)
| color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
| preview.sty 2006/05/25 11.83 (AUCTeX/preview-latex)
| dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
| pstricks-add.sty 2005/03/03 package wrapper for pstricks-add.tex (hv)
| pstricks-add.tex 2006/11/22 v2.82 `PSTricks-add' (hv,dr)
| pst-xkey.tex 2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
| xkeyval.sty 2006/11/18 v2.5f package option processing (HA)
| xkeyval.tex 2006/11/18 v2.5f key=value parser (HA)
| supp-pdf.tex
| pdftest-pics.pdf Graphic file (type pdf)
| ***********
|
| ){/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-t1.enc}</usr/share/texmf-
| texlive/fonts/type1/bluesky/cm/cmr10.pfb></usr/share/texmf/fonts/type1/public/c
| m-super/sfrm1000.pfb>
| Output written on pdftest.pdf (1 page, 8059 bytes).
| Transcript written on pdftest.log.
`----
> I placed the \savePics _exactly_ at the en of the document,
> as you told me to - the only line after it is \end{document}.
>
> I tried to put the file in the same directory as an other
> CFG-file i've found in the MiKTeX directory structure,
> if that's of any help.
I do not use MikTeX, maybe that there is a problem with the
optional arguments under Windows. The config file which use
the command
pdftops -f 1 -l 1 -eps <pdffile>
with
latex <file.tex>
dvips -Ppdf -o <file-pics.ps> <file.dvi>
ps2pdf -dAutoRotatePages=/None <file-pics.ps> <file-pics.pdf>
you'll get the image-conatiner file-pics.pdf, which collects
_all_ images as single pdf pages. You can convert each page with
pdftops, for example the third image
pdftops -f 3 -l 3 -eps <pdffile>
\savePics does nothing else than using this command in
a loop for all images.
All right, i corrected a bunch of errors and i get a PDF-file
called test03-pics.pdf containing one image per page (each
page totally filled by its image). However, i still don't get
any EPS-files...
Also, for some reason, the commands nag that i can't use
\write18 and need to use --shell-escape, which i do, as i've
been told to... What more can i do?
Hmm... Looks like i don't have pdftops on my computer. May
i drop by and borrow yours, mr Voss? :)
Let's hope there is such an utility for WindowsXP...
> The config file which use the command
>
> pdftops -f 1 -l 1 -eps <pdffile>
>
> with
>
> latex <file.tex>
> dvips -Ppdf -o <file-pics.ps> <file.dvi>
> ps2pdf -dAutoRotatePages=/None <file-pics.ps> <file-pics.pdf>
>
> you'll get the image-conatiner file-pics.pdf, which collects
> _all_ images as single pdf pages.
So basically, what i understand is that my issue right now is
simply this - how to convert an PDF-file to a series of images
(JPG, preferably, but EPS works great too) while working
under WindowsXP. Thoughts?
> You can convert each page with
> pdftops, for example the third image
>
> pdftops -f 3 -l 3 -eps <pdffile>
>
> \savePics does nothing else than using this command in
> a loop for all images.
It seems that pdftops doesn't exist for WinXP. Anybody
having suggestions how to deal with that?
By the way - great thanks for helping!
| So basically, what i understand is that my issue right now is
| simply this - how to convert an PDF-file to a series of images
| (JPG, preferably, but EPS works great too) while working
| under WindowsXP. Thoughts?
The ImageMagick package, which exists for all usual platforms, has a
command "convert" for this.
cheers,
--
Jean
Looking at their site i think to myself - "boy, that one heavy
tool for my simple task..." - but if there's nothing else to use,
then it'll be it. First thing in the morning!
Thanks.
I've been sitting with the ImageMagick for a few minutes now
and of what i can understand, it can't read PDF-files. Have i
misunderstood something, perhaps?
How exactly would one go about an operation that i've
described, using ImageMagick? I start it as an external,
stand-alone application, since that's what i've read on their
webpage. Is it correct?
ImageMagick uses Ghostscript to do the conversion from PDF and PS/EPS
to bitmap formats. Take a look in the file delegates.xml to see the
details. It basically runs the same command as I posted earlier.
The problem may be that ImageMagick can't find the gs or gswin32c
executable.
Regards,
Kjell Magne Fauske
I'd say that imagemagick is not particularly useful for this job. It needs
ghostscript to do anything with pdf files, and ghostscript can write to
output formats you want.
For what it's worth, pdftops is available for Windows. See
ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02-win32.zip
It's enough if you want to get eps files, but not necessary if you already
have ghostscript. The simplest way to convert all the pages of a pdf file to
a graphic format is to use gs from the command-line:
gs -sOutputFile=file-page%02d.png -sDEVICE=pngalpha -r300 -dNOPAUSE file.pdf
For text and line-art graphics, png is a superior format to jpeg.
--
Patrick TJ McPhee
North York Canada
pt...@interlog.com
I still get errors. Something about
-dvar=name requires name=null, true or false
The whole affair turned out to be a lot more complicated
than what i originally expected. I'm guessing, i had a
miscarriage for an idea, hehe.
>> ps2pdf -dAutoRotatePages#/None <file-pics.ps> <file-pics.pdf>
>
>
> I still get errors. Something about
> -dvar=name requires name=null, true or false
I have no crystal ball ...
>
> The whole affair turned out to be a lot more complicated
> than what i originally expected. I'm guessing, i had a
> miscarriage for an idea, hehe.
No, this is what I do everytime when submitting an article
with the graphics as single files. It alsways works for me.
Thanks. It worked! It was one heavy offspring to a
woman working nights in the entertainment business
to get it working, most likley due to my sorry
incompetence. Great appreciation to all who sweated
with me. Thank you.
>>> ps2pdf -dAutoRotatePages#/None <file-pics.ps> <file-pics.pdf>
>>
>>
>> I still get errors. Something about
>> -dvar=name requires name=null, true or false
>
> I have no crystal ball ...
I guess i was hoping for a general, well-known error. You
have to admit that sometimes you make an educated guess
that is 100% right. Anyway, combining what you've written
before with some other hints, i finally got what i wished.
Couldn't do that without the help. Thanks!