Problem with odg file inserted into odt file

My OS is Ubuntu 20.04 and the LO version I’m using is 7.4.3.2.

The content of my odg file is not centred on the page of the odt file.

Is there a way for me to centre that content on the page?

Thank you,

Leslie

Difficult to tell only from the screenshot.
In such a case, I prefer to open the drawing in Draw to be able to select only the shapes (without the background), copy and then paste into Writer. The image is reduced to the union of the various shapes (smaller size) and this can be positioned in the page depending on the anchor mode (and position parameters).

If you anchor As character, the drawing is a “character” in the paragraph and laid out according on paragraph formatting.

If you anchor To paragraph (or equivalently To character), you are free to lay your image anywhere in the page. I recommend you apply some frame style you customise to your taste. This eases repetition for similar images.

Never anchor To page.

Improvement on your chart:
You have used text boxes (or labeled rectangles)+ and lines. Instead of lines, use connectors between boxes. With connectors, you can reposition your boxes and the connectors remain “connected” to the boxes. Thus, you don’t need to adjust the connectors; it is done automatically.


+ I hope you didn’t draw rectangles, added text boxes and grouped them. In Draw any shape can be labelled with text.

For better advice, attach a 1-page sample and the .odg file. Please edit your question to mention OS name and LO version.

Thank you very much for taking the trouble to reply ajlittoz.

My chart (or whatever it’s properly called) was anchored as character. When I switched to anchor to paragraph (or to anchor to character), my chart moved to the centre of the page in my odt document, as I’d wanted. However, that caused a different problem. My pages are all numbered at the top. The chart is now at the very top of the page on which it appears, covering up the page number. How do I get my page number back?

I attach my odg file.

chart.odg (15 KB)

When you say “attach a 1-page sample”, what I’m attaching is a screenshot of the relevant page.

I’m not sure that’s what you wanted, but I was unable to cut and paste the relevant page from my odt file into a new file. I couldn’t get the chart to cut.

I edited my original post, as you asked.

Thank you again,

Leslie

Thank you for sharing your graphic ODG.

As @ajlittoz suggested, I have now added connectors to the graphic instead of lines.

87358 HB chart.odg (14,9 KB)

Connectors in Draw

You can select the graphic and export it to Draw, e.g. as a PNG file, which you can paste into Writer.




Or you can copy the graphic with Ctrl+C and paste it into Writer with Ctrl+V.

87358 HB chart.odt (15,1 KB)


Insert and edit images in Writer Part 1

@lesliek: your problem comes probably because you Insert>OLE Object>OLE Object or something similar. The file is taken as a whole and not clipped to the actual embedded shapes. To be more selective, open your chart in Draw, select the chart and copy Ctrl+C into the clipboard. Switch to Writer and paste. All the excess space is trimmed (and background is transparent).

@Hrbrgr: I don’t recommend exporting to PNG because PNG is a bitmap format (bad scaling) and has a white background while pasting from Draw uses a transparent background which won’t hide the header.

1 Like

PNG exported from Draw has transparent background. Cheers, Al

1 Like

Thank you so much to both @ajlittoz and @hrbrgr!

I now have my little family tree centred on the page in my paper without any covering up of page numbering. (In case you should be wondering at all, the family tree comes from the 1859-60 novel by Wilkie Collins, The Woman In White.)

Thank you again,

Leslie

1 Like

And what to try SVG? Ctrl+A in Draw and Export the Selection to SVG. Then use Insert/ Image in Writer for SVG, because SVG is fast and scalable.


OLE objects (Insert/OLE Object/OLE Object → LibreOffice Drawing) are slow if there are more ones in document.


The disadvantage for Copy/Paste “Shapes with texts” from Draw is → if you want to change the size of object then the boxes are changed, but the Font Sizes not. And it is unpleasant.

I thought I will write macro to change the Font Sizes in boxes, but mostly I used dumb but easy method → Ctrl+A in Draw and Shape/ Convert/ To Curve and Ctrl+C/V to Writer. But I discover the SVG is scalable.

1 Like

I agree that svg is faster and more accurate than pasting directly but it is possible to have the pasted Draw object’s text change size with the object if you are happy to allow the shapes to be modified a little.

Using @Hrbrgr document

  1. Copy shape from Writer to Draw:
  2. Click Shape > Group > Ungroup
  3. With all the objects still selected, click Format > Text Attributes
  4. In the dialogue that opens select the Text tab
    1. Tick both Fit width to text and Fit height to text.
    2. Untick Word wrap text in shape
    3. Tick Resize shape to fit text and OK
  5. With all the objects still selected, click Format > Text Attributes
    1. **Untick both Fit width to text and Fit height to text.
    2. Tick Fit width to frame and OK
  6. Copy shape to Writer and test resizing of text.

Of course it all takes longer than exporting to svg but the object can still be pasted back to Draw and edited without loss of functionality. The SVG would need to be edited in something like Inkscape to avoid losing too much in re-editing but things like connectors would be lost.
87358 HB chart EA modified.odt (20.0 KB)

2 Likes

My problem was solved, but people still kept contributing their knowledge. That really impressed me. I was even more impressed that people actually re-did my chart for me and gave me their version to use. I’ve never had anything like that happen before.

Thank you again to everybody.

Leslie