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)