14

My aim is to export a LibreOffice Calc chart in PDF in order to use it with LaTex later.

I made a 16cm width and 9cm high graph. I would like to get a PDF without border and lot of empty space.

So I went to : file -> export as PDF-> selection...

However even with the selection option, I get a graph in a small pat of a A4 page with margins and empty space...

Image 1/3

Image 2/3

enter image description here

S12000
  • 3,345
  • 12
  • 35
  • 51

2 Answers2

11

Good question, since the settings are very misleading.

To my knowledge, it is not possible to directly save to pdf as you are hoping to do. However, there is a bit of a workaround that will still let you embed a vector graphs from Open/LibreOffice in your LaTeX documents:

  1. Select and copy (ctrl+c) your graph.
  2. Open LibreOffice Draw
  3. Paste your graph from Calc into Draw
  4. Select the graph, and go to File --> Export, select EPS from the list of formats, and make sure the selection box is checked:

enter image description here

I haven't tried the other formats, but EPS should play nicely with your LaTeX document, or you can easily convert your EPS to PDF and insert them.

Here is a side by side comparison of trying the export setting with PDF (left--ends up centered on the page) and EPS (right--exports just the graph).

enter image description here

A5C1D2H2I1M1N2O1R2T1
  • 190,393
  • 28
  • 405
  • 485
  • Hello, Thank you for your answer is pretty fast and works nice. Thank you http://i.stack.imgur.com/UmXRo.png – S12000 Dec 21 '12 at 16:52
  • @Swiss12000, Cool. I see from your profile that you have a couple of questions on the R tag. Any reason that you aren't creating these graphics in R and using Sweave or Knitr instead while writing your reports? – A5C1D2H2I1M1N2O1R2T1 Dec 21 '12 at 17:01
  • Hello yeah it's a good question. Actually, I'm a student. I try to adapt myself to the teacher. For some teacher - ie. marketing - I use LibreOffice or Excel to make simple graph because they are more colorfull. However, I use R graphs - via Sweave - for scientific paper or for homework such as statistics... – S12000 Dec 22 '12 at 03:35
5

I was faced to the same problem, and after trying different methods, I finally found a simple and great way to do that. Simply use the pdfcrop tool by tapping this simple command line:

    pdfcrop inputFile.pdf outputFile.pdf

Hope it will be helpful!

Monsef TAZI
  • 51
  • 1
  • 2