Bug 55317 - Export PDF with bounding box around selection
Summary: Export PDF with bounding box around selection
Status: RESOLVED DUPLICATE of bug 40163
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: x86 (IA32) All
: medium enhancement
Assignee: Not Assigned
: 38082 (view as bug list)
Depends on:
Reported: 2012-09-25 14:03 UTC by Ralf
Modified: 2016-08-12 00:12 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description Ralf 2012-09-25 14:03:38 UTC
A PDF file exported from a LibreOffice application does not contain a bounding box around selected items. The possiblity of exporting PDFs with bounding boxes would facilitate the process of embedding pictures from a LibreOffice application in LaTeX documents considerably. This process is currently a laborious multi-step process which has to be repeated for each picture to be intserted in a LaTeX document.

I assume that integrating this request is not limited to a single LibreOffice application. I am interested in using PDF export with bounding boxes from the application LibreOffice Calc.

Currently it is possible to export a selection (e.g. some cells in Calc) from a LibreOffice document to a PDF file. However, the PDF file does not contain a bounding box around the selection. Embedding this PDF file into a LaTeX document results in embedding the whole page instead of the selected item only. An introduction of bounding boxes in exported PDF files would not restrict the use of these PDF files, the feature would just extend the possibilities.

This request proposes a similar feature like the reopened bug 38082 "Add separate bounding box on/off control in export to EPS, PDF and similar formats" for LibreOffice Draw. Request 38082 also pursues the target of embedding pictures in LaTeX documents in an easier way. I think that integrating request 38082 would be helpful. However, this request to introduce bounding boxes already for PDF export from any LibreOffice application (like Calc) would make the extra step unnecessary to copy tables and graphs from that LibreOffice application (e.g. Calc) to LibreOffice Draw before exporting them. Moreover, I can imagine a bounding box around the selection for all PDF exports instead of introducing an extra field "Bounding Box" as proposed in request 38082. An "automatic" bounding box would be the simpler solution, and I do not see drawbacks in it.

Currently the follwowing steps are necessary to embed a table or graph in a LaTeX document with pdfLaTeX:

1. Copy selected table or graph from LibreOffice Calc (or another LibreOffice application)
2. Paste into a LibreOffice Draw document, e.g. in GDI metafile format
3. Export selection as encapsulated PostScript (EPS) file from LibreOffice Draw
4. Convert EPS file to a PDF file with a bounding box. This process is carried out with the programme epstopdf and can be integrated into a pdfLaTeX run.

If a PDF could be exported with a bounding box around the selected table or graph, the process above would not be necessary anymore for each table or graph to be exported.
Comment 1 mail 2013-01-15 13:31:06 UTC
Same problem with me, I'm also using a pdflatex workflow. The bug is also obvious in a pdf viewer, here you see the (usually small) selected object surrounded by a lot of white space.

I seem to remember that this behaviour persists for a long time (> 2 years) but I haven't tried to export selections to pdf for a long time.

The bug might be not be within the LO codebase but related to:


Maybe bug 47140 could also be tackled at the same time ("Selection" has to be acivated twice during the export process).
Comment 2 mail 2013-01-17 10:22:03 UTC
If I understand the issue correctly, LO uses poppler for pdf export etc. It seems, a related bug has been fixed in a recent release (poppler-0.21.4.tar.gz, Sat December 15, 2012):
      core: ...
         * PSOutputDev: Fix crop on EPS conversion (Bug #30692)
If this is correct (I'm not a developer), it should be sufficient to include the latest poppler version in future LO releases to generate correct PDFs.
Comment 3 Ralf 2013-01-26 10:01:47 UTC
According to my understanding this bug request and the quoted and resolved bug request of poppler are different. The resolved poppler bug dealt with conversion from PDF to PostScript by the converter pdftops. The bugs are similar in a sense that both bugs deal with the functionaly of cropping a bounding box or art box. Nevertheless I consider these bugs to be unrelated because creating a PDF file with LibreOffice does not function via an interim PostScript conversion, if my understanding is correct. That means, unfortunately, that the solution of the quoted poppler bug does not result in any synergies for resolving this LibreOffice bug. However, I am not a developer and might miss an interrelationship.
Comment 4 Callegar 2014-02-05 17:43:21 UTC
I definitely support the idea of providing a bounding box in the pdf when the request to export a selection is made.  This whould be extremely useful when LO is used to prepare drawings for other tools (not just LaTeX). Currently images need to be exported and then manually cropped with the pdfcrop tool.
Comment 5 mail 2014-06-29 21:01:29 UTC
Still the same behaviour in LO 4.2.5: The size of the background of the exported pdf-File is always the same as the page format in Draw / Impress or whatever.

Workaround so far: use pdfcrop or pdfcropper (Windows).
Comment 6 mail 2014-06-29 21:03:27 UTC Comment hidden (obsolete)
Comment 7 Heiko Tietze 2016-05-09 14:56:09 UTC
*** Bug 38082 has been marked as a duplicate of this bug. ***
Comment 8 V Stuart Foote 2016-08-12 00:10:20 UTC
Essentially the issue of bug 40163

Extent of Selected objects combine as a bounding box in export types other than PDF. PDF does not honor the "Selection" radio button when used, and always exports sized to the full document canvas. The selection of objects are honored, but not the resulting bounding box as size for the exported PDF.

*** This bug has been marked as a duplicate of bug 40163 ***