I am trying to achieve a custom floating pane in the PDF Editor.
I have followed this git example:
URL: https://github.com/tracker-software/PDFEditorSDKExamples/blob/master/CSharp/CustomPane/Form1.cs
I had to use Method #2 which uses the ICabNode to add my pane.
So far everything is mostly working, but I do have an item I am stuck on.
Issue - UserControls disappears when closing and reopening pane.
I have a button in the menu that controls the drawing of the pane. When the document is first opened the pane will not be drawn. If the user then clicks the button it will draw the Custom Pane with my user control inside of it. This works fine.
The issue is, if they click the button again to close the Pane and then click it again to reopen it, it will draw the pane but the user control is missing.
The code I am using to remove the pane is:
Code: Select all
pdfCtrl.Inst.ActiveMainView.ResetPanesLayout()
My drawing code is:
Code: Select all
Dim paneAdded As Boolean = False
myPanesCreator.userCtrl = UcAdvancedBookmark2.TablePanel1
Do
Dim layout As ICabNode = pdfCtrl.Inst.Settings("MainView.Layout")
If HasPane(layout("Root"), MY_PANE_ID) = True Or HasPane(layout("FloatingRoots"), MY_PANE_ID) = True Then
Exit Do
End If
Dim root As ICabNode = layout("Root")
Dim placeHolders As ICabNode = root("Kids")
Dim placeholder As ICabNode = Nothing
If placeHolders.Count = 0 Then
placeholder = placeHolders.Add()
Else
placeholder = placeHolders(placeHolders.Count - 1)
End If
Dim kid As ICabNode = placeholder("Kids").Add
kid("ID").v = MY_PANE_ID 'Pane ID
kid("S").v = DirectCast(UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_FixedSize, Integer) 'Pane Size
kid("FW").v = UcAdvancedBookmark2.Width 'Pane Width
kid("FH").v = UcAdvancedBookmark2.Height 'Pane Height
kid("Title").v = "Advanced Bookmarks" 'Pane Title
paneAdded = True
Loop Until False
If paneAdded = True Then
pdfCtrl.Inst.ActiveMainView.LoadPanesLayout()
End If
Any help would be appreciated.
Thanks,
Sam