Josh's thoughts helped me conceive a new way of handling this. In v0.1 we started with a map, and in a series of loops, built a bunch of different layouts.
For v0.2, I took a somewhat different tack: 1) Start with a complete layout. The user should have everything set just the way he/she likes it, just as if he/she was about to press the print button. 2) Capture some basic info about the layout (such as its name and size). 3) Search through the layout for maps. Find the map occupying the most area on the layout [I often put an inset map on my layouts, so we'll want to differentiate], and get info about it (such as location). 4) Move this map off of the layout and print to PDF. This will give us a PDF layer containing ALL annotations except for the map: titles, images, legends, and anything else found on the layout. 5) Drop everything on the layout. 6) Cycle through layers, and determine which are shown and which are hidden. 7) Turn off all layers in the map. Place the map (with all layers off) in the layout and print. This will cause all of the annotations on the map itself (e.g. north arrows, freehand items) to print in their own layer. 8) Drop all annotations from the map so that they'll show up only in the one layer. 9) Cycle through all layers in the map, turn them on in turn (only the ones that were initially shown, of course) and each to its own PDF. 10) Close everything down and print a happy message. There are still some issues that need to be dealt with (see "the known issues section" at top of the file). And there are sure to be additional things that I have not anticipated. Give it a whirl and post comments to the list. I'm about to get busy at work, so I won't have much time to work on this... but we now have enough of a skeleton that people can agree to work on smaller pieces. P.S. Text items (labels, legend text, titles) appear to be searchable in the PDFs. Don't know how that will play out when you create the layered document. --- In [email protected], "Josh Rosenthal" <[EMAIL PROTECTED]> wrote: > > Moshe, > > 1) Agreed on dispensing with the picklist, although, in all honesty, a > robust version of the code should have it, as the goal for any such snippet > is to minimize the effort involved in going from a dataset to the final > product, and having to remove layers from a file has the potential to get > repetitive. That said, I'm all for it not being around for now. Mike, > Larry, you've both got immediate applications for this code. Any thoughts? > > 2) Interesting, but I suspect we'll need the printer preset for the layout > to work anyway (try seeing what happens when you make a layout with a paper > printer, draw a view, and change the printer to PDF Creator. I always get a > strange shift in map view location to be offcenter, even if the paper size > of my printer matches the size for the PDF printer). Thus, if we can > require that as part of our spec for the user when building a template, and > then directly use the printer from there, this would be ideal. > > 3) I'm actually not sure why we need to create separate layouts. Can we > not set the map view to our map, and refresh it programmatically, or is > there some other reason I'm missing? > > 4) I like the solution of the legend as a separate layer. In Acrobat you > can set the layer to always display, or make it part of the base layer, > etc. Should be nice. > > 4.5) Text & Searchable Text. Sadly, before I had to leave my > maptitude/acrobat setup on friday I didn't have time to explore this > completely. Here is what I have. > > One of the great joys of PDFs is that text is searchable, and as such, that > labels, if converted to text, are also searchable. Unfortunately, when > testing, I was unable to get automatic labels into the PDF (this may have > been my system which was in desperate need of a reboot towards the end of > the day), and only could get searchable labels by producing a series of > manual labels, turning off the layer, refreshing the layout (now showing > only the labels), and printing to PDF. This AnnotationLayer PDF, once > brought into Acrobat, was searched when one uses the find function in > Acrobat. You will *not *see this behaviour in the current Proof of > Concept uploaded as that was based on PNGs, rather than directly being > output to PDFs. Note that if someone wants to have some annotations > searchable, and others not searchable (eg: don't search in the > boilerplates), the solution is to have some be images, and others text. > > Problems with Searchable Text. > a) Does it work for Automatic labels? If it does, it seriously raises > question if what follows is necessary. I still think it'd be nice, but > maybe not necessary. Certainly for zoom controlled annotations we'll need > them in separate layers. I suppose if it does work, the ideal would be to > have a variable that would say whether or not to separate annotations from > layers or not. > b) In any case, in theory, one wants searchable text to be in its own > separate layer. > Annotations are great, but they can easily hide data. Especially if > multiple layers have annotations.Thus... I guess... > > > - Turn on layer, > - show labels > - (if necessary?... should be able to spec that if you want a label > layer, create them as part of your base map and have them on, > thus, we check > to see if we should create labels by seeing if they're already there), > - convert to graphics, > - turn off layer, > - refresh layout, > - print, > - delete all graphics in map > - turn on layer, > - turn off labels (if necessary?), > - refresh layout, > - print, > - turn off layer, > > rinse repeat. Every layer (or every layer with labels) would thus get a > separate annotation PDF produced. > > c) Acrobat Search pans, not zooms. This is an ugly problem, even in a full > GIS. What should it zoom to? This can be dealt with by using bookmarks in > Acrobat rather than encouraging searching, but this is only a partial > solution. Not a maptitude problem, in any case. A better zooming solution > may be the key. The ideal of course, would be a way to use Acrobat (which > does know font size), to display at font size rather than zooming. Not > quite sure how that is accomplished though. > > 5) Legends... I'm not quite clear on how determining legend placement will > work. How can it be in a template, if the user cannot have it in a template > because there is no filled map? > > I do like the line of thinking with the layout naming scheme and the legend > logic (and layer order placement). Should make potential scripting easier > for the other side of things. Very nice. Also, I'm sure you're right about > PDF Creator, but as you pointed out, Acrobat can do this, and for the moment > we are assuming users will have acrobat handy (although, using iText would > allow this to function without a copy of Acrobat... which would mean > Maptitude layered PDF support using only maptitude and free products). > > In any case, very cool. > > Thanks a lot, > Josh > > Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/Maptitude/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/Maptitude/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
