Publishing Engine Programmer's Guide > The Arbortext Publishing Engine Sub-Process > Arbortext Publishing Engine Document Conversion > Customizing Document Conversion > Mapping Graphic Paths for HTML
  
Mapping Graphic Paths for HTML
Mapping graphics paths addresses the problem of returning an HTML document that contains graphics without needing to bundle the graphics with the output file. If you specify zip-output=yes, Arbortext Publishing Engine returns the converted HTML document and the graphic files it references. With this customization, you can change the output HTML document to refer to all graphics using a URL (http://... references), provided your output document type is HTML and you do not specify zip-output=yes. This approach works if you can place all of your graphics on a web server.
Create an ACL script that will be placed in a PE_HOME\custom\init directory in the Arbortext Publishing Engine install tree on the Arbortext PE server. This script must require the ACL package PE_HOME\e3\packages\e3.acl by issuing the command require e3 (the path isn't needed). Invoke the ACL function e3::add_html_image_map( path, url ) for each graphics path you want to map by specifying the initial path for a graphic reference as a string and a corresponding URL as a string. When the document is converted to HTML, each graphic reference path that matches the specified initial path string will be changed to the initial URL string in the output document.
Example 3. Example ACL script to map graphics paths
require e3; e3::add_html_image_map( "c:\\graphics",
"http://myserver/graphics" ); e3::add_html_image_map( "d:\\graphics",
"http://anotherserver/graphics" );
In the path string, note that the backslash must be escaped by another backslash. If the converted HTML document contains the following graphic references:
c:\graphics\sample.gif
d:\graphics\test.jpg
e:\graphics\keep.cgm
The graphic references in the output HTML document will be mapped to:
http://myserver/graphics/sample.gif
http://anotherserver/graphics/test.jpg
e:\graphics\keep.cgm
The last graphic reference is not changed because there is no match for its path (e:\graphics) in a e3::add_html_image_map function call.