We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Text within a shaded Heading not visible

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.

@Bowermml1973

Thanks for your inquiry. We have tested the scenario without using TiffCompression and have not found the shared issue. Could you please share which TiffCompression you want to use? We will then investigate the issue and provide you more information on it.

@Bowermml1973

We have logged this problem in our issue tracking system as WORDSNET-18176. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@Bowermml1973

It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-18176) as ‘Not a Bug’.

Please use the following image save options to get the desired output.

Document doc = new Document(MyDir + "Input.doc");

ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Tiff)
{
    HorizontalResolution = 300,
    VerticalResolution = 300,
    TiffCompression = TiffCompression.Ccitt4,
    PixelFormat = ImagePixelFormat.Format1bppIndexed,
    TiffBinarizationMethod = ImageBinarizationMethod.FloydSteinbergDithering
};

foreach (Section section in doc.Sections)
{
    section.PageSetup.Orientation = Orientation.Landscape;
}

doc.Save(MyDir + "19.3.tiff", imageSaveOptions);