How to export chart from LibreOffice Calc as PDF

The straightforward solution to this is:

  1. Click on the chart to select it.
  2. Choose File > Export as PDF. Choose General > Range > Selection. Click Export.

The PDF file produced by this method has a few problems. It includes sheet number at the top and sometimes the content is cropped off at the page margins. Moreover, this produces a PDF that is the size of a A4 page, no matter what is the size of your chart.

A better solution is to:

  1. Click on the chart to select it.
  2. Right-click and choose Copy.
  3. Open LibreOffice Draw and paste there.
  4. Export the selection to PDF, just like above. This PDF does not have the sheet number at the top and the content is not cropped off.
  5. This PDF still is the size of a A4 page. To crop it down its content, use the PDFCrop tool.

Tried with: LibreOffice 3.5.7.2 and Ubuntu 12.04

About these ads

How to list definitions exported by Visual C++ library file

On Windows, library files (.lib) are commonly produced by compilation using the Visual C++ compiler. Sometimes, you may want to know which library file exports the definition of a certain function or global variable.

The definitions exported by a library file can be listed by using the dumpbin tool. This ships with Visual Studio and can be invoked by opening the Developer Command Prompt for Visual Studio.

To list the definitions exported by a library file use:

C:\> dumpbin /exports foo.lib

Note that C function definitions will have an underscore as prefix. But, C++ definitions will be much more mangled. However, if you know the function name or even a substring of it, you could investigate using the output of this program.

Tried with: Visual Studio 2012 and Windows 7 x64

How to export animated slides to PDF in LibreOffice Impress

LibreOffice Impress has a useful feature to export the slides of a presentation to PDF. However, if you have animated images in your slides, these animations are not exported to PDF. This is partly because most types of animations cannot be rendered in PDF as pages. However, the most common animation is for images to appear or disappear on mouse click. It should be possible to support these animations in PDF.

The ExpandAnimations extension can be used to export the appear-disappear animations in a LibreOffice Impress presentation to PDF. The download link for the oxt extension file can be found at its Github page. Double-click the file to install the extension using LibreOffice. Once installed, you can export any presentation open in Impress by using Tools > Add-ons > Expand animations

Tried with: ExpandAnimations 0.2, LibreOffice 3.5.7.2 and Ubuntu 12.04 LTS

How to export a version in Mercurial

Most of the work of transitioning from one version control system to another is figuring out the mapping from the jargon of the old one to the new. In Subversion, you could give someone a copy of a certain version using the export command. The copy thus created would be free of any repository information.

The corresponding operation in Mercurial is called archive. This creates an unversioned archive of a certain revision of the repository. Creating an archive of the current revision of your repository to give to a colleague named Harry is as easy as:

$ hg archive ../Copy-For-Harry

Another cool feature of the archive command is that it can create archives in compressed formats like zip. For example, to create a zip archive of the above:

$ hg archive Copy-For-Harry.zip

The hash of the revision being exported can be used in the name of the destination directory or file. For example:

$ hg archive Copy-For-Harry-%h.zip

The above command will create a file whose name might be Copy-For-Harry-72f497079285.zip, where 72f497079285 is the hash of the exported revision.

(Thanks to Rudi and Paul on StackOverflow for these tips.)

Tried with: Mercurial 1.9.2