Options for printing drawings to PDF and Doc format

This topic describes the options for printing drawings to PDF and DOC format.

Creating a paginated report containing drawings

You add drawings to your paginated reports views using the techniques in this topic: Display highlighted drawings in paginated reports.

The datasource in the view controls which drawings the program adds to the report, how the program highlights each drawing, and what text labels the program adds to the drawing on the reports.

When creating the PDF, the program finds the enterprise graphics (the .emf and .json files) for those drawings, highlights and labels them, and adds them to the printed PDF report. You can create these enterprise graphics from either Revit or AutoCAD.

An example of paginated report that contains drawings is this:

http://localhost:8080/archibus/schema/ab-products/solutions/parts/pagereports/ab-ex-custom-dwg-rpt.axvw

Using a template to control the format of the drawing

You can create a Word document that the program will use as a template to present the drawing. This document can use a number of features.

You can remove any of the text boxes in the standard template that you do not wish to use.

Legend on second page

If the legend defined in the template is on a second page, then the printed PDF output shows the floor plan on one page and the legend on the second page, and alternates between floor and legend on subsequent pages.

When there are more than five fields in a legend panel, it's better to have the legend displayed on a separate page.

Example:

http://localhost:8080/archibus/schema/ab-products/solutions/parts/pagereports/ab-ex-custom-dwg-legend-page-rpt.axvw

The template is located in:

\schema\ab-products\solutions\parts\pagereports\report-cadplan-imperial-landscape-17x22-legend-page.docx

Using predefined legend display styles

To control a report's legend table look, the following predefined Microsoft Word styles should be defined in template files.

Using replaceable text in templates

Your title block text may need to change from drawing to drawing. You can embed these text macros which the program will replace with the value appropriate for your drawing. Insert the macro in your Word document template surrounded by curly braces {}.

You can use these macros:

You can remove any of the macros in the standard template that you do not wish to use.

Adding more fields to the title block

You can use the macros to add more fields to the title block. For example, if you add the macros {bl_name}, {site_id} and {site_name} to a template, PDF reports will show Building Name, Site Code, and Site Name .

Example to display building and site names:

http://localhost:8080/archibus/schema/ab-products/solutions/drawing/ab-ex-drawing-rpt-pdf.axvw

To add more fields to the title block:

  1. Go to :

    schema\ab-products\common\resources\src\main\com\archibus\service\common\report\pdf\TitleBlock.java

  2. Add logic and new macros.
  3. Compile TitleBlock.java or regenerate achibus-common-resources.jar.

Referencing the drawing template in view files

This example shows how to use properties within the <report /> tag of your view file (.axvw file) to control paginated reports with drawings.

http://localhost:8080/archibus/schema/ab-products/solutions/parts/pagereports/ab-ex-custom-dwg-rpt.axvw

Changing line colors in reports (drawing publishing)

You may have colors, such as yellow or light blue, that print too faintly in your Word or Adobe PDF output. You can map colors in the Drawing Publishing Rule. For instance, to specify that all colors for background architectural lines be printed black, change the Color Mapping field of the AbPubBackground rule in the Archibus Drawing Publishing Rules table (afm_dwgpub) to black (0x000000).

Changing the color for background layers

You can use the Color Mapping field to explicitly specify the color that should be output for any given layer, for example, eq$:Red.

Using the Color Mapping field. you can also specify a color for a background layer. For example the entry for a background layer, such as -eq background would be:

Gray;eq$:Red

This entry causes all published elements in the Background file to be 'Gray' except for the eq$ layer which will be 'Red'.

Setting a color for the background layer has the following advantages:

Publishing background layers

The core can publish layers as part of the background floor material. Based on publishing rules, the system can publish multiple SWF (or viewing drawings) / EMF (or printing drawings) files for multiple background options (rooms, equipment, emergency egress, lines, etc.), each with a different suffix.

Publishing rules for the following background layers are included out-of-the-box.

You can create publishing rules for including additional elements within layers to be used when exporting drawings for printing..

