Reading the mailing list of SFWTools I noticed that a tool (gfx2gfx) was mentioned for this purpose, but it needs to be compiled explicitly.
On GitHub a guy posted a script to compile it, but on Snow Leopard it needed a small change to work (change taken from the configure parameters of the MacPorts version of SWFTools). With this change it also works on Mavericks (maybe event without the change).
So, in brief:
- First of all, you need at least a C compiler installed (XCode preferred :P)
- Download and install MacPorts
sudo port install pdflib
- Create a script with this code:
# Create working folder and download sourcesmkdir swftoolscd swftools
# Git is requiered here to download sources
git clone git://github.com/matthiaskramm/swftools .# replace `../../swftools/` to `../` in sources
sed “s/../../swftools//..//g” src/gfx2gfx.c > src/gfx2gfx.c.tmp && mv src/gfx2gfx.c.tmp src/gfx2gfx.c# On top of `Makefile.in` add `vpath = src` (will add `src` folder to sources folders)
echo “vpath = src” | cat – Makefile.in > Makefile.in.tmp && mv Makefile.in.tmp Makefile.in#These are the parameters that I took from the MacPort version of SWFTools
./configure CPPFLAGS=”-I/opt/local/include” LDFLAGS=”-L/opt/local/lib”
chmod +x name_of_the_script.sh
- Execute the script
Now, in my case, only a warning was thrown (“warning: no debug symbols in executable (-arch x86_64)”), but gfx2gfx was compiled (you can find it in swftools/src).
I noticed that if you compile it with the latest snapshots, it compresses the images when converting to PDF.
The first time I compiled it (november 2013) I found a way to deactivate this function, now (february 2014) I can’t remember what I modified! 😛 To avoid compressing the images, you should change the value (default 72) of the dpi in the file pdf.c (“i->config_maxdpi=”, near the end) in lib/devices. But if you use this script, the files will be downloaded and compiled automatically, so if you want to improve picture quality I suggest to download them manually, edit the file, and start the script without the GitHub portion.
So here I’m attaching the two binaries compiled: they both work with Mavericks.