This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/ios/knowledge-base/customizing-annotation-toolbar-frame.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Customizing the frame of the annotation toolbar

To customize the frame of the annotation toolbar, in your PSPDFViewController subclass, override flexibleToolbarContainerContentRect(_:for:) and return a customized rect. Ask super for the default rect if you want to customize it for only one position or if you want to slightly modify it:

override func flexibleToolbarContainerContentRect(_ container: PSPDFFlexibleToolbarContainer, for position: PSPDFFlexibleToolbarPosition) -> CGRect {
var rect = super.flexibleToolbarContainerContentRect(container, for: position)
if position == .positionLeft {
rect.origin.x += 50
}
return rect
}

For more details about the various ways you can customize the look of the annotation toolbar, refer to our guides on customizing the annotation toolbar and appearance styling.