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 Apr 08, 2024 4:25 pm

Hi I am generating a PDF document in Windows and ubuntu Server.
In windows the PDF generate with the correct letter type (windows.png) .
But in Ubuntu the PDF is generated with another letter type (linux.png).

The letter is Century Gothic. I have a folder in the projects where I have this letter.

I am saving the PDF Document in a stream ( pdfDocument.SaveToStream(stream, Spire.Pdf.FileFormat.PDF);)

I also have
<ItemGroup>
<RuntimeHostConfigurationOption Include="System.Drawing.EnableUnixSupport" Value="true" />
</ItemGroup>

How can I get the PDF generated in Ubuntu with the same letter than the PDF generated in Windows

camilapm
 
Posts: 11
Joined: Mon Jan 29, 2024 11:55 am

Tue Apr 09, 2024 8:12 am

Hi,

Thanks for your inquiry.
According to your information, the reason of your issue is the font(Century Gothic) isn’t applied to content. You need to check if the font folder can be accessed by current user and the path of font folder is right.

In addition, you also can put the font(Century Gothic) to system font folder(/usr/share/font/), our product will read the font message from system font folder, and make sure it is accessible to the current user as well.

If these messages don’t help you, please offer a simple project that can reproduce your issue, you could upload your project via Dropbox or OneDrive server, then share us with the download link, and provide the system environment, such as Ubuntu 20.04. Thanks in advance.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Tue Apr 09, 2024 8:37 am

Hi Abel,

I don't need to do anything in the code, how can I set in the code that I want that letter to be used specifically?

camilapm
 
Posts: 11
Joined: Mon Jan 29, 2024 11:55 am

Wed Apr 10, 2024 6:01 am

Hi,

According to the message that the pdf file with correct letter type in windows but not in ubuntu, so I let you check the following inform:

1) If the font (Century Gothic) file can be accessed by current user? You can set “chmod 775” for font file. Since if the font file can’t be accessed by current user, instead of using the specified font, alternative font are used in the generated Pdf file.

2) In addition, you can try the following solution to achieve your effect: Put the font file(Century Gothic) to system font folder(/usr/share/font/), our product will auto read the font message from system font folder, and make sure it is accessible to the current user as well.

Please try the above 2 method and give me the relevant feedback. Thanks in advance.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Wed Apr 10, 2024 6:57 am

Hi Abel, I finally fix the problem saving the word with the embeded content, Thx for your reply

camilapm
 
Posts: 11
Joined: Mon Jan 29, 2024 11:55 am

Wed Apr 10, 2024 7:45 am

Hi,

I'm glad to hear you have fix this issue.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.PDF

cron