Community

block name

is it possible to replace the visible number on block with a name? or possible annotate the block with name.

0

Comments

4 comments

  • Avatar
    vbknight

    if you can provide sample code the better . TIA

    0
  • Avatar
    SDK_support

    Yes it is possible, please use IBlock::Name property for this purpose. Please see more details in Help → API Reference → Layout-Related Objects → Block.

    0
  • Avatar
    vbknight

    I'ved tried this but still my block did not change it is still has number instead of name.

               FREngine.IBlock activeblock = imgvwr.FRPage.Layout.Blocks[e.blockIndex];
    
                 //change color
                if (activeblock.Type == FREngine.BlockTypeEnum.BT_Text)
                {
                    activeblock.Name = "SampleBlockName";
                    imageViewer.Invalidate(true);
    
                }
    

    // or this

    FREngine.IBlock activeblock = imgvwr.FRPage.Layout.Blocks[e.blockIndex];

                 //change color
                if (activeblock.Type == FREngine.BlockTypeEnum.BT_Text)
                {
                    a  activeblock.set_UserProperty(Name, "RealEstate");
                    imageViewer.Invalidate(true);
                }
    
    0
  • Avatar
    SDK_support

    To be able to change the block name, please try to use property IBlock::Description (Help → API Reference → Layout-Related Objects → Block). This property enables to set any text instead of block number, also you can set an empty string. You may set this property to “null” in case you need to return displaying of block number. Please see the sample code in C#:

    private void testButton_Click(object sender, EventArgs e) {

    FREngine.IBlock block = Document.Pages[0].Layout.VisualBlocks[0];

    block.set_UserProperty("VisualComponents.BlockDescription", "My Text");`    
    block.set_UserProperty("VisualComponents.BlockDescription", "");`
    

    block.set_UserProperty("VisualComponents.BlockDescription", null);

    }

    1

Please sign in to leave a comment.