Mailmerge field in Footer causes <<Error! Bookmark not defined>> on second page when converted to pdf

Hello,

we had some problems with mailmerge fields in the footer of our documents. On page 1 everythins is ok, but on the second page we see “Error! Bookmark not defined.” For an example see “Doc1.docx” and the “Doc1.pdf” as result. The document is based on template RIS_VO_UCC.zip.

Aspose.Words.dll 15.1
.net 3.5
internal bugid#6184

The code is very simple

string sourceFN = Path.Combine(@“C:\temp”, “Doc1.docx”);
string destFN = Path.Combine(@“C:\temp”, “Doc1.pdf”);

if (File.Exists(destFN))
{
File.Delete(destFN);
}

Assert.IsTrue(File.Exists(sourceFN));
Assert.IsFalse(File.Exists(destFN));

Document doc = new Document(sourceFN);

IMailMergeDataSource mailMergeSource = new MailMergeSource(“r_vo”);
doc.MailMerge.Execute(mailMergeSource);

doc.Save(destFN, SaveFormat.Pdf);

Assert.IsTrue(File.Exists(destFN));


The full example code is included as attachment.

Best regards, Martin Pfeifer

Hi Martin,


Thanks for your inquiry. This problem occurs because MERGEFIELD on second page was invalid; I have fixed the error and attached modified document here for your reference. Please let me know if I can be of any further assistance.

Best regards,