Download it now!
Bug 81118 - UI: add "fit page size to drawing" button to the page format window
Summary: UI: add "fit page size to drawing" button to the page format window
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
: 67952 123853 128416 (view as bug list)
Depends on:
Blocks: Draw-UX
  Show dependency treegraph
 
Reported: 2014-07-09 16:28 UTC by sergio.callegari
Modified: 2020-05-18 20:41 UTC (History)
13 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sergio.callegari 2014-07-09 16:28:22 UTC
Problem description:

When creating drawings for publications, one typically needs a page size as large as the drawing itself.

Currently, this result is hard to achieve. One needs to work on a standard page size larger than the drawing (e.g. A4). Then the drawing is exported to PDF and finally the PDF is cropped with the pdfcrop utility from the command line.

It would be nice if Libreoffice draw knew how to automatically adjust th page size to the actual elements that are drawn on the page.

Inkscape has a similar functionality that is in fact quite useful. In inkscape this is accessed by Document properties -> Page size -> Resize page to content.

Would be nice if LibO drawing program could get a similar functionality in its Format->Page window.  

Steps to reproduce:
1. ....
2. ....
3. ....

Current behavior:

Expected behavior:

              
Operating System: All
Version: 4.3.0.2 rc
Comment 1 tommy27 2014-07-09 18:56:09 UTC
enhancement request. status NEW. version changed to "inherited from OOo"
Comment 2 QA Administrators 2015-07-18 17:43:47 UTC Comment hidden (obsolete)
Comment 3 sergio.callegari 2015-07-20 08:44:07 UTC
Still valid as of 5.0.0.3
Comment 4 tommy27 2015-07-20 08:59:54 UTC
@Jay
one of you?
Comment 5 Yousuf Philips (jay) (retired) 2015-07-22 16:20:26 UTC
Think this is a useful enhancement and think the command should also be accessible in the Format or Modify menu.
Comment 6 Heiko Tietze 2016-06-15 13:09:50 UTC
(In reply to sergio.callegari from comment #0)
> When creating drawings for publications, one typically needs a page size as
> large as the drawing itself.

You can change the page size to, for instance, A0 and zoom in/out. And you may also scale the complete drawing per Tools > Options > LibO Draw > General > Scale > Drawing Scale to achieve the same result without zooming. What is missing?

(In reply to sergio.callegari from comment #0)
> It would be nice if Libreoffice draw knew how to automatically adjust th
> page size to the actual elements that are drawn on the page.

When you select a couple of objects and export them using the option "selection" the output will have the size of what you have selected. Resizing a page makes not much sense to me.
Comment 7 sergio.callegari 2016-06-15 13:28:01 UTC
>> When creating drawings for publications, one typically needs a page size as
>> large as the drawing itself.

> You can change the page size to, for instance, A0 and zoom in/out. And you may
> also scale the complete drawing per Tools > Options > LibO Draw > General >
> Scale > Drawing Scale to achieve the same result without zooming. What is 
> missing?

Thanks for looking into it, but zoom and drawing scale are a very different thing from what is being asked.

Zoom has to do with the Libreoffice UI, namely the way in which a drawing is visualized. Scale has to do with the way in which LibO interprets distances on the drawing.

What is being asked has to do with the drawing page size, as follows.

Suppose that I make a drawing containing elements that fit in a box that is 10cm by 5cm. Now, what I am looking for is a function assuring that once invoked the drawing page size is made exactly 10cm by 5cm. Namely I would like to get a function that sets the page size to exactly contain the drawing elements *with no margin*. With this, after I export to PDF, I get a document that also contains the drawing without margins. This is indispensable for many real world publication flows (e.g. those for scientific papers. I can detail these if needed).

> When you select a couple of objects and export them using the option
> "selection" the output will have the size of what you have selected. Resizing
> a page makes not much sense to me.

Have you actually tried? Unfortunately, it does not, at least not as far as export to PDF is concerned on LibO 5.1.4.1. If you have a drawing on say an A4 page, and select some objects then export the selection to PDF, you get an A4 page with those objects. Furthermore, flows exist which manage images directly in ODF format and also for them (which involve no "export") the page size needs to be set correctly.
Comment 8 V Stuart Foote 2016-06-15 15:45:54 UTC
(In reply to sergio.callegari from comment #7)

>> Resizing  a page makes not much sense to me.
> 

@Heiko, when using Draw for illustrations, starting with "canvas" at one of the default page sizes (or first setting a custom size)--as the drawing is being finalized it is common to need to adjust the size of the "canvas" to fit the drawing elements. It is also common to need to remove the margins (set to zero), early in the session.

> > When you select a couple of objects and export them using the option
> > "selection" the output will have the size of what you have selected. 
...
> Have you actually tried? Unfortunately, it does not, at least not as far as
> export to PDF is concerned on LibO 5.1.4.1. If you have a drawing on say an
> A4 page, and select some objects then export the selection to PDF, you get
> an A4 page with those objects. Furthermore, flows exist which manage images
> directly in ODF format and also for them (which involve no "export") the
> page size needs to be set correctly.

Heiko is correct, the export of selection happens with raster and vector export formats sizing to a bounding box of the selected Draw objects--regardless of the background page--which can simply not be selected. Although there is a loss of background set on the page, significant in composition when using transparency within the selected objects, but that is another issue.

Unfortunately the export filter for PDF is more restrictive. The Page size of the document as set is used by the filter (and Draw objects extending beyond page margins are clipped)--the exported PDF receives that page size. And so the page must be resized prior to the export. Ability to easily resize the page "canvas" to all existing Draw objects, or even to just the selected objects would be a useful enhancement.

And as noted--OLE work flows that make use of the ODG, or export to other ODF formats are better served with an ability to adjust to Draw document page size as illustrations are being finalized.
Comment 9 Heiko Tietze 2016-06-30 14:01:43 UTC
From duplicate bug 67952:

Owen Genat (retired) 2013-12-21 11:09:49 UTC
Related AskLO thread:
http://ask.libreoffice.org/en/question/18185/how-to-adjust-page-size-to-fit-an-object/

I agree this would be a good feature to have. Confirmed. Status set to NEW. Component set to Drawing. Version set to Inherited From OOo as this has never been possible in LO.
Comment 10 Heiko Tietze 2016-06-30 14:02:37 UTC
*** Bug 67952 has been marked as a duplicate of this bug. ***
Comment 11 Marcel Partap 2017-08-09 17:34:10 UTC
Actually, this would be very useful as well for spreadsheets, i.e. for PDF-exporting each sheet onto a sufficiently large page.
Comment 12 Joel Greenyer 2018-01-27 14:32:51 UTC
This feature is very useful in InkScape and I miss it in LibreOffice since YEARS. I always wanted to write a feature request for this, but always secretly hoped that such a simple feature MUST be coming soon---I've yet waited in vain.


I would like to have button in the Page Properties view, Page Format section, to select "Fit page size to contents". When pressed, it should calculate the width and height of the contents of the current page and write the result into the width and height text fields of that dialog. An extra action in the Format menu to reformat the page based on its contents with one click would be nice as well.

However, keep in mind one tricky detail, namely that this feature must properly consider the BORDER THICKNESS of objects as well:
Suppose your page contents is a single rectangle of width X and height Y, and it has a border thickness T, then the overall visible rectangle has width X+T and height Y+T, and this is the page format that should, in my opinion, be calculated by new feature.
Comment 13 l0f4r0 2019-03-14 07:31:11 UTC
*** Bug 123853 has been marked as a duplicate of this bug. ***
Comment 14 V Stuart Foote 2019-10-27 17:41:58 UTC
*** Bug 128416 has been marked as a duplicate of this bug. ***
Comment 15 Heiko Tietze 2020-01-20 09:09:34 UTC
Let's have an option to _automatically_ enlarge the page (bug 98786) and another command to _manually_ fit the page size to drawings.

Interestingly this request seems to be of more interest than the enlargement.