Simple word to PDF conversion doubles PDF size

Hi,
Im using the newest version of the Aspose.Words DLL (14.9.0.0)

Im using the following code to convert my attached word document to PDF (size 108kb)

Dim fil() As Byte = File.ReadAllBytes(“C:\Test\MJ\DABLejerRyk1ny.docx”)
Dim ms As New MemoryStream(fil)
Dim wordDoc As New Aspose.Words.Document(ms)

Dim resultStream As New MemoryStream()
wordDoc.Save(resultStream, SaveFormat.Pdf)

File.WriteAllBytes(“C:\Test\MJ” + Guid.NewGuid().ToString() + “.pdf”, resultStream.ToArray())

Result = 226kb

This means that my word doc goes from 108kb to 226kb when converted into PDF.
Why is that and how can I improve it?

I have tried using the following code:

Dim pdfOptions As New PdfSaveOptions()
pdfOptions.ImageCompression = PdfImageCompression.Jpeg
pdfOptions.JpegQuality = 10

The images inside the Word doc is GIF and furthermore im not interested in setting such a low image quality



Hi Thomas,


Thanks for your inquiry. But, if you convert this document to PDF format using Microsoft Word 2013, it will produce a PDF of size 239 Kb (see attachment) which is higher than Aspose.Words generated PDF. This seems to be an expected behavior. If we can help you with anything else, please feel free to ask.

Best regards,