I used standard code to convert word to TIF. It works fine, except for some documents where a Heading or Outline Style line is shaded/filled gray along with colored text. The gray shading converts to dark black and the text (anything other than white) is not visible. Changing the resolution does not solve issue. A range of compression levels have been tried the only ones that convert correctly are those that convert to a color representation. We need to remain with a B/W image. Is there a way to have the text display and the shading to stay the original shade, without having to go into each individual paragraph and table object and doing checks/coding there?
XML representations around the heading section in question:
<w:pPr>
<w:shd w:val=“clear” w:color=“auto” w:fill=“7C736E” />
<w:spacing w:before=“45” />
<w:ind w:left=“75” />
<w:outlineLvl w:val=“2” />
<w:rPr>
<w:rFonts w:ascii=“Verdana” w:hAnsi=“Verdana” />
<w:b />
<w:bCs />
<w:smallCaps />
<w:color w:val=“4B0082” />
<w:sz w:val=“41” />
<w:szCs w:val=“41” />
<w:u w:val=“single” />
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii=“Verdana” w:hAnsi=“Verdana” />
<w:b />
<w:bCs />
<w:smallCaps />
<w:color w:val=“4B0082” />
<w:sz w:val=“41” />
<w:szCs w:val=“41” />
<w:u w:val=“single” />
</w:rPr>
<w:t>CONTRACTS</w:t>
</w:r>
</w:p>
Note that the code is not exact below. I copied and pasted from several different functions.
'************************************************************
'Load up document into doc object [which we do through a series of steps]
docExample = …
var imageSaveOptions = new ImageSaveOptions(SaveFormat.Tiff)
{
HorizontalResolution = 300,
VerticalResolution = 300,
PixelFormat = 1,
TiffCompression = [I tried all of the value]
};
foreach (var section in docExample.Sections.Cast())
{
section.PageSetup.Orientation = this.FormProps.WordOrientation;
}
docExample.Save(“C:\SaveToLocation.Tif”, imageSaveOptionsObject)
'************************************************************
Any help will be appreciated.
Samples.zip (106.8 KB)
Samples have been uploaded.
Code is within posting.