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.

Thu Jun 05, 2014 5:08 am

Hi,

i currently try to generate PDF/1A-b document. it works, but it does not embed Fonts. I did not find an example of embedding Fonts - so i don't know how to do it.

has anybody already done successfully embedding Fonts?

greetings
Dom

dr12
 
Posts: 3
Joined: Thu Jun 05, 2014 5:03 am

Thu Jun 05, 2014 9:33 am

Hello,

Thanks for your feedback.
The following method is for your reference.
Code: Select all
PdfDocument document = new PdfDocument(PdfConformanceLevel.Pdf_A1B);
PdfPageBase page = document.Pages.Add();
String fontFileName = "arial.ttf";
PdfTrueTypeFont trueTypeFont = new PdfTrueTypeFont(fontFileName, 20f);
page.Canvas.DrawString("Hello World", trueTypeFont, new PdfSolidBrush(Color.Black), 10, 10);
document.SaveToFile("result.pdf", FileFormat.PDF);

If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Fri Jun 06, 2014 6:54 am

now it works as whised :-)

but i've another question regarding pdf/a creation - do i need to enable XMP meta data creation?

i found document.XmpMetaData but not how to use it... after that the document shoud pdf/a correct.

dr12
 
Posts: 3
Joined: Thu Jun 05, 2014 5:03 am

Fri Jun 06, 2014 9:15 am

Hello,

Thanks for your response.
Please try the following method.
Code: Select all
XmlDocument xmp=new XmlDocument();
xmp.Load(@"xmp.xml);
document.XmpMetaData.Load(xmp);

If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Wed Jun 11, 2014 9:42 am

Hello,

Has the issue been resolved? Could you please give us some feedback if convenience?

If there are any questions, welcome to get it back to us.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Jun 16, 2014 9:59 am

Hi Gary,

it worked! :-)

thank you for your help!

dr12
 
Posts: 3
Joined: Thu Jun 05, 2014 5:03 am

Tue Jun 17, 2014 6:15 am

Good to know that your issue is resolved now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.PDF