Below you will find pages that utilize the taxonomy term “PDF”
September 26, 2023
Which image format should I use?
Many image file formats exist, but which ones are better for what task? Here is a quick overview in my little series of PhD advice blog posts (the previous being tips on dissertation writing and the public PhD defense).
Two different image types When choosing a file format for your image, the first thing is to figure out whether you are dealing with a raster image (photos) or a vector image (line illustrations).
April 10, 2023
Editing PDF metadata
Sometimes it is necessary to check, remove or modify the metadata of PDF files. Here is a quick post to show how it can be done in the terminal on Ubuntu
Checking PDF metadata Most PDF viewers have an option for showing the metadata of PDF files. This can also be done in the terminal using the “pdfinfo” command-line tool. First, we need to install the “poppler-utils” package:
sudo apt install poppler-utils Once installed, you can check the metadata by using the following command:
December 30, 2022
Adding Title and Author to PDFs exported from Jupyter Notebook
I am doing some end of the year cleaning on my hard drive and just uploaded the Jupyter Notebook I used in the analysis of a mobile phone lying still earlier this year.
For some future studies, I thought it would be interesting to explore the PDF export functionality from Jupyter. That worked very well except for that I didn’t get any title or author name on top:
Then I found a solution on Stack Overflow.
December 21, 2022
Scripting image exports with LibreOffice Draw
As mentioned yesterday, the source files for the illustrations in my Sound Actions book are available on GitHub in the form of LibreOffice Draw files (ODG).
Draw may be less powerful but much easier to work with than more advanced line art software, such as Inkscape. One of the nice things about the LibreOffice package is its scripting possibilities. While working on my book, I wrote a shell script that would read all the ODG files in a folder and convert them to PDF and PNG files:
June 16, 2022
Export images from a PDF file
I have previously written about how to export each of the pages of a PDF file as an image. That works well for, for example, presentation slides that should go on a web page. But sometimes there is a need to export only the images within a page. This can be achieved with a small command line tool called pdfimages.
One way of using it is:
pdfimages -p -png file.pdf image This will export all images in file.
August 24, 2020
Improving the PDF files in the NIME archive
This blog post summarizes my experimentation with improving the quality of the PDF files in the proceedings of the annual International Conference on New Interfaces for Musical Expression (NIME).
Centralized archive We have, over the last few years, worked hard on getting the NIME adequately archived. Previously, the files were scattered on each year’s conference web site. The first step was to create a central archive on nime.org. The list there is automagically generated from a collection of publicly available BibTeX files that serve as the master document of the proceedings archive.
August 23, 2020
Shell script for compressing PDF files on Ubuntu
I have previously written about a shell script) for compressing PDF files in Ubuntu. Here are some variants of the script.
Low, mid, and high resolution Low resolution for screen:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf in.pdf I prefer the “ebook” mode, which has slightly higher resolution:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf in.pdf And then there is the high resolution for printing:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.
November 29, 2019
Creating individual image files from presentation slides
How do you create full-screen images from each of the slides of a Google Docs presentation without too much manual work? For the previous blog post on my Munin keynote, I wanted to include some pictures from my 90-slide presentation. There is probably a point and click solution to this problem, but it is even more fun to use some command line tools to help out. These commands have been tested on Ubuntu 19.
December 27, 2016
Split PDF files easily using Ubuntu scripts
One of the fun parts of reinstalling an OS (yes, I think it is fun!), is to discover new software and new ways of doing things. As such, it works as a “digital shower”, getting rid of unnecessary stuff that has piled up.
Trying to also get rid of some physical mess, I am scanning some piles of paper documents. This leaves me with some large multi-page PDFs that I would like to split up easily.
June 29, 2016
Shell script for compressing PDF files on Ubuntu
Back on OSX one of my favourite small programs was called PDFCompress, which compressed a large PDF file into something more manageable. There are many ways of doing this on Ubuntu as well, but nothing really as smooth as I used to on OX.
Finally I took the time to figure out how I could make a small shell script based on ghostscript. The whole script looks like this:
#!/bin/sh gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.
May 22, 2011
Reducing PDF file size
I am working on finalizing an electronic version of a large PDF file (600 page NIME proceedings), and have had some problems optimizing the PDF file. This may not be so strange, since the file is an assembly of 130 individual PDF files all made by different people and using all sorts of programs and OS.
Usually, PDFCompress works wonders when it comes to reducing PDF file sizes, but for the proceedings-file it choked at some of the fonts.
April 18, 2011
Use Preview instead of Adobe Reader in Texmate
I just installed Adobe Reader on my new computer, only to discover that it hijacked the PDF preview window in TextMate when working on LaTeX documents. This also happened the last time I installed a new system, and I couldn’t remember what I did to change it back to using Preview as the default PDF viewer.
After googling around, I remembered that TextMate is just using the regular browser settings when it comes to displaying PDF files.
August 9, 2010
PDF merge in preview
After I began using PDFCompress for minimizing PDF files, the only reason I have had for using the full Adobe Acrobat has been to combine PDFs. Now I realize that since OS 10.5 this functionality has been built into Preview. I guess I should really start reading the release notes of OSes and applications a bit more carefully, since I managed to get to 10.6 before I found out about this feature.
June 20, 2010
PDF please
I receive a lot of e-mails from students, and even though I always tell them to send me PDF files, they almost always send me the source files for their documents instead (.doc, .docx, .odt, .pages, …). This semester we have started with electronic submission of term papers at our department, and even though it said everywhere that PDF was the file format to submit, of course all sorts of other formats turned up.
July 16, 2008
The challenge of creating booklets
I have been trying to create a booklet out of a standing A4 paper (the booklet size should be 105 x 297 mm), but this has proven to be much more difficult than I would have originally thought. It is a while since I have been doing things like this, and I still remember how easy it was to do such things back in the days when I used to use MS Publisher 1.
May 17, 2006
PDF reading
Marc Hedlund at O’Reilly summarizes the good things about PDF books:
- They are searchable.
They are portable. They can often be bought and downloaded immediately. I am still trying to decide what I think about this. In general I prefer to have all articles and reference literature available as PDFs in my digital library, currently organizing them using DevonThink Pro. As computer screens are finally getting bigger, brighter and with higher resolution (even the new MacBook is sporting 1200x800 pixels on the 13 inch screen), it is becoming increasingly more pleasant reading on screen.