I need to automatically print individual polygons that make up a table. I need them to be a close-up view of the polygon and print to a PDF file. It is very time consuming to print each one manually. I am thinking I will have to write a program to accomplish this, unless there is a tool that currently exists. Any ideas? The currrent process is to zoom in on the desired region until it fills the layout window. I then print the layout to a PDF, select the next region, and repeat.
You could use the code used in this example, but edit it to include syntax from PrintWin.
Having checked MapBasic help on my install, the help for PrintWin says:
Prints an existing window.
PrintWin [ Window window_id ][ Interactive ][ Fileoutput_filename ] [ Overwrite ]
window_id is a window identifier.
output_filename is a string representing the name of an output file. If the output file already exists, an error will occur, unless the Overwrite keyword is specified.
The PrintWin statement prints a window.
If the statement includes the optional Window clause, MapBasic prints the specified window; otherwise, MapBasic prints the active window.
The window_id parameter represents a window identifier; see the FrontWindow( ) function and the WindowInfo( ) function for more information about obtaining window identifiers.
If you include the Interactive keyword, MapInfo Professional displays the Print dialog box. If you omit the Interactive keyword, MapInfo Professional prints the window automatically, without displaying the dialog box.
Dim win_id As Integer Open Table "world"
Map From world win_id => FrontWindow( )
' ' knowing the ID of the Map window,
' the program could now print the map by
' issuing the statement:
PrintWin Window win_id Interactive
PrintWin Window FrontWindow( ) File "c:\output\file.plt"
So, with some tweaking and combining the 2 (and may be a sense check using this link, it should be possible to get a mapbasic driven process to step through your data and output a pdf file for each feature in the data.