Josh,

Great points.

Re assumptions, and your comments:

1) It looks like we are moving toward a model where the user gets the
map (and possibly a layout) exactly the way he/she wants it, then we
use those documents as models when printing the layers. So unless
anyone thinks we should do otherwise, I think we can dispense with the
layers picklist?

2) You can get a list of installed printers with GetPrinters()
e.g.
printers = GetPrinters()
ShowArray(printers)
Not sure how to use that info though... needs more research


3) This is a great idea. If the user designs a layout, we can probably
get the info we need using some combination of GetLayoutOptions() and
LayoutProperties()

GetLayoutOptions() has a SetLayoutOptions() counterpart. And
LayoutProperties() may even let us handle the printer issue.

Try this with an open layout:
properties = LayoutProperties()
ShowArray(props)

Again, needs more research.

But the important thing is that if the user places the map to his/her
preferred size, etc. we can get that info via GetAnnotation() and use
it when creating the separate layouts!

4) Actually, I don't think it needs to be that complicated. We'll
always want the legend to show up, so we just put it on its own
layer-- the last one that gets drawn. Legend placement, like map
placement, can be solved via GetAnnotation()-- find out where the user
put it in the layout template. 

The big problem that I had was that you can't place a legend in a
layout without placing its corresponding map in the layout as well. Or
if it is possible, I have no idea how. In fact, if you place a map and
legend in a layout, then remove the map, the legend goes bye-bye as
well! Your solution is brilliant-- just place the map off of the page. 

Re: labels, we can convert automatic labels to "freehand" with:
ConvertAutomaticToManualLabels(map_name)
HideMapLabels(map_name)

Then we can select them all and delete them with:
annots = SelectAllAnnotations("map|"+map_name)
DropSelectedAnnotations(annots)

Could you explain a bit more about the searchable text issue?

Re: Printing invisibly, I'm sure there is a setting somewhere in the
program that allows you to turn off "prompt for file name" or some
such. I know you can do this in Acrobat. Acrobat uses the window name
as the default name for the PDF; the script is gives each layout a
unique name so that the printing from the second time through the loop
won't overwrite the printing from the first time. In fact, the layouts
are named 01, 02, ... so that they will appear in alphabetical order. 

I'm posting a new version (v0.11) that has some legend handling logic.
Again, the paper size/shape, map placement and size, legend placement
 are just arbitrary things I chose for proof of concept. We'll need to
deal with them eventually. 


--- In [email protected], "Josh Rosenthal" <[EMAIL PROTECTED]> wrote:
>
> 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" <maric423@> >
> >
> >
> > 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.
> >
> >  
> >
>




 
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/
 

Reply via email to