Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
AddTrueTypeFont not working as expected |
Post Reply |
Author | |
donna
Beginner Joined: 22 Oct 17 Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 23 Oct 17 at 1:49AM |
Hi, Please refer to below code. I passed m_titleFont as parameter to ConvertFontType method. When the server is executing line AddTrueFontType, the code is like hanging at there. No exception was caught though. Please advise. :) public void ConvertFontType(Font font) { try { string subfix = ""; if (font.Bold && font.Italic) { subfix = " [BoldItalic]"; } else if (font.Bold) { subfix = " [Bold]"; } else if (font.Italic) { subfix = " [Italic]"; } bool found = false; string requestFontName = font.FontFamily.Name; int fontCount = m_qPdf.FontCount(); requestFontName = font.FontFamily.Name + subfix; for (int i = 0; i < fontCount; i++) { var selectFont = m_qPdf.SelectFont(i); if (selectFont == 0) { // show error return; } if (m_qPdf.FontName() == requestFontName) { found = true; break; } } if (!found) { int fontID = m_qPdf.AddTrueTypeFont(requestFontName, 0); //<< hanging here var selectFont = m_qPdf.SelectFont(fontID); if (selectFont == 0) { // show error return; } } int _increment = 2; var setTextSize = m_qPdf.SetTextSize(font.Size + _increment); if (setTextSize == 0) { // show error return; } } catch(Exception ex) { // show error } } |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Donna,
did you read all about AddTrueTypeFont here? http://www.debenu.com/docs/pdf_library_reference/AddTrueTypeFont.php If i understand your code there's the relevant font missing - so you want to add it. I would assume that the font name in requestFontName is a bit different to the fontnamefile in the font-path of your system. You should check the content of "requestFontName" and then you should have a look into your system if there's a fontfile with the same name. |
|
Cheers,
Ingo |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store