GenerateDocument

Node Action:

The GenerateDocument node action generates a design print PDF.

Parameters:

se_type

GenerateDocument

se_type = GenerateDocument

se_pageRange

Sets the pages to be printed to PDF. Some examples are: blank "" (all), "all", "current", "currentpage", "3-4".

se_determinePageRange

A lambda to build up the string defining the page range.

se_compressFonts

A bool to state whether fonts should be compressed in the PDF. Compressed fonts are not searchable.

se_determineCompressFonts

A lambda to determine if fonts should be compressed.

se_imageQuality

This is an integer value from 0-100 to set the image quality. A value of 100 means there is no compression. The compression increases as the value approaches 0.

se_determineImageQuality

A lambda to set the image quality value.

Example:

Attach Construction Drawing: The following workflow allows you to create a PDF print and attach it to your design.

digraph finite_state_machine { 

  splines=spline; 
  edge[arrowsize=1, color=black];
  node[shape = box, color = green];
  
  entry[
    label = "Print Tool - Attach Construction Drawing", 
    shape= invhouse,
    height = 1,
    se_type1 = PrintToolTrigger,
    se_displayName1 = "Attach Construction Drawing",
    se_iconService1 = KvStorage,
    se_iconUrl1 = "/api/v1/global/_attachment/SE.Geospatial.Designer/Settings/PrintTools/AttachConstructionDrawing", 
    se_sortOrder1 = 20,
    se_requiresConnection1 = true,
    se_visibilityCondition1 = "function (ctx, log) {
      var hasArcFMMobile = ctx.User.TenantInfo.auth0Apps.find(x => x.name == \"ArcFM Mobile (OIDC)\");
      return hasArcFMMobile != null && hasArcFMMobile != undefined;
    }"
  ]; 
  
  generateDocument[
    label = "Generate print of all pages"
    se_type1 = GenerateDocument,
    # maybe like this for specifying all?
    se_pageRange1 = "All",
    se_resultVariable1 = GeneratedDocumentPath

  ]
  
  
  openDefaultPdfViewer[
    label = "Open default PDF viewer"
    se_type0 = LaunchUriScheme,
    se_determineUri0 = "function (ctx, log) {
      return ctx.State.GeneratedDocumentPath;
    }"
  ]
  
  promptUser[
    label = "Should attach print?"
    
    se_type0 = PromptUser,
    se_promptCaption0 = "Attach Construction Print",
    se_cardTemplate0 = "{
        \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",
        \"type\": \"AdaptiveCard\",
        \"version\": \"1.3\",
        \"body\": [
            {
                \"type\": \"TextBlock\",
                \"text\": \"Do you like how your print looked?\"
            },
            {
                \"type\": \"ActionSet\",
                \"actions\": [
                    {
                        \"type\": \"Action.Submit\",
                        \"title\": \"Attach\"
                    },
                    {
                        \"type\": \"Action.Submit\",
                        \"title\": \"Cancel\"
                    }
                ]
            }
        ]
    }",
    se_resultVariable0 = ShouldPrintResponse
  ]
  
  
  attachPrintAsDesignAttachment[
    label = "Attach Print as Design Attachment"
    
    se_type0 = AttachDesignAttachment,
    se_attachmentName0 = "ConstructionDrawing"
    se_determineDesignId0 = "function (ctx, log) {
      return `${ctx.Event.design.id}`;
    }",
    se_determineFilePath0 = "function (ctx, log) {
      return ctx.State.GeneratedDocumentPath;
    }",
    se_mediaType0 = "application/pdf"
  ]
  
  
    
  exit[
    label= "Complete", 
    shape=invhouse, 
    style=filled
  ]
  
  cancelled[
    label = "Cancelled",
     
    shape=invhouse, 
    color=yellow, 
    style=filled
    
  ]
  
  entry->generateDocument;
  generateDocument->openDefaultPdfViewer[
    se_type = Condition,
    se_condition = "function (ctx, log) {
      return ctx.State.GeneratedDocumentPath != null;
    }"
  ]
  generateDocument->cancelled[
    se_type = Condition,
    se_condition = "function (ctx, log) {
      return ctx.State.GeneratedDocumentPath == null;
    }"
  ]
  openDefaultPdfViewer->promptUser;
  promptUser->attachPrintAsDesignAttachment[
    se_type = Condition,
    se_condition = "function (ctx, log) {
      return ctx.State.ShouldPrintResponse.submittedAction.title == \"Attach\";
    }"
  ]
  attachPrintAsDesignAttachment->exit;
  promptUser->cancelled[
    se_type = Condition,
    se_condition = "function (ctx, log) {
      return ctx.State.ShouldPrintResponse.submittedAction.title != \"Attach\";
    }"
  ]
  
}
Feedback
QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.