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

Free Support Forum - aspose.com

Priniting images after merge

We have, for years, used Aspose Word to conduct mail merge and generate order forms for our customers. These forms include photos of a graduate or member of a Greek house. The images are 480 pixels wide by 600 pixels high and are saved at 300 DPI. Therefore, an image should print out 1.6"x2".

Before you delivered print capability, we simply saved the documents and opened and printed them in Word. When using Aspose Word version 4.2.1.0, the images display in Word and print correctly.

With version 6.4.0.0 we are using the document print function. However, the images are not rendered in the correct size. Instead they are printing out 4”x 6”.

Please let me know how I can fix this problem.

Bill

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Could you please attach your document here for testing? I will check the problem with the latest version of Aspose.Words and provide you more information.

Best regards,

Attached is the merge template and a photo.

This is the following code as to how we do the merge for photos where path is the name of the merge field, sPath is the path to the image. RollNbr and FotoNbr are the roll and photo number for a specific photo.

db.MoveToMergeField("Path")

db.InsertImage(sPath)

db.MoveToMergeField("RollNbr")

db.Write(rowsFotos(iSFotoIndex).RollNbr)

db.MoveToMergeField("FotoNbr")

db.Write(rowsFotos(iSFotoIndex).FotoNbr)

So the above demonstrates how we insert multiple photos into a template (this code is inside a loop where we are iterating through the photos assigned to a particular graduate). What is not being shown is how we handle the fact we do not know in advance exactly how many photos a particular graduate may have and how we handle the fact that a particular individual may have more photos than there are Path merge fields on a form (word document template). But we do handle these conditions perfectly.

PS: If I save the document as a Word document, the same problem is appearing. So this problem is not limited to the Print function.

Bill

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. But I cannot reproduce the problem on my side. I use the latest version of Aspose.Words for testing. You can download it from here:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

Here is code I used for testing:

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

DocumentBuilder builder = new DocumentBuilder(doc);

builder.MoveToMergeField("Path");

builder.InsertImage(@"Test001\1008.JPG");

doc.Save(@"Test001\out.doc");

PrinterSettings settings = new PrinterSettings();

settings.PrintToFile = true;

settings.PrinterName = "Microsoft Office Document Image Writer";

settings.PrintFileName = @"Test001\out.tif";

doc.Print(settings);

I also attached the output document and printed TIF.

Best regards,

I do not have a license for 8.1. The print function in 6.4 is supposed to work. Can you please verify or disprove there is a problem with the 6.4 version?

Sincerely,

Bill Lucas

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I can confirm that the problem occurs with 6.4 version of Aspose.Words. So you should renew you license and update.

Best regards,