How to automate 'paste as JPEG' for pasting pics in Word so as to reduce the entire document size?
Solution 1:
Have you tried the Compress pictures
option under Picture tools
- Format
? In the dialog you can choose from different copression amounts, and there is a checkbox Apply only to this picture
. Unchecking this, all of the images in your document will be compressed.
For images and more see this article ("Compress Pictures", almost on the bottom).
Solution 2:
So... here is another, a little bit hacky solution:
- Save your documents in docx format (if you have them in this, go to step 2);
- Change the extension of the document to zip (you can leave docx before, like yourdocumentname.docx.zip); if you want, you can create a backup of your original document before doing anything;
- Extract the contents of the zip file to a folder (lets name it
tmp
) with WinRAR or anything else; - In folder where you extracted the zip, look up a folder, named
word
; - In the
word
folder, there is amedia
folder, there are the images of the document stored; - Do the batch conversion for each png images with your tool you have;
- Check if you don't have the old png images in the folder (if you leave them there, the file size will increase instead of decrease, but I think it is unambiguous);
- If you have the converted jpg images in the
media
folder, go back to folderword
, then to_rels
; - In the folder
_rels
, open thedocument.xml.rels
file with notepad, or your favourite text editor (Sublime Text, Notepad++, etc.); - In the file, there are different
Relationship
nodes, replace all of the "png" extensions to "jpg" in theTarget
attributes where needed (eg. Target="media/image4.png" -> Target="media/image4.jpg"; most of the editors have a Replace All option in their Find/Replace dialog); - Save the edited file, go back to the root folder (
tmp
), select all, compress them back into a zip file (Important: don't include thetmp
folder, just its content!, the zip file should look like the original - renamed from docx - zip file); - Rename the new zip file to docx (eg. yourdocumentname.docx), and you are done! :)
There might be a less complicated way to do this, but this shuld work. If I had a little bit more time, I would create a tool for doing all this stuff programmatically, it could be useful for me too sometimes... Or there is a tool for this on the net, idk. (I haven't met anything like this yet.)