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

Free Support Forum - aspose.com

Images rearranged when converting Work to PDF

Hi

When converting a word doc to a PDF, images that appear in-line in the word doc appear with a break between them in the generated PDF.

See below for sample code. Note that a c:\temp durectory is required with a sample bitmap file named 1.bmp (or change the code).

Can you please advise.

Regards,

Gareth

SAMPLE CODE

Public Sub DocImagesTest()

Dim doc As New Aspose.Words.Document()

Dim builder As New Aspose.Words.DocumentBuilder(doc)

builder.InsertImage("c:\temp\1.bmp")

builder.InsertImage("c:\temp\1.bmp")

builder.InsertImage("c:\temp\1.bmp")

doc.Save("c:\temp\test.doc")

' inspecting the doc here shows the images to be inline i.e. are arranged horizontally

Dim pdf As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf

Dim stream As System.IO.MemoryStream = New System.IO.MemoryStream

Dim xmlDoc As System.Xml.XmlDocument = New System.Xml.XmlDocument

doc.Save(stream, Aspose.Words.SaveFormat.FormatAsposePdf)

stream.Seek(0, System.IO.SeekOrigin.Begin)

xmlDoc.Load(stream)

pdf.BindXML(xmlDoc, Nothing)

pdf.Save("c:\temp\test.pdf")

'inspecting the pdf here shows the images to have a break between them i.e. are now arranged vertically

End Sub

Hi,

I have tested your code and was able to reproduce the error. I have logged this as PDFNET-4409 in our issue tracking system. We will try our best to resolve this as soon as possible.

Thanks.

Hi,

I think we have fixed this bug, Please dowload the latest dll 3.8.0.0 at http://www.aspose.com/community/files/51/file-format-components/aspose.pdf/category1184.aspx

Thank.