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

Free Support Forum - aspose.com

Mail merge - PDF size issue using Aspose.Words


I have started evaluating you Aspose.Words for .Net. It’s pretty impressive but noticed one issue. The PDF output from the mail merge is atleast 4times more than what I see when printed to Adobe printed.

Do you have a way to fix this and get the same outfile size that is from Adobe? Is there any other product that helps me to achieve this?


Thanks for your request. Size of PDF documents can be reduced only by doing the following:

1. Decreasing size of images inside PDF (this can be done only be decreasing quality).

2. Subsetting fonts, which are embedded into the PDF documents. (Aspose.Words does this by default).

3. Compression of text (Usually decreasing of size is not very big)

4. Using “Core fonts”. “Core fonts” are 14 fonts, which are supported by PDF viewers by default. We can optionally get rid embedding of these fonts into PDF. But, unfortunately, this feature is not supported by Aspsoe.Words at the moment. I will let you know once it is available.

Difference in side of PDF document generated by Aspose.Words and MS Word can be explained by different way of subsetting fonts. For example, if you try to convert a larger document to PDF the size different will be unnoticeable.

As a variant, you can try using TextCompression and JpegQuality options. But you should note if you change JpegQuality you can reduce the quality of images in the document. See the following code:

// Open source document.

Document doc = new Document("in.doc");

// Set PdfSaveOptions

PdfSaveOptions pdfOptions = new PdfSaveOptions();

pdfOptions.TextCompression = PdfTextCompression.Flate;

pdfOptions.JpegQuality = 60;

doc.Save("out.pdf", pdfOptions);

Hope this helps.

Best regards,

Thank you. This did not help to much extent. I am trying some more on this and will comeback with questions.

Meanwhile, one more question.

I am trying to get the character count from a word document and itseems wrong. Actual document attached.

Code snippet:


Document doc = new Document("C:\\test.doc");

// Update the word, character and paragraph count of the document.


// Display the updated document properties.

int cnt= doc.BuiltInDocumentProperties.Characters;

int cnt2= doc.BuiltInDocumentProperties.Words;


I expect the output of cnt to be 4 but it is showing as 74.

Same is the case with No. of words. Supposed to be 1 while it returns 11

Am I doing anything wrong?


Hi there,

Thanks for your inquiry.

I cannot reproduce the issue using the latest version of Aspose.Words. You can download it from here.

On my side the counts were as expected - Words:1 and Characters:4



I am still getting the issue. If I do not use doc.UpdateWordCount(); then I am getting correct character count but not word count

I am attaching the document here, please test and let me know what I am doing wrong.


Thanks you for additional information. If you do not call UpdateWordCount you will get the same result as MS Word shows. Please see the attached screenshot.


Best regards,


I am not sure where you are gettign the word count as 0. but I have tested both in Office 2003 and 2010 from File ->Properties Menu (2003), File->Info(2010), I see word count as 1. Screen shot attached.

One more question is that how do we get the right character and word count in Aspose. Do we have to use UpdatewordCount() or not? Please explain.


Hi there,

Thanks this additional information.

The screenshot that Andrey posted shows the word and character count which is stored within the document. This is the same values that Aspose.Words reads when you don't call doc.UpdateWordCount(). For some reason MS Word did not update the proper word count when it was last saved which lead to these incorrect values to be stored in the document.

However if try to look at the word count from inside Microsoft Word it will update these values before displaying them which is why you see the correct values in your screenshot.

From my tests, Aspose.Words updates the correct word count after calling doc.UpdateWordCount. Are you having any troubles with that on your side?


The issues you have found earlier (filed as WORDSNET-2716) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.