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 Aug 31, 2016 2:57 pm

I want to Draw an string on PDF , But the font "Museo Sans" doesn't seem to be available. And it types in "Arial" instead?
Is there a way out ? Actually the digit "3" of Museo Sans look very different then Arial's "3"

Actually i want to draw an string in a font this doesnt seem to be available.( Museo Sans ). Is there any other font available that is more similar to Museo Sans.

page.Canvas.DrawString("12345", New PdfTrueTypeFont(New Font("Museo Sans", 16, true)), New PdfSolidBrush(Color.Black), 10, 10, format)

kimmloius
 
Posts: 6
Joined: Fri Sep 18, 2015 11:08 am

Thu Sep 01, 2016 3:51 am

Dear kimmloius,

Thanks for your inquiry.
I have noticed this issue and posted it to our Dev team. We will inform you once there is any progress.
Sorry for inconvenience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Thu Sep 01, 2016 6:14 am

Dear kimmloius,

After investigation, please try to use the method PdfTrueTypeFont(string fontFile, float size) to achieve your target.
Code: Select all
page.Canvas.DrawString("12345", new PdfTrueTypeFont("MuseoSans_700.otf", 12f), new PdfSolidBrush(Color.Black), 10, 50);


Sincerely,
Betsy
E-iceblue support team
User avatar

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

Fri Sep 02, 2016 8:55 pm

I dont think it worked. Can you check yourself. Please look at the difference when you type "3" in arial and in Museo .

kimmloius
 
Posts: 6
Joined: Fri Sep 18, 2015 11:08 am

Mon Sep 05, 2016 3:37 am

Dear kimmloius,

Sorry for late reply as weekend.
I used the latest Spire.PDF Pack(Hot Fix) Version:3.7.198, but sorry that didn't find that issue.
Here is my testing code.
Code: Select all
            PdfDocument doc = new PdfDocument();
            PdfPageBase page = doc.Pages.Add();
            page.Canvas.DrawString("333", new PdfTrueTypeFont(new Font("Arial", 16)), new PdfSolidBrush(Color.Black), 10, 10);
            page.Canvas.DrawString("333", new PdfTrueTypeFont(@"F:\testing\pdf form testing\original document\MuseoSans-100.otf", 12f), new PdfSolidBrush(Color.Black), 10, 50);
            doc.SaveToFile("8457.pdf");

Also, I have attached screenshot and the files for your reference.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Wed Sep 07, 2016 8:20 am

Dear kimmloius,

Did you see my information ? How it the issue now ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF