Converting XPS to PDF produces unexpectedly large files when the Calibri font is used

When using Aspose.Page for .NET v.24.5.0 to convert XPS documents to PDF, I noticed that the resulting PDF file size is unexpectedly large when the content contains ligatures and uses the Calibri font. To demonstrate, I’ve attached an example program that converts the following XPS files in the application folder to PDF:

  • it - calibri - large.xps - This is an XPS file that fills a page with the repeating text “it” using the Calibri font.
  • it - calibri - small.xps - This is an XPS file that contains a single occurrence of the text “it” using the Calibri font.
  • it - times new roman - large.xps - This is an XPS file that fills a page with the repeating text “it” using the Times New Roman font.
  • it - times new roman - small.xps - This is an XPS file that contains a single occurrence of the text “it” using the Times New Roman font.
  • ti - calibri - large.xps - This is an XPS file that fills a page with the repeating text “ti” using the Calibri font.
  • ti - calibri - small.xps - This is an XPS file that contains a single occurrence of the text “ti” using the Calibri font.
  • ti - times new roman - large.xps - This is an XPS file that fills a page with the repeating text “ti” using the Times New Roman font.
  • ti - times new roman - small.xps - This is an XPS file that contains a single occurrence of the text “ti” using the Times New Roman font.

Running the program will produce the following corresponding PDFs:

  • it - calibri - large.pdf - 28 KB
  • it - calibri - small.pdf - 27 KB
  • it - times new roman - large.pdf - 35 KB
  • it - times new roman - small.pdf - 27 KB
  • ti - calibri - large.pdf - 3934 KB
  • ti - calibri - small.pdf - 29 KB
  • ti - times new roman - large.pdf - 28 KB
  • ti - times new roman - small.pdf - 26 KB

As you can see, when more text is added, the ti - calibri - large.pdf document that contains numerous ligatures is increasing unexpectedly in size. I suspect that the conversion process is embedding a duplicate font for each occurrence of a ligature when using the Calibri font, but I have not confirmed this.

Thank you for any assistance that you can provide.

XpsToPdfTest.zip (1.0 MB)

@sfrepjacob

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PAGENET-670

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Will you update this post with a comment when a fix is made available?

@sfrepjacob

Yes, we will surely provide an update via this forum thread as soon as the issue is resolved.

1 Like