Publishing Engine Programmer's Guide > The Arbortext Publishing Engine Sub-Process > Arbortext Publishing Engine Document Conversion > Conversion Processing > Generating a Zip Archive
  
Generating a Zip Archive
The HTTP protocol only allows one file to be returned as the body of the HTTP response. Output formats such as HTML, XML, SGML, and RTF can produce a file accompanied by a directory of graphic files which are referenced by the output file. If a single output file is returned, the client can't access its graphic files.
Specifying zip-output=yes returns the result in a zip archive, which is a single file that can contain any number of files and subdirectories. For HTML, the archive contains the HTML document and the graphics to which it refers.
When this option is specified, all output, regardless of output type, is written to a single target directory. For output types such as HTML, XML, SGML, and RTF, which support external graphic references, the conversion process allocates a graphic subdirectory in the output directory and copies all graphic files to the graphic subdirectory.
The conversion processor copies all graphics referenced by the input document to a subdirectory of the output directory. Like profiling and stylesheet application, the graphic copying process can be part of the output conversion operation (for output types HTML, RTF, and Web) or immediately after stylesheet application (for the other output types). Then the conversion processor adjusts the graphic references in the input document to reference the graphics using relative path names within the archive.
If the output type is PostScript, PDF, EPUB, or HTML Help, this step is skipped because the conversion processor embeds the graphics inside the output file.
By default, the name of the output file is e3out.ext, where ext is the file extension appropriate to the type of document being converted (.htm, .pdf, .rtf, and so on). You can specify the parameter zip-root to specify another file name.
If a graphic subdirectory is required, the default name will be external.graphics if no zip-root parameter is specified. If zip-root is specified, the default graphic subdirectory name will be root.graphics where root is the value of the zip-root parameter. You can specify the zip-graph-dir parameter to specify any graphic subdirectory name you with.
If the output type is Web, then the zip-output, zip-root, and zip-graph-dir parameters are ignored. The publishing capability always produces an output directory, and it's automatically placed in a zip archive. The content of the directory is controlled by the conversion process.
type=html
zip-output=yes
The output file will be named e3out.htm and the graphic directory will be named external.graphics.
type=html
zip=output=yes
zip-root=testroot.htm
The output file will be named testroot.htm and the graphic directory will be named testroot.htm.graphics.
type=html
zip=output=yes
zip-root=testroot.htm
zip-graph-dir=mygraphics
The output file will be named testroot.htm and the graphic directory will be named mygraphics.