Hello,
The image control is not meant for viewing documents. There are two methods to attach documents: as you have done or store a link to the document. The latter requires little storage in the database and is much easier to view externally using a simple macro:
Sub GetURL
oForm = ThisComponent.Drawpage.Forms.getByName("YOUR_INTERNAL_FORM_NAME")
DocCtl = ThisComponent.getCurrentController()
oField = oForm.getByName("CONTROL_NAME")
oButton = oForm.getByName("PUSH_BUTTON_NAME")
CtlView = DocCtl.GetControl(oField)
oButton.TargetUrl = CtlView.Text
end sub
attached to After record change
event of form and on the push button property Action set to Open document/web page
you only need a click of the button to open the link.
Now if you are going to have the document embedded as an image, the image data needs to be output to a file to then be opened with the appropriate viewer and when done remove this temporary file. This post → [Tutorial] Pictures in Base will present some methods for this (code in samples).