SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Vol 2

CAPTURE HTML

Name:
    CAPTURE HTML
Type:
    Support Command
Purpose:
    The CAPTURE HTML command redirects Dataplot alphanumeric output from the screen to the specified file and formats using HTML syntax. The END OF CAPTURE command reverts alphanumeric output back to the screen.
Description:
    The CAPTURE HTML command is useful for generating Dataplot output in a format suitable for viewing by a web browser such as Netscape or Internet Explorer.

    As of the 2013/12 version of Dataplot, most of the Analysis commands support HTML formatted output. The following are the Analysis commands that do not yet support HTML formatted output (these commands use the <PRE> ... </PRE> syntax, that is, an "asis" format).

      ARMA
      DDS
      ORTHOGONAL DISTANCE FIT
      PRE-FIT
      RECIPE
      SEASONAL LOWESS
      SIMCOV
      SMOOTH

    In addition, WRITE HTML can be used to generate 1-way tables in HTML format. This is described in more detail in a Note below.

    The CAPTURE HTML option can be used in conjunction with the WEB command. For example,

      SKIP 25
      READ RIPKEN.DAT Y X1 X2
      ECHO ON
      CAPTURE HTML C:\TABLE.HTM
      TABULATE MEAN Y X1
      CROSS TABULATE MEAN Y X1 X2
      END OF CAPTURE
      WEB file://C:\TABLE.HTM

    In addition, if DEVICE 2 is set to PNG, JPEG, SVG, or Postscript, Dataplot will incorporate the graphics into the web page using the IMG tag (the SVG device uses the EMBED tag). This is demonstrated in the sample program below.

    Note that for Postscript, Dataplot uses the Ghostscript command to convert the output to JPEG. A couple of points to note on this:

    1. This assumes that Ghostscript is installed on your system. For Unix platforms, Ghostscript is launched with a "gs" command. On Windows platforms, Ghostscript is launched with "C:\GS\GS704\GS\BIN\GSWIN32C.EXE".

      If you need to change the path for the Ghostscript command, enter the following command:

      SET GHOSTSCRIPT PATH

      For example, on my Windows system, I use

      SET GHOSTSCRIPT PATH F:\GS\GS704\GS\BIN\

      We suggest that you add this command to your Dataplot startup file "dplogf.tex".

    2. We suggest using either the ORIENTATION PORTRAIT or the ORIENTATION LANDSCAPE WORDPERFECT command to set the orientation. Plots with a landscape orientation are rotated in the Dataplot Postscript output (in order to make full use of the page). Currently, Ghostscript does not support a command line switch to rotate the graph. This means that landscape plots will be rotated vertically on the web page (you can use external programs to rotate the JPEG files if you like).

    The SET POSTSCRIPT CONVERT command can be used to automatically convert the Postscript output to one of several formats (JPEG, PDF, TIFF, PBM, PGM, PPM, PNM). If the output is set to PDF (Portable Document Format), the CAPTURE HTML command will incorporate the PDF (rather than the Postscript) file into the web page. For PDF files, Dataplot builds a link to the PDF file. The advantage of using PDF files is that they are typically of higher quality than the corresponding JPEG files. The disadvantage is that you have to link to the file rather than having it directly in the page.

Syntax:
    CAPTURE HTML <file name>
    where <file name> is the name of a file where alphanumeric output is written.

    If the file name does not contain a period, place a period (no spaces) at the end of the file name.

Examples:
    CAPTURE HTML FITOUT.HTM
    ... DATAPLOT COMMANDS ....
    END OF CAPTURE
Note:
    DATAPLOT has the following restrictions on the file name:

    1. The file name should be a valid file name on the local operating system.

    2. It must contain a period "." in the file name itself or as a trailing character. DATAPLOT strips off trailing periods on those systems where it is appropriate to do so. On systems where trailing periods can be a valid file name (e.g., Unix), DATAPLOT opens the file with the trailing period.

    3. On systems where file names are case sensitive (i.e., Unix), the case is preserved as entered on the CAPTURE command.

    4. The file name cannot contain more than 80 characters.

    5. If the file name contains a space, then use the SET FILE NAME QUOTE command and enclose the file name in quotes. For example,

        SET FILE NAME QUOTE ON
        CAPTURE "junk temp.out"
