Draw page size in pixel
Draw page size in pixel
Hello,
i need something like Page.width but giving the results in pixel (and not in 1/100 millimetters)
my final purpose is to get the position of a mouse click in 1/100 millimetters (and not in pixel) under open office draw
thanks for the help
i need something like Page.width but giving the results in pixel (and not in 1/100 millimetters)
my final purpose is to get the position of a mouse click in 1/100 millimetters (and not in pixel) under open office draw
thanks for the help
Open office 4.1.2
Windows 8
Windows 8
Re: page size in pixel
The Draw is a vectorgraphic software. The pixel size of the actual view of the drawing depends on the Zoom value and the pixel resolution of the screen.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: page size in pixel
Yes i figure that when my macro doing strange things after i change the zoom
I was guessing some uno service can tell how much pixel are use to display the page on the screen with the current zoom
I was guessing some uno service can tell how much pixel are use to display the page on the screen with the current zoom
Open office 4.1.2
Windows 8
Windows 8
Re: page size in pixel
I think, the API not support such pixel unit related functions. (API = Application Programming Interface)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: page size in pixel
Don't know if this will help you but for Pixel/mm conversion
Link for Getinfo:
https://www.openoffice.org/api/docs/com ... ml#getInfo
Code: Select all
Dim FF,ComponentW,Desktop,pixpermmmx,pixpermmmy
Desktop = createUnoService("com.sun.star.frame.Desktop")
FF = Desktop.getActiveFrame()
ComponentW = FF.getComponentWindow()
pixpermmmx =ComponentW.getInfo().PixelPerMeterX/1000
pixpermmmy =ComponentW.getInfo().PixelPerMeterY/1000
https://www.openoffice.org/api/docs/com ... ml#getInfo
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: page size in pixel
Thanks for this i progress a lot and i almost solved my problem
with your code i write a code that give the width of the page in pixel but that only works for a zoomvalue of 100
I just need to replace Page.width*pixpermmmx by Page.width*pixpermmmx*ZoomValue/100
i find this https://wiki.openoffice.org/wiki/Docume ... gs/Zooming, but i don't figure how to use it in order to get the Zoom Value
with your code i write a code that give the width of the page in pixel but that only works for a zoomvalue of 100
Code: Select all
Dim Doc As Object
Dim Page As Object
Doc = StarDesktop.CurrentComponent
Page = Doc.drawPages(0)
Dim FF,ComponentW,Desktop,pixpermmmx
Desktop = createUnoService("com.sun.star.frame.Desktop")
FF = Desktop.getActiveFrame()
ComponentW = FF.getComponentWindow()
pixpermmmx =ComponentW.getInfo().PixelPerMeterX/100000
MsgBox(Page.width*pixpermmmx)
i find this https://wiki.openoffice.org/wiki/Docume ... gs/Zooming, but i don't figure how to use it in order to get the Zoom Value
Open office 4.1.2
Windows 8
Windows 8
Re: page size in pixel
try
Thiscomponent.currentController.ViewSettings.ZoomValue
Thiscomponent.currentController.ViewSettings.ZoomValue
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: page size in pixel
Thiscomponent.currentController.ViewSettings.ZoomValue works fine for open office writter but not for draw (under draw he doesnt recognise viewsettings)
Open office 4.1.2
Windows 8
Windows 8
Re: page size in pixel
I tried using getViewdata to set the scroll position in Writer... if that works in draw you might be able to work out how to get the zoom. See my post at the bottom here to start you off - its as much as I know:
viewtopic.php?f=20&t=84963
viewtopic.php?f=20&t=84963
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: page size in pixel
The page size is measured in real units (inches, mm, points etc) and not in pixels.
See Where is the Display Cursor? in [Solved] Macro to measure the length of text in a .odt file for ideas.
See Where is the Display Cursor? in [Solved] Macro to measure the length of text in a .odt file for ideas.
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.