2014-03-14 34 views
0

我們使用aspose生成word和pdf報告,報告大小約爲1.5 mb,沒有嵌入任何圖像。 我們使用 documentBuilder.InsertImage(byte [] byteArray) 傳遞一個大小爲61 kb的字節數組。但在插入圖像後,文檔的大小變爲15 mb。 有什麼辦法來減少我們使用許可aspose.net版本插入圖像後文件大小增加

回答

0

我想你的情況有一個word文件(1.75 MB)和圖像文件(1 MB高分辨率)和使用的DocumentBuilder文檔 的大小。 InsertImage(byte [] byteArray)方法將圖像插入word文件。生成的文件大約爲3.5 MB(使用Aspose.Words生成)。如果我使用MS Word插入相同的圖像,則生成的文件大小爲2.75 MB。因此,Aspose.Words和MS Words輸出之間存在差異。但是,在你的情況下,差異是巨大的。

原因可能是:

1: Your code might be adding image multiple times causing file size 
to grow. 

2: Issue might be specific to your word file or image file. 

3: You might be using an old version of Aspose.Words API. 

我會建議你:

1: Share your code here to check if it is same as mine. 

2: Download and try the latest version of Aspose.Words API as Aspose 
team is constantly working on improving the performance and seeing 
your results, it seems you might be using an older version. 

3: Share your word document and image file on Aspose Support Forums 
and Aspose team can further investigate your issue.