How to send name of Alternative Layout in Block

  • 330 Views
  • Last Post 24 March 2019
  • Topic Is Solved
Ahmad Shah posted this 24 March 2019

Hi,

I'm using ABBYY Flexicapture and Flexilayout 12.0, and am stuck at a point where I want to pass an Alternative layout name into a Block inside ABBYY Flexilayout.

I saw on one of the posts (http://www.capturedocs.com/search/?term=FlexibleAlternativeName()&p=2) about using IPage :: MatchedSection : IMatchedSectionInfo :: FlexibleAlternativeName() : string to get the Alternative layout name and set it in a block.

Unfortunately, I'm not quite sure as to how I can use this. Is there any sample script or tutorial can I make use of the see as to where I have to input the script within Flexilayout, and what would be the correct syntax to do so.

Would be grateful if anyone could help out.

Thank you.

Ahmad Shah posted this 24 March 2019

Hi. I found the solution:

We need to define a new field in the respective document definition and apply the following rule to it via script:

// [C#]
using System;
IMatchedSectionInfo section = Context.Document.Pages[0].MatchedSection;
string Alternative_Layout_Name = section.FlexibleAlternativeName;
Context.Field("<New Field Name>").Value = Alternative_Layout_Name;

Close