Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Nov 30, 2020 2:34 pm

Hi Team,

I am using Spire.PDF v6.11.6 to convert PDF to PDF/A compliant document. I am able to build and run the code on Windows machine however when i am trying to run the same code on AWS Lambda environment[Linux OS], its failing.

Platform user: .Net Core 3.1

Code:
PdfStandardsConverter converter = new PdfStandardsConverter(tempFileName);
converter.ToPdfA1A(tempFileName1a);


i am getting below error:

Error while converting file:System.TypeInitializationException: The type initializer for 'sprᜬ' threw an exception.
---> System.InvalidOperationException: Cannot found font installed on the system.
at spr☱.ᜀ(String A_0, FontStyle A_1, String A_2)
at sprᜍ..ctor(String A_0, FontStyle A_1)
at sprᜋ..ctor(String A_0, Single A_1, FontStyle A_2)
at sprᜬ..cctor()
--- End of inner exception stack trace ---
at spr᪸.ᜃ()
at spr᪸.ᜂ()
at spr⭠.ᜁ(sprᤜ A_0)
at spr⭠.ᜀ(spr᪻ A_0, sprᤥ A_1, List`1 A_2)
at spr⭠.ᜀ(List`1 A_0, sprᤥ A_1, List`1 A_2)
at spr⭩.ᜀ(List`1 A_0, sprᤥ A_1, List`1 A_2, spr⭉ A_3)
at spr⭊.ᜀ(spr⭉ A_0)
at spr⭊.ᜁ(spr⭉ A_0)
at spr⭊.ᜀ(PdfDocumentBase A_0, String A_1)
at Spire.Pdf.Conversion.PdfStandardsConverter.ToPdfA1A(String filePath)


Can you help me out to fix this issue. I believe Spire.Pdf class is trying to find the Fonts on linux application but its not available so failing. Can i get a solution of this issue?

sumit.pundhir
 
Posts: 9
Joined: Wed Aug 19, 2020 3:02 pm

Tue Dec 01, 2020 7:23 am

Hello,

Thanks for your inquiry!

Kindly note that when the fonts are not embedded in Pdf document, the fonts used in the document must be installed on Linux OS. Because in this case, our Spire.Pdf will read fonts data from Linux OS according to the fonts name in the document during converting, if we cannot find the matching fonts or similar fonts in the Linux OS, the program will produce the issue you mentioned.

From your error message, the fonts in your Pdf should be not embedded in the document, so please install the fonts used in your Pdf on your Linux OS (or you could copy the fonts on your Windows machine to Linux OS) and then try to run the program again. If the issue still exists, please provide us with your input Pdf document for investigation. Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Sun Dec 06, 2020 1:09 pm

Hi,

After installing the program works but there seems one issue as the converted pdf is having few text lines missing.

Not sure why this happening, i am using below code:

PdfStandardsConverter converter = new PdfStandardsConverter(file.ToString());
converter.ToPdfA1A(outputTo1A);
converter.Dispose();
document.LoadFromFile(outputTo1A);
document.FileInfo.Version = PdfVersion.Version1_3;
document.SaveToFile(outputTo1A);
document.Close();


we are running the code in Linux .net core 3.1 environment.

sumit.pundhir
 
Posts: 9
Joined: Wed Aug 19, 2020 3:02 pm

Mon Dec 07, 2020 1:39 am

Hello,

Thanks for your message and sorry for the late reply as weekend.

I have made a test but did not reproduce your issue. To help us reproduce your issue, please provide us with your input file.
Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Wed Dec 09, 2020 10:06 am

Hello,

Hope you are doing well.

How is your issue now? If it still exists, could you please provide your input file to us for further investigation?

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.PDF