Using the Additional layers field to restrict the layers to be published

The Additional Layers field in the afm_dwgpub table supports the following optional value: TURNOFFALL*. This value enables you to restrict publishing to only the layers listed in the Additional Layers field.

Text position

The core enables you to publish drawings with the CAD-specified position on the published JSON file, and that position will be used on the report by default. If the JSON file does not have this information (for example, when you have upgraded and the JSON file has not yet been re-published), then the system reverts to the method of the weighted center, that is, it uses a system-generated position for printed output.

Plan Types

Plan types provide different views of your drawings, such as different highlights, labels, and legends, for both online viewing and for printing. The plan type also sets a maximum for label lines, and the label height. Plan types are another method to define standard highlighting , labels, and legend for use when viewing and printing drawings. Plan types are a bit more flexible than defining templates for highlights and labels, but you can use either or both methods in your deployment.

The process for creating plan types is as follows:

  1. An Add-In Manager creates the view that has the datasources needed for the highlights, labels, and legend that is used for printing.
  2. An add-In Manager or the Business Process Owner uses the Active Plan Types table to create the record for the plan type, to link the view to the plan type, and to specify the datasources. In this record, you can also define the Max Label Lines, and Label Height that the plan type uses.
  3. Use the Plan Types Group table to map the plan type to the grouping of views that will use the plan type.

Label Height

This parameter determines text size. The default label height for PDF output in points (1 point = 1.333 pixels). The default is 3, but the user can override this value for the current printing session only by changing this value from the Space Console when printing by using the PDF Print Options.

The core applies the label height value that comes from the Print Options dialog (into a JS file). In other areas of the product where there is no Print Options dialog, the core gets label heights from the below sources, in this order:

In addition, the core supports bringing over the label height from the published CAD plan.

Setting the maximum label lines

If the user selects a plan type, then the printed output can limit the number of text label lines any asset (room) prints. For example, if there are multiple employees in the same room, this would restrict the number of employees (text label lines) to show. The system gets the value from active_plantypes.max_label_lines for the selected plan type, and passes it using the parameter labelLines to the Core. If the value is NULL, or if the user did not select a plan type, then do not pass anything. A default value of “0” means “show all”.

Active Plan Types table

The Active Plan Types table includes label, highlight, and legend datasource information, the name of the view file that contains the datasources, as well as the Label Height and Max Label Lines fields that determines the text size. You can create a record in this table for the plan types you create. The Business Process Owner can also enter information for the plan type in this table from the Edit Print and Drawing Attributes dialog.

