English

How To: Export a layout or view document as an image using Avenue

Summary

You can use the ExportToFile request to export the contents of a view or layout as an image file.

Procedure

Keep the following in mind when using the ExportToFile request:

  • Syntax:

    Code:
    aDoc.ExportToFile (aFileName, aFormatString, aListOfParameters)

    Where:

    aDoc = a layout or view
    aFileName = the name of the image file
    aFormatString = the image format
    aListOfParameters = list of export options

    Examples:

    Code:
    '-- Attach this script to a button on the View GUI
    TheView = Av.GetActiveDoc
    TheView.ExportToFile("c:\filename.wmf".asfilename, "Placeable WMF", {300, TRUE} )


    Code:
    '-- Attach this script to a button on the Layout GUI
    TheLayout = Av.GetActiveDoc
    TheLayout.ExportToFile("c:\filename.wmf".asfilename, "Placeable WMF", {300, TRUE})

  • Export Options:

    Each image format offers different export options. You can examine the available options for each export format on the Export dialog box.

    1. Click Export from the File menu.
    2. Select an image format under 'List Files of Type'.
    3. Click the Options button

    Note:
    The Option button will not appear if the selected image format doesn't support export options. If options are available, the aListOfParameters must include a value for each parameter.

  • Availability of Export Options:

    Placeable WMF: Resolution and Enable clipping: {72,true} or {72,false} or {96,true} or {96,false} or {120,true} or {120,false} or {144,true} or {144,false}

    Windows MetaFile: Resolution and Enable clipping: {72,true} or {72,false} or {96,true} or {96,false} or {120,true} or {120,false} or {144,true} or {144,false}

    Windows Bitmap: Resolution: {72} or {96} or {120} or {144}

    PostScript (EPS): None

    PostScript New (EPS): Resolution: {300} or {360} or {600} or {720}

    Adobe Illustrator: None

    CGM Binary: Resolution: {300} or {360} or {400} or {600} or {720}

    CGM Character: Resolution: {300} or {360} or {400} or {600} or {720}

    CGM Clear Text: Resolution: {300} or {360} or {400} or {600} or {720}

    JPEG: Resolution and Quality: {72,20} or {72,40} or {72,60} or {72,80} or {72,100} or {96,20} or {96,40} or {96,60} or{96,80} or {96,100} or {120,20} or{120,40} or {120,60} or {120,80} or {120,100} or {144,20} or {144,40} or {144,60} or {144,80} or {144,100}