Note:
    The capture command can be toggled on and off (END OF CAPTURE redirects alphanumeric output to the screen). However, a new file name should be used each time since invoking a new CAPTURE command overwrites any existing file (END OF CAPTURE automatically closes the file).
Note:
    Dataplot provides the following switches for controlling what output Datplot generates:

      FEEDBACK <ON/OFF>
      PRINT <ON/OFF>

    The PRINT command controls most of the output generated by the Analysis category commands. Output from most other commands is controlled by the FEEDBACK command. The purpose of this distinction is to allow you to generate the output from commands such as FIT while suppressing most of the other output.

    When generating HTML format output, a common choice is

      PRINT ON
      FEEDBACK OFF
Note:
    You can create one-way tables using the command

      WRITE HTML <var-list>

    where <var-list> is a list of variables to print in an HTML table format. Note that this command is typically entered after a CAPTURE HTML command.

    The following commands can be used to control the appearance of the HTML table:

      SET TABLE TITLE <text> - allows you to specify a title for the generated table
      SET TABLE BORDER <ON/OFF/RULE/COLS> - specify what type of border the table will have
      SET TABLE SPACING <value> - specify a value for the CELLSPACING option in the <TABLE> element
      SET TABLE WIDTH <value> - specify the width of table columns in pixels

    The SET WRITE DECIMALS command can be used to specify how many digits after the decimal point will be printed (this will apply to all of the columns, currently there is no way to specify a different value for different columns).

    By default, the column headers will simply be the variable names. However, if you have entered a VARIABLE LABEL command for a given variable, the label specified for that variable will be used instead of the variable name.

Note:
    By default, Dataplot generates a fairly minimal header and footer for the HMTL output. You can specify your own header and footer files with the comamnds

      SET HTML HEADER FILE <file-name>
      SET HTML FOOTER FILE <file-name>

    Enter HELP HTML HEADER FILE or HELP HTML FOOTER FILE for details.

Note:
    Dataplot is not a word processor. The HTML code generated is fairly basic. That is, Dataplot creates the basic table or list structure for the output. However, it does not give you control over font sizes, colors, and so on. We have written the HTML in a style which we believe is human readable/editable.

    If you want to modify the appearance of the HTML output, our recommendation is to either edit the file using an ASCII editor or use one of the HTML editors (we have no particular recommendations on the advantages/disadvantages of the various editors).

Default:
    None
Synonyms:
    None
Related Commands:
    CAPTURE = Redirect alphanumeric output to a file.
    CAPTURE LATEX = Redirect alphanumeric output to a file in Latex format.
    END OF CAPTURE = Revert alphanumeric output back to the screen.
    LIST = Lists the contents of a file.
    CALL = Execute commands stored in a file.
    CREATE = Echo entered commands to a file.
    POSTSCRIPT CONVERT = Automatically generate JPEG, PDF, TIFF, PBM, PGM, PPM, or PNM from postscript output.
    HTML HEADER FILE = Specify a file to use for the header of the HTML output.
    HTML FOOTER FILE = Specify a file to use for the footer of the HTML output.
Applications:
    Web Output
Implementation Date:
    1/2004
Program:
        skip 25
        read gear.dat y x
        .
        line blank solid
        character x blank
        feedback off
        .
        capture html tabulate.htm
        .
        summary y
        tabulate mean y x
        tabulate sd y x
        .
        set ipl1na meanplot.jpg
        device 2 gd jpeg
        title mean plot
        y1label diameter
        x1label batch
        mean plot y x
        device 2 close
        end of capture
        .
        . file name below needs to be modified
        web file:///home/heckert/dataplot/solaris/tabulate.htm
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 01/31/2004
Last updated: 12/15/2013

Please email comments on this WWW page to alan.heckert@nist.gov.