[Ipe-discuss] Script to export all views from all pages of the Ipe drawing
wzab01 at gmail.com
Sun May 13 18:11:41 CEST 2018
I often use Ipe to prepare animated (i.e., incrementally displayed on
drawings for my presentations in beamer.
The "iperender" tool allows exporting a single view.
However, I need an automatic tool, that is able to export all the
views in the separate files,
located in another directory. That allows me to use it in a Makefile
prepared for conversion
of the figures, as shown below:
In the Makefile:
ipescript expallviews $*.ipe ../figures_processed
If I have a figure "my_figure.ipe", that contains a few views in the
page 1, then I can include it in my presentation as shown below
In the presentation.tex file:
At the end of that message I attach the source code of my
The code is published as PUBLIC DOMAIN or under Creative Commons
CC0 license, whatever better suits your needs.
The code is published without any warranty. You use it on your own risk.
With best regards,
==== expallviews.lua =====
-- This is the script for exporting all views from all pages
-- in the IPE drawing.
-- I use it to export animated figures for beamer presentations.
-- Based on the information from
-- This script was written by Wojciech M. Zabolotny
-- ( wzab01<at>gmail.com )
-- and is published as Public Domain or under
-- Creative Commons CC0 license, whatever better suits your needs.
-- At the moment I can only epxort figures in PDF 1.4 format.
-- (iperender exports in PDF 1.5, but exportView in PDF 1.4)
if #argv ~= 2 then
io.stderr:write("Usage: ipescript expallviews <inputfile> <outputdir>\n")
doc = ipe.Document(fname)
-- Prepare the base file name for the output files
-- Remove the directory part (if exists)
-- reverse the string. to make searching for last "/" and "." easier
i = fbase:find("/",1,"plain")
if (i) then
i = fbase:find(".",1,"plain")
if (i) then
-- Add the output directory to the base filename
fbase=argv .. "/" .. fbase
-- Now we can convert all the views from all pages
--print(fname .. " contains " .. np )
nv = pg:countViews()
--print(fname .. " page " .. p .. " contains " .. nv .. " views")
fout=fbase .. "-p-" .. p .. "-v-" .. v .. ".pdf"
--print("exporting to: " .. fout)
More information about the Ipe-discuss