FlexViewer: Upper left corner of the area of document

Posted by: abel.perez on 14 May 2019, 7:02 pm EST

    • Post Options:
    • Link

    Posted 14 May 2019, 7:02 pm EST

    I have a FlexViewer on my .NET application and it all works great. I want to add a label on top of the viewer but it has to be displayed in the top left corner of the area that shows the document. If the Ribbon is displayed or not displayed this coordinate changes. There has to be a property that gives me the location of the upper left of the viewing area correct?

  • Posted 16 May 2019, 4:30 am EST

    Hello,

    As per my understanding you need to adjust the position of the label in the top left corner of the C1FlexViewerPane based on whether a ribbon is minimized or not, on the form.

    This can be done by setting the Top and Left properties of the label to that of the pane, as follows:

    ```

    label1.Top = c1FlexViewer1.Pane.Top;

    label1.Left = c1FlexViewer1.Pane.Left;

    
    An application has been attached for your reference. Here, you can toggle the ribbon visibility on the button click. 
    
    Best Regards,
    Esha
    [zip filename="prj_C1FlexViewer_LabelPosition.zip"]https://gccontent.blob.core.windows.net/forum-uploads/file-adff0006-bb36-42f8-b736-8831a51a6fc9.zip[/zip]
  • Posted 16 May 2019, 7:23 pm EST

    Thank you for the sample. Unfortunately in my case it doesn’t work. My FlexViewer is not anchored to the entire form. here is an example of where I put my FlexViewer. I think to adjust we would need:

                label1.Top = c1FlexViewer1.Top + c1FlexViewer1.Pane.Top;
                label1.Left = c1FlexViewer1.Left + c1FlexViewer1.Pane.Left; 
    ```[img]https://gccontent.blob.core.windows.net/forum-uploads/file-feb0067f-aac7-4cbb-a71d-54e8ef8afbb7.PNG[/img]
  • Posted 17 May 2019, 1:01 am EST

    Hello,

    In this case, you can set the code as you have mentioned, as you ultimately wish to display the label at the top left position of the pane. This works well with the sample to display the label within the pane at the desired location.

    Kindly inform if there is another point/requirement to it that I am missing.

    Regards,

    Esha

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels