Showing posts with label pdf. Show all posts
Showing posts with label pdf. Show all posts

Thursday, April 28, 2016

Saving Google Docs/Sheets charts as PDF

Google docs natively supports saving charts as PNG. But if you want to generate high quality images, such as PDF, you can follow the steps below.

1. Go to the Google Spreadsheet page with the chart
2. Open Chrome Developer Tools (from Chrome hamburger menu -- 3 lines menu -- on the top right)
3. Select the "Elements" tab and click on the button "Select an element to inspect it" present on the top left.
4. Click in the chart area.
5. Look at the tree and find the beginning of svg description (e.g. <svg...).
6. Right click on the SVG line and select "Copy as HTML"
7. Paste it to your favorite editor, and save as "MyChart.svg"

You can use image processing tools, such as Photoshop or GIMP to export the files as PDF.

References:
1. http://www.osmanoglu.org/computing/89-how-to-export-google-spreadsheet-charts-as-svg

Saturday, August 16, 2014

Using embedded fonts in eps graphs generated using gnuplot

When submitting camera ready versions to conferences/journals, you might come across a requirement where all the fonts (including those used in the EPS/PDF figures) should be embedded in the PDF.

To use embedded fonts in graphs generated using gnuplot, we need to use the font file used by MIKTEX (on windows) or its equivalent on Linux. In the below example, we use the "NimbusSanL-Regu" embedded font available in the ".pfb" file in the fonts folder in the Miktex installation directory (something like ...\Program Files\MiKTeX 2.7\fonts\type1\urw\helvetic\).

set terminal postscript eps enhanced "NimbusSanL-Regu" 12 fontfile "uhvr8a.pfb"
set output 'filename.eps'

When using the ".pfb" file you might come across an error in Gnuplot like:
"Automatic font conversion pfb->pfa not supported"

For this you can convert the pfb file to pfa file using tools like "pfbtops" (supports on-the-fly conversion to .pfa type) or "pfb2pfa" (if on-the-fly is not needed and you need the .pfa file output).  There is also an online service (http://everythingfonts.com/pfb-to-pfa) that can generate the pfa file.

Once the .pfa file is generated, you can use it in the same format.
set terminal postscript eps enhanced "NimbusSanL-Regu" 12 fontfile "uhvr8a.pfa"

References:
1. http://www.cepe.ethz.ch/howtodos/embed_fonts
2. http://everythingfonts.com/pfb-to-pfa
3. http://gnuplot.sourceforge.net/docs_4.2/node413.html

Thursday, July 24, 2014

Latex 'pdfpagelabels' turned off when using Hyperref

I received the following error when using ACM's sig-alternate.cls style file and using the PDFLatex command.

Error:
Package hyperref Warning: Option `pdfpagelabels' is turned off
hyperref because \thepage is undefined.

That seems to be caused by an update of the hyperref package. The workaround is to switch this option off.
Instead of using:
\usepackage{hyperref}


Use:
\PassOptionsToPackage{pdfpagelabels=true}{hyperref}

References:
1. http://www.latex-community.org/forum/viewtopic.php?f=5&t=162

Wednesday, July 16, 2014

Gnuplot pdf terminal dashed lines

To set pdf terminal in Gnuplot, check if the output of command "print GPVAL_TERMINALS" contains "pdfcairo" listed. If yes, then you can set the terminal output as PDF using the command

set terminal pdf
set output 'out.pdf'

To enables dashed lines when using PDF terminal in gnuplot, as pointed out in reference [1], set the terminal using the command below

set terminal pdf monochrome dashed
set output 'out.pdf'

References:
1. http://theletterpsi.blogspot.com/2010/11/setting-dashed-line-style-on-pdf.html
2. http://stackoverflow.com/questions/14004797/gnuplot-pdf-output