Hello, I’m encountering a performance issue when rendering a PDF using the Aspose.PDF library.
When the document contains Chinese Simplified (zh-CN) or Chinese Traditional (zh-TW) text, I set:
pdfDocument.OptimizeResources(new OptimizationOptions()
{
SubsetFonts = true
});
On my local machine, calling:
pdfDocument.Save(_request.ResultFile);
takes only about 3 seconds.
However, when I deploy the same code to Docker (Linux-based container) or our test environment, the Save()
call takes about 6 minutes under the same conditions.
Some notes:
- The issue happens only when
SubsetFonts = true
and the document contains Chinese text. - English documents, or Chinese documents with
SubsetFonts = false
, save quickly. - The Docker container already includes required fonts (
fonts-noto-cjk
,fontconfig
, etc.). - Local environment: Windows, .NET 6, Aspose.PDF latest version.
- Docker: Debian-based image, .NET 6, Aspose.PDF same version.
Question:
I would like to keep SubsetFonts = true
(to reduce PDF size) but still have the same fast performance as my local environment.
- Is there any known cause for such a big performance difference in Linux/Docker?
- Are there recommended font settings, caching, or configuration to speed up
SubsetFonts
processing for Chinese text in Docker? - Could this be related to font file access speed, font fallback resolution, or encoding handling in Linux?
Any advice or best practices to avoid this delay would be greatly appreciated.
Thank you,