Dear Support,
I have been using the Aspose PDF from Word template using the ExecuteByRegions option and is working well. Now I am confronted with a situation where one such data element to be shown is an Image (from the webserver not from DB). Image works well when creating new PDF from scratch I am unable to get the image on the PDF derived from the .DOT file. No error but I get 'System.Byte()' in place of the intended bookmark. Here's the code. Many thanx in advance - Rgds Pavan
Dim license As New Aspose.Word.License()
license.SetLicense("Aspose.Enterprise.Word.lic")
Dim doc As New Document(Request.MapPath(Request.ApplicationPath) & "\QoutationSamples\StandardTemplate.dot")
Dim mstream As System.IO.MemoryStream = New System.IO.MemoryStream()
Dim b As System.Drawing.Bitmap = New System.Drawing.Bitmap(Request.MapPath(Request.ApplicationPath) & "\Imgs\bottom_logo.gif")
b.Save(mstream, System.Drawing.Imaging.ImageFormat.Gif)
Dim licensePDF As New Aspose.Pdf.License()
licensePDF.SetLicense("Aspose.PDF.lic")
Dim pdf1 As Pdf = New Pdf()
Dim sec1 As Aspose.Pdf.Section = New Aspose.Pdf.Section(pdf1)
pdf1.Sections.Add(sec1)
Dim image1 As Aspose.Pdf.Image = New Aspose.Pdf.Image(sec1)
sec1.Paragraphs.Add(image1)
image1.ImageInfo.ImageFileType = ImageFileType.MemoryBmp
image1.ImageInfo.OpenType = ImageOpenType.Memory
image1.ImageScale = 0.5F
Dim reader As System.IO.BinaryReader = New System.IO.BinaryReader(mstream)
mstream.Position = 0
image1.ImageInfo.MemoryData = reader.ReadBytes(CType(mstream.Length, Integer))
b.Dispose()
Dim fieldNames() As String = {"CUST_NAME"}
Dim fieldValues() As Object = {image1.ImageInfo.MemoryData}
doc.MailMerge.Execute(fieldNames, fieldValues)
'pdf1.Save("MyQoute.pdf", Aspose.Pdf.SaveType.OpenInAcrobat, Me.Response)
SendToBrowserAsPdf(doc)
Response.End()