You have two issues with your code:
- inside
\href can not be nested \caption
- outside of
figure \caption{...} cannot be used. Instead of it you can use \captionof{figure}{...}. For this you need to use package caption or capt-of.
Correct code for both cases:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{hyperref}
\begin{document}
\begin{center}
\href{http://m.technologijos.lt/cat/7994/article/S-18917}{
\includegraphics[scale=1]{2}
}
\captionof{figure}{Pav. 2}
\end{center}
\begin{figure}[htb]
\centering
\href{http://m.technologijos.lt/cat/7994/article/S-18917}{
\includegraphics[scale=0.5]{2}
}
\caption{Pav. 2}
\end{figure}
\end{document}
\captionhad to be insidefigurefloat environment:\begin{figure} \includegraphics{...}\caption{...}\label{...}\end{figure}– Zarko Jan 28 '17 at 08:30captionpackage. See this answer for an explanation. If you are happy to use the figure or table numbering already provided by LaTeX, then\captionof{figure}{This is the caption.}does the job (having included\usepackage{caption}into the preamble). – gernot Jan 28 '17 at 08:38