Plan Type Groups Table

  • You then use the Plan Type Groups table to map the plan type to the grouping of views that will use the plan type, and to designate the plan type as active.
  • This table maps plan types to the grouping of views that will use those plan types, such as "drawing” or “campus.” For plan types to appear in the Space Console, they must have the Plan Type Group of "Standard Space Highlights." Using this table. you also set the display order for the plan type in selection lists, and designate plan types as Active.

    All active plan types are exposed in all views, unless the application developer explicitly overrides the default behavior.

    Parameters for Run-time parameters passed from JavaScript to the Core

    Each of the following parameters can be passed from JavaScript to the core.

    outputFileType

    Example: outputFileType="pdf"

    This property can be "Pdf", "doc", or "docx" and it specifies the output file type of Adobe format, Word 97-2003 format, or Microsoft Word format, which is the default. You may wish to use the Word 97-2003 format if you have a large number of reports, since it consumes less memory on the application server when generating the report than the other formats.

    labelHeight (numeric):

    Determines label's size in reports.

    The core applies the label height value that comes from the Print Options dialog (into a JS file). In other areas of the product where there is no Print Options dialog, the core gets label heights from the below sources, in this order:

    The priority order of labelHeight: (1) from JavaScript; (2) from AXVW; (3) from reports-docx.xml

    In addition, the core supports bringing over the label height from the published CAD plan.

    This parameter can be referenced in a view file.

    Example: Print Option dialog from

    http://localhost:8080/archibus/schema/ab-products/ab-sp-console.axvw

    backgroundSuffix (string):

    Determines which emf and related zlib files the core will use when generating reports.

    The core can publish layers as part of the background floor material. Based on publishing rules, the system can publish multiple SWF/EMF files for multiple background options (rooms, equipment, emergency egress, lines, etc.), each with a different suffix.

    This parameter cannot be referenced in a view file.

    Example: Background dialog from

    http://localhost:8080/archibus/schema/ab-products/ab-sp-console.axvw

    documentTemplate (string):

    The file name of template docx or doc, it'll determine which template is used to generate reports.

    This parameter can be referenced in a view file.

    Example:

    http://localhost:8080/archibus/schema/ab-products/solutions/drawing/ab-ex-drawing-rpt-pdf.axvw

    scale (string):

    Determines how the core displays drawing images in reports.

    When scale="null", the core displays drawing images as large as possible.

    When scale="consistent", the core displays all drawings in the smallest standard scale per report for visual comparison.

    This parameter can be referenced in a view file.

    Example: Print Option dialog from

    http://localhost:8080/archibus/schema/ab-products/ab-sp-console.axvw

    hatchSize (predefined three key words):

    Determines the legend image size in report's legend table. Its value can be small, or medium, or large, and medium by default.

    This parameter cannot be referenced in a view file.

    Example: Print Option dialog from

    http://localhost:8080/archibus/schema/ab-products/ab-sp-console.axvw

    labelLines (integer):

    Specifies the maximum number of lines a text label can be. If its default value is 0, it means "show all".

    This parameter cannot be referenced in a view file.

    Example: Print Option dialog accessed from the Space Console (non-transacitonal)

    http://localhost:8080/archibus/schema/ab-products/ab-sp-console.axvw

    usePublishedLabelHeight (boolean):

    Determines if the core will use published label size in reports. Its default value is false.

    This parameter cannot be referenced in a view file.

    Example: Print Option dialog from the Space Console (non-transacitonal)

    http://localhost:8080/archibus/schema/ab-products/ab-sp-console.axvw

    drawingZoomInfo (object):

    Determines if the core displays the zoomed-in drawing image (drawing screen-shot image).

    JavaScript code snippet showing how to enable this parameter:

    var reportParameter = {}; //drawing control API getDrawingZoomInfo() will return a null object if the drawing has not been zoomed in var drawingZoomInfo = drawingPanel.getDrawingZoomInfo(); if(drawingZoomInfo !== null){ //drawing control API getImageBytes() to get zoomed drawing png image data drawingZoomInfo.image = drawingPanel.getImageBytes(); //assgin drawingZoomInfo to the report parameter reportParameter.drawingZoomInfo = drawingZoomInfo; }

    This parameter cannot be referenced in a view file.

    Example to have zoomed drawing in PDF if the drawing is zoomed:

    http://localhost:8080/archibus/schema/ab-products/solutions/drawing/ab-ex-drawing-rpt-pdf.axvw

    tableLedgerShadingColor (color hex code):

    Determines which color will be used for legend table row ledger color. Its default color is "0xDBE5F1". To turn off the ledger color in reports, its value should be "0xFFFFFF".

    This parameter cannot be referenced in a view file.

    Example to turn off legend table's ledger color:

    http://localhost:8080/archibus/schema/ab-products/solutions/drawing/ab-ex-drawing-rpt-pdf.axvw

    Legend predefined display styles

    Used to control report's legend table look, a few predefined Microsoft Word styles should be defined in template files. See Predefined legend display styles.

    legendHeading:

    Determines legend table's heading look.

    legendData:

    Determines the data row look for string values.

    legendDataRJ:

    Determines the data row look for numeric values.

    legendTotalHeading:

    Determines the total heading look.

    legendTotalData:

    Determines the total value look.

    Example: \schema\ab-products\solutions\parts\pagereports\report-cadplan-imperial-landscape-17x22.docx

    http://localhost:8080/archibus/schema/ab-products/solutions/drawing/ab-ex-drawing-rpt-pdf.axvw