% Extrakce vsech stranek krome posledni, nutno rucne zadat rozsah stran
\documentclass[a4paper]{article}
\usepackage{pdfpages}

% zadej cestu ke clanku
\newcommand{\pdfpath}{../clanek-jmo.pdf}

\pdfximage{\pdfpath}
\newcounter{mycounter}
\setcounter{mycounter}{\the\pdflastximagepages}
\addtocounter{mycounter}{-1}

\begin{document}
    \includepdf[pages={-\themycounter}]{\pdfpath}
\end{document}