My word Doc is generating nicely from my word template, however, when I save as PDF, it generates, but doesn’t display the image embedded in the word template header.
Attached includes. Template file, Word output file and pdf output file.
Code Snippet below.
If docType.ToLower().Trim() = "word" Then
Dim fileName As String = _FilePath & "\Word" & "ProfileReport" & _Rpt.rptID.ToString() & ".doc"
dstDoc.Save(fileName, SaveFormat.FormatDocument)
_email.SendAsposeReport(_Rpt.rptID, _Rpt.rptDESCRIPTION, _EmailAddress, _FilePath & "\Word", "word")
ElseIf docType.ToLower().Trim() = "pdf" Then
'Save the document in Aspose.Pdf.Xml format.
dstDoc.Save(_FilePath & "\XML\ProfileReport" & _Rpt.rptID.ToString() & ".xml", SaveFormat.FormatAsposePdf)
'Read the document in Aspose.Pdf.Xml format into Aspose.Pdf.
Dim pdf As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf
pdf.BindXML(_FilePath & "\XML\ProfileReport" & _Rpt.rptID.ToString() & ".xml", Nothing)
'Instruct to delete temporary image files.
pdf.IsImagesInXmlDeleteNeeded = True
'Produce the PDF file.
pdf.Save(_FilePath & "\PDF\ProfileReport" & _Rpt.rptID.ToString() & ".PDF")
_email.SendAsposeReport(_Rpt.rptID, _Rpt.rptDESCRIPTION, _EmailAddress, _FilePath & "\Pdf", "pdf")