PLEASE NOTE - This function has now been superseded by EXPORT_FIG, which encompasses all its functionality plus some further functionality. This function will therefore no longer receive any support. EXPORT_FIG can be downloaded from:
http://www.mathworks.com/matlabcentral/fileexchange/23629
PRINT_PDF saves a figure to a pdf file, with:
- Figure borders cropped
- Fonts embedded (as subsets)
- Accurate vector graphics, compressed losslessly
- High quality bitmap graphics, compressed lossily
- Line dash lengths vary with line width (as on screen)
- Grid lines given their own dot style, instead of dashed
- No options to be set
The screenshot demonstrates the benefit of PRINT_PDF over MATLAB's pdf saving functions. It shows a figure (top right) saved to pdf using MATLAB's gui "File->Save as..." option (bottom right) and PRINT_PDF (left). MATLAB's default options provide no cropping, inaccurate vector graphics (including nasty dashed lines which don't resemble those in the original figure) and highly compressed, blocky bitmap graphics. PRINT_PDF overcomes these issues (albeit generating a larger file), and additionally embeds all fonts - perfect for using the pdf in scientific papers which require this.
PRINT_PDF requires only a target filename and an optional figure handle - there are no other options to be set. The output pdf is exactly the size and layout of the figure on the screen.
PRINT_PDF uses ghostscript, so this must be installed on your system and the executable must be on your system's path. Get ghostscript from:
http://www.ghostscript.com |