KNOWLEDGEBASE - ARTICLE #586

How can I export bitmap or web graphics from a script?

Here is the syntax of the commands used to export bitmap or web graphics from a Prism script. For the formats that let you set resolution (dots per inch), enter 100, 300, 600 or 1200. You cannot enter other values. The default is 300 dpi.


  • ExportWMF [filename] (Windows only)
  • ExportEMF [filename] (Windows only)
  • ExportSVG [filename] 
    • ExportSVG exports the current graph or layout as a scalable vector graphic, ideal for web use and publications that will be viewed online. The color model is always RGB as SVG is designed for screen display and web compatibility. 
  • ExportTIF [filename] <resolution> <mode> <compress or LZW> 
    • This command allows you to export graphs or layouts in TIFF format at 100, 300, 600, and 1200 dpi. Low-resolution bitmaps work great if the goal is to display the graph on the screen (for example in a web page), but are not useful if the goal is to print a high-quality page. Choose a higher resolution bitmap if you plan to print the resulting graph.
    • For TIFF export, set the mode to "RGBlow" (256 colors, 8 bits), "RGBhi" (millions of colors, 24 bits), "CMYK" (default), "GRAY" or "MONO". Note that "MONO" means black and white only, with no grays. CMYK and RGB are two ways of denoting colors.
    • For TIF export, include the "compress" option to save the file using "PackBits" compression, which will make the file smaller but perhaps less compatible. Or use the "LZW" option (Windows only) to compress using the Lempel-Ziv-Welch algorithm, which doesn't compress quite as well as PackBits, but may be more compatible with some programs.
  • ExportBMP [filename] <mode> <resolution>
    • This command allows you to export graphs or layouts in BMP format at 100, 300, 600, and 1200 dpi. Low-resolution bitmaps work great if the goal is to display the graph on the screen (for example in a web page), but are not useful if the goal is to print a high-quality page. Choose a higher resolution bitmap if you plan to print the resulting graph.
  • ExportPNG [filename] <resolution> 
    • Choose a PNG file if you plan to include the graph or layout on a web page.
  • ExportJPG [filename] <mode> <resolution>
  • ExportEPS [filename] <mode> <nofonts>
    • For EPS export, set the mode to "RGB" (256 colors, default), "CMYK" or "Grayscale". Choose "nofonts" to not include fonts. This makes the EPS file smaller and more compatible, but requires that the same fonts be present on the computer used to import the file.
  • ExportPDF [filename] <mode> 
    • For PDF export, set the mode to "RGB" (256 colors, default), "CMYK" or "Grayscale". This command exports the current graph or layout.
  • ExportAllPDF [filename] <mode> 
    • ExportAllPDF exports all the graphs (or all the layouts) into one multi-page file.

If your page has a colored background, you will see that background in the exported file, unless you include the parameter "<CLEAR>" to export the graph or layout with no background color (allowed for all formats except BMP and JPG).

For all export commands, Prism will use the SetPath location if you don't specify disk and directory.



Keywords: bitmap web graphics script

Explore the Knowledgebase

Analyze, graph and present your scientific work easily with GraphPad Prism. No coding required.