Free Support Forum - aspose.com

Issues in creating PDF and Word with Aspose on Docker Container

We are using Aspose for creating PDF and Word document in the .NET solution. Our .NET core solution is built using Visual studio on the Windows machine. There is no issue in downloading PDF or Word from the local machine. However, if the same is deployed in the linux based container, we are getting styling issues such as incorrect font in both PDF and Word downloads and even some of the images are missing when exported to Word. There is no specific error message while creating PDF or Word. However, the below warning message is found in the container whenever the Word download is attempted.
“maximum size for region is 262144 bytes”.
Tried few options already suggested in the forum such as SentFontFolder and also copying the Font folder to the right path. Also tried setting the ImageType as png as suggested in one of the forum. None of the solutions suggested so far has worked.

Request your support to resolve it at the earliest.

@amigosathish

Can you please confirm if libgdiplus package is installed in the system along with msttcorefonts package? Also, please try using 21.5 version of Aspose.PDF for .NET and let us know in case you still notice the issue by sharing sample code snippet and input/output files. We will test the scenario in our environment and address it accordingly.

I already installed libgdiplus and updated to Aspose 21.5 last week. After your suggestion, I installed msttcrefonts and it seems to have solved the alignment issue in PDF(I checked one section, need to verify across all the other sections used) but the word issue still remains. The images of the charts are not getting generated and the fonts and alignment in Word still looks very untidy. I’m working on preparing the sample solution without any business related information as the data is strictly confidential in this project. I shall share the sample code within next 24 hours. Thanks for your support!

@amigosathish

Sure, please take your time to share sample code snippet and input/output files for our reference. We will test the scenario in our environment and address it accordingly.

@asad.ali

Please find the sample code in Git Repo Git repo for AsposeDockerIssue Project for your reference. Input data comes from the JSON included in the project. Output files are placed in the folder called Response. Dockerfile is also updated and available in the project. After building and running the docker image in your local docker environment, you can download PDF /Word by calling respective APIs.

  1. To download PDF - http://localhost:8080/Test/GetPdf
  2. To download Word - http://localhost:8080/Test/GetWord

Note1: I have removed license file as the application is hosted in the public repository. I hope this is fine.

Note2: Earlier I indicated that the PDF font issue might have been resolved. However, on verifying thoroughly the font issue still persists in PDF as well. On top of that, in word the chart image is not getting displayed. Please reach out to me for any further inputs. Thanks in advance!

@amigosathish

Thanks for sharing the resource files and sample project. We are testing the scenario by setting up the docker environment and will get back to you in a while.

Sure @asad.ali. Shall wait for your response. Thanks!

@amigosathish

An investigation ticket as PDFNET-50092 has been logged in our issue tracking in order to analyze this case. We will look into its details and let you know as soon as the ticket is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.