Hi,
I have a case where I need to optimize white space in a document.
Case:
http://www.flickr.com/photos/26747105@N04/2508448218/
As you can see the image is too big.
I want to grab the picture, resize it so that it fits into the first page, resulting in this:
http://www.flickr.com/photos/26747105@N04/2508448276/
The problem is determining how much white space I have left on the first page, so I'll know the amount of resizing needed.
Optimize whitespace
Re: Optimize whitespace
This is a very difficult problem I think. I would probably do something similar to the following:
1. Please the cursor in the paragraph before the picture.
2. Calculate the location of the text cursor (see the section titled "Where is the Display Cursor?" in my free macro document).
3. Determine how much free space is between that and the end of the page
It will take some trial and error. Please share any solutions that you determine.
1. Please the cursor in the paragraph before the picture.
2. Calculate the location of the text cursor (see the section titled "Where is the Display Cursor?" in my free macro document).
3. Determine how much free space is between that and the end of the page
It will take some trial and error. Please share any solutions that you determine.
Re: Optimize whitespace
All you basically want to know is the space, in pixles, between the bottom of your first paragraph and the end of the page, right? I don't think you should look for the solution in OOo. There's things called screen rulers available, like this one*, that would be of more help here. All you have to do is make sure that your document is zoomed to 100%. The ruler will tell you the umber of pixels and you can adapt your picture to that.
Hope this helps.
*NB: i've only just googled this one i've never used it. If you use Opera of FF there's also widgets/extensions available that can do this.
EDIT: I'm wondering though why you don't simply resize the picture in writer. Just anchor it to the first paragraph and resize it. The rest of the text should flow along.
EDIT2: whoops, hadn't seen that this was in the Macro section.
Sorry for the useless answer then
Hope this helps.
*NB: i've only just googled this one i've never used it. If you use Opera of FF there's also widgets/extensions available that can do this.
EDIT: I'm wondering though why you don't simply resize the picture in writer. Just anchor it to the first paragraph and resize it. The rest of the text should flow along.
EDIT2: whoops, hadn't seen that this was in the Macro section.
Sorry for the useless answer then

Last edited by Caracalla on Fri May 23, 2008 4:31 pm, edited 1 time in total.
Has your question been answered? Then please add [solved] to the title of your thread.
My pet peeve, No support for international ordinal numbering
please vote
Er is nu ook een Nederlandstalig forum!
OOo 3.0.X on Ms Windows XP + Opensuse 11.1
My pet peeve, No support for international ordinal numbering
please vote
Er is nu ook een Nederlandstalig forum!
OOo 3.0.X on Ms Windows XP + Opensuse 11.1
Re: Optimize whitespace
This is probably the best solution so far; thanks for this insight.pitonyak wrote:This is a very difficult problem I think. I would probably do something similar to the following:
1. Please the cursor in the paragraph before the picture.
2. Calculate the location of the text cursor (see the section titled "Where is the Display Cursor?" in my free macro document).
3. Determine how much free space is between that and the end of the page
It will take some trial and error. Please share any solutions that you determine.
The reason is that I want to do this with OOo in headless mode and do it automatically through the UNO API. I need to programatically determine how much whitespace is left on the page.Caracalla wrote:All you basically want to know is the space, in pixles, between the bottom of your first paragraph and the end of the page, right? I don't think you should look for the solution in OOo. There's things called screen rulers available, like this one*, that would be of more help here. All you have to do is make sure that your document is zoomed to 100%. The ruler will tell you the umber of pixels and you can adapt your picture to that.
Hope this helps.
*NB: i've only just googled this one i've never used it. If you use Opera of FF there's also widgets/extensions available that can do this.
EDIT: I'm wondering though why you don't simply resize the picture in writer. Just anchor it to the first paragraph and resize it. The rest of the text should flow along.
Re: Optimize whitespace
You want to do this in headless mode? That could be a big problem. The only thing that understands how the document is displayed is the current controller / view cursor. The document itself is stored as a simple set of text commands and such. You will notice that although it knows about the fonts that it thinks that it desires to use, it does NOT contain font metrics or even know if the system supports a specific font.
I must have missed the fact that you desired to use headless mode. Silly me. I will be impressed if you are able to solve this in headless mode.
I must have missed the fact that you desired to use headless mode. Silly me. I will be impressed if you are able to solve this in headless mode.