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.

Wed Mar 04, 2015 5:41 pm

Hi,
I use LoadFromHTML to create PDF from an HTML file.

In this page the font is set by css :

@font-face {
font-family: 'ubuntu';
src: url('../fonts/UbuntuCondensed-Regular-webfont.eot');
src: url('../fonts/UbuntuCondensed-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/UbuntuCondensed-Regular-webfont.woff2') format('woff2'),
url('../fonts/UbuntuCondensed-Regular-webfont.woff') format('woff'),
url('../fonts/UbuntuCondensed-Regular-webfont.ttf') format('truetype'),
url('../fonts/UbuntuCondensed-Regular-webfont.svg#ubuntu_condensedregular') format('svg');
font-weight: normal;
font-style: normal;

}


But when i create the PDF the font is arial and I can't install the font on the server.

Any suggest?
Simone

simonesolution
 
Posts: 2
Joined: Sat Feb 21, 2015 11:22 am

Thu Mar 05, 2015 7:32 am

Hello,

Thanks for your inquiry.
To help us reproduce this issue, please upload your HTML document to the forum, or you can send it to support@e-iceblue.com.

Best Regards,
Betsy
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Thu Mar 05, 2015 12:56 pm

Hi, I found that the font is correct on my local server.
The problem is only on external server when I can't install the font on system.

Simone

simonesolution
 
Posts: 2
Joined: Sat Feb 21, 2015 11:22 am

Fri Mar 06, 2015 4:40 am

Hello,

If you want to embed the fonts correctly into the pdf document, the fonts have to be installed in the system, otherwise the font will be displayed with other default font.
Please feel free to contact us if you have any questions or needs.

Best Regards,
Betsy
E-iceblue Support Team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Thu Mar 19, 2015 10:16 am

Hello,

Thanks for sharing your information.
I have failed to reproduce your issue, the font is correctly showed in my document.
Here are my codes:
Code: Select all
PdfDocument doc = new PdfDocument();
String url = "http://luntest.solutionsoftware.it/pdf/visualizzapdf/2;1;1";
Thread thread = new Thread(() =>
{
doc.LoadFromHTML(url, false, true, true);
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
doc.SaveToFile("result.pdf");
doc.Close();


If the codes you used are not same with me, please send your codes to me.

Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.PDF