[Ipe-discuss] Plot data extraction from PDF

T T t34www at googlemail.com
Mon Dec 28 16:49:06 CET 2009


Hi,

I'm in need of a tool that can extract XY data from (vector!) plots in
PDF documents. Failing to find such a tool I'm considering writing one
and Ipe looks attractive, because:
- it can read PDF files (with pdftoipe tool)
- it is scriptable with Lua and I happen to know this language a little bit

As I'm unfamiliar with implementation and object hierarchy of Ipe, I
would appreciate some guidance in how to implement a plug-in with the
following methods:
(1) Coordinate system: establish the plot coordinate system from two
selected marks (if not given use canvas coordinate system)
(2) Line plot: get points from selected path(s), transform them to the
plot coordinate system and display in the text box
(3) Scatter plot: given a selected path, find all other paths that
differ only by translation and display "center of mass" points of
those paths in the text box.

(1) should be quite straightforward to implement. I reckon I only need
to validate selection for marks and design a dialog to enter
coordinates for selected marks.

For (2) I need to figure out how to get vertices on the path.

The most challenging is (3) and I don't yet have a clear idea how to
go about it. Maybe get the "center of mass" of each path (how?),
translate them to the origin, serialize and compare resulting XML
strings with the selected path.

Cheers,

Tomek



More information about the Ipe-discuss mailing list