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

Free Support Forum - aspose.com

Shading issue with faxed documents

Hi,

I have a template document that contains MergeFields within a table. Once the data is merged into the template, we are sending the document to either a printer or fax machine, depending on the print request type. Currently, the document goes to the printer just fine. However, when the same document goes to a fax machine we are seeing some additional shading on the far-right column (and only the far-right column) that is not part of the original template.

I've attached two documents as an example. The DOC file is the original template before any data is merged. The PDF file is a scan of the output from the fax machine. Some data has been blocked out (in red) as the document contains Patient Health Information. The shading issue is on the right-side, top-half of the page.

Is this issue reproducible on your side?

*** Our developer who normally works on these issues is out for a while, but let me know if you need any details about how we are using the Aspose API, and I will forward them to him.

Thank you,

Brandon Yarborough - On Behalf of Bob Kells

Hi

Thanks for your request. Unfortunately, I cannot reproduce the problem on my side. Does the problem occur only with this particular document? Have you tried rendering the document to images and then print the image? Maybe this can help you. Please see the following code:

[Test]

public void Test001()

{

// Open source document.

Document doc = new Document(@"Test001\in.doc");

// Save the document as an image.

using (MemoryStream imageStream = new MemoryStream())

{

doc.Save(imageStream, SaveFormat.Tiff);

// Load the image back into another document

imageStream.Position = 0;

Document imageDoc = LoadImage(imageStream);

// Print the document.

imageDoc.Print();

}

}

///

/// Loads an image into Aspose.Words.Document object.

///

/// Stream with an image.

public Document LoadImage(Stream inputStream)

{

// Create Aspose.Words.Document and DocumentBuilder.

// The builder makes it simple to add content to the document.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

// Read the image from file, ensure it is disposed.

using (Image image = Image.FromStream(inputStream))

{

// Get the number of frames in the image.

int framesCount = image.GetFrameCount(FrameDimension.Page);

// Loop through all frames.

for (int frameIdx = 0; frameIdx < framesCount; frameIdx++)

{

// Insert a section break before each new page, in case of a multi-frame TIFF.

if (frameIdx != 0)

builder.InsertBreak(BreakType.SectionBreakNewPage);

// Select active frame.

image.SelectActiveFrame(FrameDimension.Page, frameIdx);

// We want the size of the page to be the same as the size of the image.

// Convert pixels to points to size the page to the actual image size.

PageSetup ps = builder.PageSetup;

ps.PageWidth = ConvertUtil.PixelToPoint(image.Width, image.HorizontalResolution);

ps.PageHeight = ConvertUtil.PixelToPoint(image.Height, image.VerticalResolution);

// Insert the image into the document and position it at the top left corner of the page.

Shape shape = builder.InsertImage(

image,

RelativeHorizontalPosition.Page,

0,

RelativeVerticalPosition.Page,

0,

ps.PageWidth,

ps.PageHeight,

WrapType.None);

}

}

return doc;

}

Hope this helps.

Best regards,