Moshe, Thanks for taking up the torch. I haven't tried out the code and will do so monday when I get back to a friendly copy of maptitude. A few thoughts. * Assumptions:* 1), 2) good. (I'll try and see if PDF Creator uses a reliably standard printer install name we could assume and work with to avoid requiring constant changing of default printers, and just set the name as a variable. Earlier testing indicated it did, and that one could use the Acrobat PDF converter printer equally, but I'll look at that again later.)
3) Rather than assume paper size, could we assume an open layout with an empty map frame. This should allow a user to build their own templates controlling paper size and layout annotations they might want. We might also have the system create a print with the map frame empty just showing any annotations on the layout itself for use as the initial PDF. 4) Conceptually, the Legend behavior is problematic. Strictly speaking, we want to somehow capture the complete legend, with all layers, but we'd want that to be able to be displayed on all layers (or on our annotation layer?), and allow user control of location in the template, (or only display the relevant part, but in a related but not overlapping location). Not sure how that could be done, to display a legend that doesn't actually represent the frame shown?. For now, it makes sense to leave it out, I guess. (Could one, in theory, create a map frame, thus generating the legend, and then hide it by moving it out of sight, or deleting it, and still retain the legend?) *Structure Notes:* Given (3) above, Loop 2 would then change the layers and (after the first time) refresh the frame rather than opening a layout. In theory we could do this by opening a layout arbitrarily named (ie: "PDFLtemplate.lay") rather than using an open layout. *Labels:* Also... so far, I've only had searchable labels work when I make them manual labels, ie: objects. This requires more testing, but how could we capture those on their own layer(s) without having them show up in multiple layers, or otherwise getting lost. Possible solution: For each "On" layer, print twice. First time, as normal. Second time, turn on the layer, convert labels to graphics, turn off labels, refresh layout, and print. How we keep track of those annotations to delete them before we iterate, I'm not sure of. *Printing Invisibly*: Printing from PDF Creator currently requires user involvement (entering name, created by, save locations, etc). I know in theory there are ways to use it in assorted batched work. Anyone out there have any experience in this? That said, I like it! Next step (which may be beyond me, but I'll take a look and at least try to get a sense of how it should be done) would be to script the acrobat side of things. Thanks a lot! Josh Rosenthal GIS Supervisor Massachusetts Historical Commission On Jan 11, 2008 5:29 PM, Moshe Haspel <[EMAIL PROTECTED]> wrote: > --- In [email protected] <Maptitude%40yahoogroups.com>, "Josh > Rosenthal" <[EMAIL PROTECTED]> > > > > Anyone want to write a DK script to cycle through a user selected > subset of layers in a map, use a layout as a template and using > Printer=PDFCreator produce all the component layers? > > == > > I'll take the first crack at this... A little unfair because I am > tearing off some of the easiest parts. > > For the purposes of a quick solution, I am going to assume: > 1) All non-hidden layers in the map should be printed > 2) PDFCreator is selected as the default printer in windows > 3) The map is to be on an 8.5x11 "paper" > 4) There is no map legend > 5) Other stuff I haven't considered yet??? > > We can always relax these assumptions later. > > The code (which I will upload to the Files area as "Layers2PDF > v0.1.rsc") loops through all layers three times: > > Loop 1: For each layer, store whether it is "hidden" or "shown." Then > hide it. > > Loop 2: For layers that were found to be "shown" in Loop 1, show each > one by one, open a layout, put the map with just that layer shown in > the layout, and print. Then hide the layer again. > > Loop 3: Restore all layers to their original status. > > >
