Vous (Craig Ringer) avez écrit : > Hi > > I've bashed out an initial implementation of Lua-based imposition plans. > It's not hooked up to the main podofoimpose code yet, but so far it > looks to be embarrassingly simple. I really only have to export one > function to the Lua interpreter (to register a new imposition record) > and push a couple of environment variables in to the initial execution > context. > > I'll attach the code - which hasn't been built and will need fixes since > I've done a less comprehensive reading of the Lua docs than I should've > - to give you a vague idea what's involved. > > The Plan class is very close to the existing PageRecord class; I > should've just separated that out instead. > > I should have a working patch plus some sample plans over the next few > days, though that depends a lot on just how busy those next few days are. > > This is just code intended as a guide for how it'll look. It can replace > the parser and expression evaluation stuff in podofoimpose entirely. > Additionally, it'd be possible to use a SAX parser to load imposition > plans from XML rather trivially, too, since the Plan structure is > entirely separate from any podofoimpose implementation details. This > should make people who want to write GUI planners in other languages and > use the podofoimpose executable as a backend happy. > > Like where I'm going? > > -- > Craig Ringer
Wow, i’ve wrote something with almost similar design this afternoon! Although i’ve began by reimplementing the actual code in a separate class first, what led me to deeply clean up pdftranslator class. I guess there aren’t too much options then and i will happily mix your code with mine. As the only _big_ difference with what I write is that "addrec" would be "PushRecord", even your PLAN files should easily convert. Oh, there is something different, I would not provide other set/get method than setNumber/getNumber. Here we say : "les grands esprits se rencontrent" :) Note: If at first I just wrote 2 classes ReadPlan_legacy and ReadPlan_Lua, I know think to have a base class ReadPlan and implement something like "strategy" pattern to pickup the right descendant depending of user input or automatic detection. What do you think? -- Pierre Marchand ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Podofo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/podofo-users
