Export Your Analytic Application to PDF

You can let application users export an analytic application to a PDF file at application runtime.

Context

Only visible contents in your application can be exported to PDF. Therefore, the following invisible elements won't be exported:

  • invisible part in scrollable charts, tables or containers including tab strips, panels, flow layout panels and page books

  • collapsed table cells

  • lazy rendered widgets

  • lazy loaded data source

  • comments on invisible data cells

Besides these invisible elements, web page widgets won’t be exported.

Note

For R visualizations, static plots will be exported. However, R visualizations written in RHTML (iFrame) are not fully supported, for example, the ones with pictures from external sources.

Note

Widgets might not keep all CSS styling settings when exported to PDF, for example, text decoration and opacity.

Tip

Custom widgets support PDF export now. However, to make sure that all the defined elements can be exported to PDF, custom widget developers need to be aware of the export restrictions and test first and then set supportsExport to true in the custom widget JSON file.

Tip

If your image's hyperlink is an external URL, you can add a parameter to it to ensure that certified users can export this image to PDF.

Parameter Options

imageCrossOrigin

Controls users’ access to the hyperlink of the image to be exported to PDF.

By default users are anonymous to the URL if you don’t add this parameter.

  • useCertifications requires users’ credential to access the external URL linked to the image. When certified, users can export this image to PDF.

  • anonymous means that certification won’t be passed and users might not export the image to PDF if the external server requires this process.

Procedure

  1. In the Scripting section of the Outline, select right next to Export to PDF to create a technical object.

    The side panel Export to PDF opens with a default name ExportToPDF_1.

  2. In the side panel, select Included Widgets to choose the widgets you want to export to PDF.
  3. In addition, you can set the following properties according to your needs:
    • name of the technical object

    • paper size of the exported file: Auto, A2, A3, A4, A5, Letter or Legal

    • orientation of the exported file: Landscape or Portrait

      The Orientation option is disabled when the paper size is set to Auto.

    • location of page number: Header,Footer or None

    • exported file name, header and footer texts

    • whether to export the appendix

      The appendix will be exported as separate page.

    • whether to export the comments

      The comments will be exported as separate pages. Comments on invisible widgets won't be exported.

      Note
      If you haven't enabled Commenting in embedded mode via Start of the navigation pathSystem Next navigation step Administration Next navigation step System ConfigurationEnd of the navigation path, the commenting related settings and APIs won’t take effect.
    • whether to include date in header or appendix

  4. Select Done to finish creating the technical object.
  5. Use exportView() API to trigger exporting the analytic application to a PDF. For example, you can write the script for the onClick() event of a button widget so that application users can export via clicking the button.
    Note
    The API that triggers the export is supported only in Microsoft Edge and Google Chrome, but not in Internet Explorer.
  6. The properties you defined in the Export to PDF panel will be the default export settings. To offer users the flexibility to customize the export settings, you can design a new settings panel or dialog by leveraging relevant APIs. For detailed information, refer to Analytics Designer API Reference.