CompressionLevel


#1

When using the compressionlevel the size of the file is not changing. Any ideas?

Code is,

MemoryStream stream = new MemoryStream(); doc.Save(stream, SaveFormat.FormatAsposePdf); //Seek to the beginning so it can be read by XmlDocument. stream.Seek(0, SeekOrigin.Begin); //Load the document into an XmlDocument XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(stream); Pdf pdf = new Pdf(); pdf.CompressionLevel = 9; pdf.IsImagesInXmlDeleteNeeded = true; pdf.BindXML(xmlDoc, null); pdf.Save(pdfFile); return pdfFile;

#2

Thanks for considering Aspose.

The value of compression level can be between 0 (the least compression) to 9 (the most compression) and the default value is 6. If file has reached it's biggest compression ability, setting more bigger value won't take on action any more.

You can try to set the pdf.CompressionLevel to 0 to see if this function is working.


#3

No matter what compression level I chose, the file didn’t really change size very much at all. Converting a 86KB word document into PDF created a 612KB file. I thought this seemed a little large. Maybe this is OK?


#4

It seems not normal. Can you please attach the Word document and let us check it?


#5

Here is a document 1.1 Mb created from a 137 Kb word doc.


#6

Thanks for considerin Aspose.

Could u attach the original word doc or mail to changsha@aspose.com ? The original word doc is the key for us to research problems. We have no ideal to find out reasons with your attached pdf files.


#7

Sorry, heres the doc.


#8

Hi,

Thank you for considering Aspose.

The vertor image EMF and WMF is not supported natively in Aspose.Pdf and they have to be converted into bitmap which makes the file becomes large. We will try to support vector image but I don't think we can finish it in short time.


#9

Thanks. Took the images out and compressed nicely.

Jason