Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Embedding images from an URL into a pdf

43 views
Skip to first unread message

rolandw

unread,
Oct 26, 2006, 8:07:24 AM10/26/06
to
I need to embed images from an URL into my TeX document. Instead of:

\includegraphics{myImage}

I would like to be able to do something like:


\includegraphicsfromurl{http://groups-beta.google.com/groups/img/3/groups_bar.gif}

Any suggestions?

Enrico Gregorio

unread,
Oct 26, 2006, 9:00:03 AM10/26/06
to
rolandw <rolandw...@gmail.com> wrote:

You can't embed an external image into a PDF file dynamically. This is
because the page description would be incomplete, being unknown the
dimensions of the image.

Links in a PDF file are only bound to actions: you can define a link
that shows the external image, but not as embedded in the document.
At least, this is what seems to be possible with Acrobat Pro.

Ciao
Enrico

Jonathan Fine

unread,
Oct 26, 2006, 10:28:18 AM10/26/06
to

"Enrico Gregorio" <greg...@math.unipd.it> wrote

> >
\includegraphicsfromurl{http://groups-beta.google.com/groups/img/3/groups_ba


r.
> > gif}
>
> You can't embed an external image into a PDF file dynamically. This is
> because the page description would be incomplete, being unknown the
> dimensions of the image.
>
> Links in a PDF file are only bound to actions: you can define a link
> that shows the external image, but not as embedded in the document.
> At least, this is what seems to be possible with Acrobat Pro.

I think the original poster wished to statically embed the
external image. Just as a file on the hard disk would
be embedded statically.

At least that's how I read the query.

--
Jonathan


Alexander Grahn

unread,
Oct 26, 2006, 10:30:26 AM10/26/06
to
If the image should remain external in the final document (which must
be a PDF) you can use the `movie15' package:

1.) Create a SMIL-container, such as `urlimage.smil':

<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
<body>
<img src="http://www.aadmm.de/images/gf1.gif"/>
</body>
</smil>

2.) Embed it into your document (pdfLaTeX, LaTeX/dvips/ps2pdf):

\usepackage{movie15}
...
\includemovie[poster]{.5\linewidth}{.754\linewidth}{urlimage.smil}

3.) Open the final PDF document with Adobe Reader on Windows or Mac
(QuickTime required). The image will be loaded from its URL once, upon
opening the page containing it for the first time. If you later go back
to the same page, the image will be immediately visible.

Alexander

Donald Arseneau

unread,
Oct 26, 2006, 3:50:23 PM10/26/06
to
"rolandw" <rolandw...@gmail.com> writes:


Read about \DeclareGraphicsRule in grfguide. Look at programs wget and curl.


--
Donald Arseneau as...@triumf.ca

Eric

unread,
Oct 27, 2006, 4:29:41 AM10/27/06
to
Donald Arseneau wrote:

> "rolandw" <rolandw...@gmail.com> writes:
>
>> I need to embed images from an URL into my TeX document. Instead of:
>>
>> \includegraphics{myImage}
>>
>> I would like to be able to do something like:
>>
>>
>>
\includegraphicsfromurl{http://groups-beta.google.com/groups/img/3/groups_bar.gif}
>>
>> Any suggestions?
>
>
> Read about \DeclareGraphicsRule in grfguide.

Possibly not useful in this case. I would write my own macro, which includes
an ordinary \includegraphics

> Look at programs wget and
> curl.

Yup. Use wget/curl/... to do the download to a temporary. Then use it.

You could write a macro that writes a bash script to do the download. Your
\includegraphicsurl calculates the local EPS file name, e.g.
tmp/url_1.eps,tmp/url_2.eps,... . It includes this if the file is present,
else it writes to a bash script file. You run this bash script and rerun
TeX.

--
Eric

Donald Arseneau

unread,
Oct 27, 2006, 5:11:39 AM10/27/06
to
Eric <er...@nospam.com> writes:

> Donald Arseneau wrote:
>
> > "rolandw" <rolandw...@gmail.com> writes:

> >> I would like to be able to do something like:
> >>
> \includegraphicsfromurl{http://groups-beta.google.com/groups/img/3/groups_bar.gif}
> >

> > Read about \DeclareGraphicsRule in grfguide.
>
> Possibly not useful in this case. I would write my own macro, which includes
> an ordinary \includegraphics

I was guessing that someone can use `wget in \DeclareGraphicsRule,
but there has to be a findable file with some extension before TeX
will execute the procedure given in the rule.

--
Donald Arseneau as...@triumf.ca

Alexander Grahn

unread,
Oct 27, 2006, 8:32:10 AM10/27/06
to
Donald Arseneau schrieb:

> I was guessing that someone can use `wget in \DeclareGraphicsRule,
> but there has to be a findable file with some extension before TeX
> will execute the procedure given in the rule.

\AtBeginDocument{\write18{wget -c http://somehost.com/image.jpeg}}

might do the job of fetching the file once (wget option -c), and
hopefully, well before executing \includegraphics.

Alexander

Heiko Oberdiek

unread,
Oct 27, 2006, 9:05:17 AM10/27/06
to
"Alexander Grahn" <a.g...@fz-rossendorf.de> wrote:

As Donald has written, this can be automated by the last argument
of \DeclareGraphicsRule. See also package epstopdf for pdfTeX.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

0 new messages