Ask Your Question
1

Size of ODG (inserted via OLE) in ODT [closed]

asked 2013-10-25 19:39:02 +0200

theoldwizard1 gravatar image

updated 2015-11-12 15:55:21 +0200

Alex Kemp gravatar image

LibreOffice 4.1.2.3

I am trying to insert an ODG into a ODT using Insert -> Object -> OLE Object -> Create from file

The "physical size" on the page (paper) of the object in the ODT is NOT the same as the original ODG ! Of course grabbing a resize handle in Writer "stretches" the contents out of shape.

Example 1, the ODG is 1 page which is defined as 6.0"x2.0" with 0,0,0,0 margins. When it is inserted it is clearly much taller than 2.0".

Example 2, the ODG is 1 page, A4 size with A4 default margins. When I try to insert it into my ODT it fills the width of the Letter size page, but the length is much too small.

In both case the image contents has the proper width/height ratio.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-12 15:55:37.089399

1 Answer

Sort by » oldest newest most voted
2

answered 2013-10-26 09:22:37 +0200

oweng gravatar image

updated 2013-11-01 00:38:05 +0200

OLE has long had problems under OOo/LO and will likely continue to do so as it is a proprietary technology that limits interoperability (refer Wikipedia and MS Developer Network OLE Data Structures pages). Bug fdo#65321 would appear to be the particular issue you are experiencing (i.e., canvas size). Admittedly that bug does not contain much in the way of technical detail, but it does relate to the problem you are experiencing. The discussion in this thread touches on the same subject.

I have redone the examples below for greater clarity as the current calculations for determining OLE object size are more complex than I first realised. While it appears that the size of an object inserted via OLE is "arbitrary," it is actually calculated. The main factors are the width, height, and aspect ratio of the canvas of the ODG being inserted and the width of the page of the ODT being inserted into. In all cases there is a maximum dimension of the width of the page being inserted into and a height of 406.86pt / 5.65in / 143.53mm. Once either of these dimensions is reached the graphic will begin to rescale in order to fit within the available area.

Square canvas

Where the aspect ratio (width vs. height) of the canvas is square an object inserted via OLE will have a width of ~150% and a height of ~103% of the canvas in the original ODG.

In all these examples the diagram is 150x150pt / 2.08x2.08in / 52.92x52.92mm and placed on canvases of varying size as indicated. Position of the diagram is top left as the canvas increases in size. The page size shown is A4: a width of 595.3pt / 8.27in / 210mm with default left and right margins of 57pt / 0.79in / 20.1mm, giving a default text block width of 481.3pt / 6.69in / 169.84mm.

150x150pt / 2.08x2.08in / 52.92x52.92mm:

150x150pt canvas

300x300pt / 4.17x4.17in / 105.83x105.83mm:

300x300pt canvas

395x395pt / 5.49x5.49in / 139.35x139.35mm:

395x395pt canvas

500x500pt / 6.94x6.94in / 176.39x176.39mm:

500x500pt canvas

595.3x841.89pt / 8.27x11.69in / 210.00x297.00mm (i.e., A4):

A4 canvas

Portrait canvas

Where the aspect ratio (width vs. height) of the canvas is portrait an object inserted via OLE will have a width of ~300% and a height of ~103% of the canvas in the original ODG. Some example figures for an ODG ... (more)

edit flag offensive delete link more

Comments

No this is different This has nothing to do with the "canvas".

Writer seems to "arbitrarily" pick a size on the page where the ODG file is going to be pasted that is different than the size of the "paper" as it is defined in the ODG.

theoldwizard1 gravatar imagetheoldwizard1 ( 2013-10-27 03:31:05 +0200 )edit

@theoldwizard1, it does relate to the canvas, it is just that the relationship is not an obvious one. I will update my answer for greater clarity.

oweng gravatar imageoweng ( 2013-10-28 00:19:22 +0200 )edit

Thanks for the update and images, bur I an still struggling.

My ODG is defined to have a Page Size of 6.0x2.0 inches with zero, zero, zero, zero margins. I am inserting into a blank "Letter" size (8.5x11.0") Writer page with 0.25, 0.25, 0.25, 0.25 margins. When I Insert -> Object -> OLE Object -> Create from file the resultant OLE is 6.19x3.12 inches (from Right Click, Object, Type) so it was scaled 103% (width) and 156% (height). How do you get a 6.0x2.0 OLE ?

theoldwizard1 gravatar imagetheoldwizard1 ( 2013-10-28 15:09:27 +0200 )edit

Thanks for the update. The problem is the 6.0in width of the ODG. This width will become ~150% on insert using OLE. The ODG needs to be scaled smaller to fit within the margins. Page width of 8.5in and left/right margins of 0.25in means a text block width of 8.0in. Dividing by 1.5 gives 5.33in, but you should reduce this (perhaps to 5.16in) to ensure the ODG will fit within the margins OK. Try testing with an ODG around that size to see what happens.

oweng gravatar imageoweng ( 2013-10-29 00:42:07 +0200 )edit

I AM SO CONFUSED !!

I shrunk the object in Draw to 5.0x1.5, both the actual image and the canvas (Page Setup size). Now when I Insert -> Object -> OLE Object -> Create from file, whil in Draw the resultant OLE is 6.9x5.8 and the image, of course, is actually smaller !

theoldwizard1 gravatar imagetheoldwizard1 ( 2013-10-29 05:29:12 +0200 )edit

Can you upload the ODG (or an example file the same size) somewhere and provide a link here? I found your examples here. It appears the resizing algorithm depends on the height and width of the canvas and scales differently for portrait, square, and landscape. I will update my answer. Thanks for bringing this to my attention.

oweng gravatar imageoweng ( 2013-10-31 13:14:30 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2013-10-25 19:39:02 +0200

Seen: 1,414 times

Last updated: Nov 01 '13