Hello, thanks for responding.
My Syncfusion version :18.4.0.46 and uploaded word doc and also code snippet. if you see in header i have logo which isn't converting to pdf.
FileStream fileStreamPath = new FileStream(_currentEnvironment.WebRootPath + "\\template\\Worker Status Determination Statement template v1.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx);
string[] fieldNames = new string[] { "WorkerName", "WorkerAddress", "WorkerOperatingAs", "WorkerIntermediary", "WorkerOtherIntermediary", "EngagementDate", "EngagementContractingParty", "EngagementBusinessContact", "EngagementDetails", "DeterminationDate", "EngagementScope", "WorkerDeemed" };
string[] fieldValues = new string[] { $"{currentMapping.Freelancers.FirstName} {currentMapping.Freelancers.LastName}", currentMapping.FreelancerAddress, currentMapping.FreelancerOperatingAs, currentMapping.FreelancerIntermediary, currentMapping.FreelancerOtherIntermediary, currentMapping.Projects.StartDate.ToString("dd-MMM-yyyy"), currentMapping.Projects.ContractingContact, currentMapping.Projects.BusinessContact, currentMapping.Projects.Description, currentMapping.DeterminationDate.HasValue ? currentMapping.DeterminationDate.Value.ToString("dd-MMM-yyyy") : string.Empty, currentMapping.EngagementScope, currentMapping.WorkerDeemed };
document.MailMerge.Execute(fieldNames, fieldValues);
DocIORenderer render = new DocIORenderer();
render.Settings.ExportBookmarks = Syncfusion.DocIO.ExportBookmarkType.Headings;
render.Settings.ChartRenderingOptions.ImageFormat = ExportImageFormat.Jpeg;
PdfDocument pdf = render.ConvertToPDF(document);
MemoryStream memoryStream = new MemoryStream();
pdf.Save(memoryStream);
render.Dispose();
pdf.Close();
document.Close();
memoryStream.Position = 0;
return File(memoryStream, "application/pdf", $"Worker Status Determination Statement-{currentMapping.Freelancers.FirstName}-{currentMapping.Projects.Name}-{currentMapping.IR35QuestionnairesVersionHistory.Name}.pdf");
Attachment:
Worker_Status_Determination_Statement_template_v1_110000b8.zip