2

I would like to place a series of photos (image_1.png,...,image_54.png) from a file named flip_book_animation, in the upper right corner of every page starting from the seventh page onwards. The document is written in greek. I have read several posts but I can't find something that finally works. The code I use doesn't seem to work either. Instead of the image it shows 'scale=0.5', which I use in the code, translated in the greek language. Some code I use:

\documentclass[a5paper,pagesize,12pt,bibtotoc,pointlessnumbers,
normalheadings,twoside=false,DIV=9]{scrbook}

\usepackage[english,greek]{babel}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{kerkis}

\usepackage{verbatim}
\usepackage{everypage}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{scalefnt}
\usepackage{flipbook}

\fancyhead[R]{                           
\setlength{\unitlength}{0.5cm} 
   \begin{picture}(1,1.6) 
      \put(0,0){
          \fbImageF*{./Documents/latex/Book_Olympios/flip_book_animation/image_}{png}{scale=0.5}
     }
 \end{picture}
}

and the result is

enter image description here

Any feedback is highly appreciated! Thanks

Adam Liter
  • 12,567
white_x
  • 41

1 Answers1

2

Starting with my answer at What are the ways to position things absolutely on the page?, I modified it to increment a counter and use it to build successive indexed filenames. I manually add a stop so that if the page number exceeds the maximum filename index, it just stays on the last filename.

The macro \animatexy{x}{y}{filename root} is the syntax.

I extracted four frames from the example at http://www.teach-ict.com/gcse_new/software/animation/miniweb/pg3.htm and named then frame1.jpg, frame2.jpg, frame3.jpg, and frame4.jpg. Page 5 and thereafter, as seen, will be stuck on the last frame (#4), though one could create a blank image in frame5.jpg, and then there would be no visible images after frame 4.

\documentclass{article}
\usepackage{everypage, graphicx}
% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcounter{framenumber}
\newcommand\animatexy[3]{%
 \gdef\thefilename{#3\theframenumber}%
 \AddEverypageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
  \raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{%
  \includegraphics{\thefilename}}}}%
}
\AddEverypageHook{\stepcounter{framenumber}%
  \ifnum\theframenumber>4\setcounter{framenumber}{4}\fi}
\begin{document}
\animatexy{6.8in}{3in}{frame}
page 1
\clearpage
page 2
\clearpage
page 3
\clearpage
page 4
\clearpage
page 5
\end{document}

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here