Small Victories Department, Take 2
Jun. 22nd, 2017 11:51 amMy client sends me a huge (50 MB) Word file that frankly, can only be transmitted using exceptional means (i.e., Dropbox, Skype) because few, if any, email systems will allow attachments of such size. My task is not to translate the monster, but to reduce the size of the file.
My first step involved doing a search-and-replace on the graphics, searching for ^g and replacing with nothing. The resulting file was less than 2 MB in size, so it's a safe bet that reducing the size of the graphics (in the sense of data volume, as opposed to display dimensions) is called for.
I did not quite write a macro to do this, but I think one could be written with little trouble. The general algorithm would be:
The final product was a hair over 6 MB in size, which is still large enough to make some email systems gag, but completely usable elsewhere.
Excelsior!
My first step involved doing a search-and-replace on the graphics, searching for ^g and replacing with nothing. The resulting file was less than 2 MB in size, so it's a safe bet that reducing the size of the graphics (in the sense of data volume, as opposed to display dimensions) is called for.
I did not quite write a macro to do this, but I think one could be written with little trouble. The general algorithm would be:
- Make sure ImageMagick is installed with the legacy convert option enabled.
- In Word, find the next graphic
- Cut the graphic to the clipboard.
- From a DOS command line, in a known directory (say, C:\temp) run the command convert clipboard:myimage image.png.
- In Word, click on Insert|Pictures, navigate to the known directory from step 4 (this only needs to be done the first time), select image.png and click on Insert.
- Unless all of the graphics have been replaced, go to step 2 and repeat the subsequent steps.
The final product was a hair over 6 MB in size, which is still large enough to make some email systems gag, but completely usable elsewhere.
Excelsior!