Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export a LibreOffice Calc Chart to PDF witouth margins and empty space

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

like image 528
S12000 Avatar asked Dec 19 '12 11:12

S12000


People also ask

How do you export a graph in LibreOffice Calc?

You can copy (or cut) and paste your chart into a LibreOffice Draw page, and then, in LibreOffice Draw, select the chart, and export it with File>>Export. In the Export dialogue box, choose your graphics format and remember to check the 'selection' box.

How do you fit to page in LibreOffice?

go to Format -> Page -> Tab: Sheet -> Catgeory: Scale -> Dropdown: Fit print range(s) on number of pages and set option Number of pages to 1 . Hope that helps.

Where is the option of export direct as PDF?

From the file menu click Export As PDF. You may want to choose export options for PDF. Finally click export. If you click Export Directly as PDF, then PDF would be saved with default options.


2 Answers

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

like image 200
A5C1D2H2I1M1N2O1R2T1 Avatar answered Oct 19 '22 04:10

A5C1D2H2I1M1N2O1R2T1


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!

like image 21
Monsef TAZI Avatar answered Oct 19 '22 03:10

Monsef TAZI