-
Notifications
You must be signed in to change notification settings - Fork 78
Description
Word compresses images by default. This results in not maintaining the original OneNote image quality.
I was successfully able to turn off image compression in Word for the conversion script by updating the relevant setting via the registry. Note that the registry key path could vary by Word version (I'll include a comment below with a more generic script that handles this).
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Word\Options" `
-Name "AutomaticPictureCompressionDefault" `
-Type DWord -Value 0
I confirmed that this causes the "Do not compress images in file" setting in the generated docx file to be checked, and the resulting image resolution to be what's expected (or at least larger than the compressed version).
Note that if "Do not compress images in file" is checked, the "Default resolution" setting doesn't matter. If you want to enable compression but change the default resolution, you could try setting AutomaticPictureCompressionDefault
to 1 and modifying the ExportBitmapResolution
registry value.
I tried just updating the compression setting via Word's GUI located at File > Options > Advanced (see pic below), but even though I selected "All New Documents", Word docs created via the conversion script still had the default compression settings (confirmed by checking the setting in the generated docx file - not shown in pic below) and the resulting image resolution indicated compression occurred.
*Note that you can't interact with the settings unless you have a document open.