Free Support Forum - aspose.com

File size difference

Hi I have one question, if I execute simple code below:
InputStream inputStream = getClass().getClassLoader().getResourceAsStream(“test.doc”);

License licence = new License();

licence.setLicense(getClass().getClassLoader().getResourceAsStream(“Aspose.Total.Java.lic”));

Document document = new Document(inputStream);

document.save(“d:/output.doc”);

I notice that file size is droped to ~11k but source file is ~24k. Can you tell me why is this happening.

Test file is in attachment.

Thanks, Ivica.

Hello!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your inquiry.

MS Word document in DOC format represents a structured storage. It can be serialized more or less compactly. For instance, source document is 23.5KB long, roundtrip made with Aspose.Words is 10KB, but second roundtrip with MS Word is 32KB. That’s not strange and doesn’t lead to any data loss. Everything is retained.

Regards,

Thanks, Ivica.