Product: PDFTronSDK
Product Version: PDFTron.NetCore.Windows.x64(9.3.0)
Is there any way through i could add Arial Font family of text added through writer ? i have shared my code as well.
myFont = pdftron.PDF.Font.Create(pdfdoc,
pdftron.PDF.Font.StandardType1Font.e_times_bold);
element = eb.CreateTextBegin(myFont, font_sz);
writer.WriteElement(element);
Thanks
system
September 8, 2022, 1:27pm
2
Hello, I’m Ron, an automated tech support bot
While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:
Guides:
Forums:
Hi Haider,
Please try taking a look at the following community post:
Technical Support
Apryse SDK
Question: I want to add text to a PDF page, using ElementBuilder, but when I try to add non-ascii text, unicode, it comes out as garbage characters. Answer: The issue is that the encoding of character codes does not match the Font being used....
Please let me know how this works for you, and if you have any further questions.
After implementation of suggested code. it is printing some weird text.
string ProcedureVersion = "Revision 855(Copy1)(Copy1)(Copy1)(Copy1)(Copy1)(Copy1) (Copy 1)";
myFont = Font.Create(pdfdoc, "Arial", ProcedureVersion);
element = eb.CreateTextBegin(myFont, font_sz);
writer.WriteElement(element);
Text that i gave : Revision 855(Copy1)(Copy1)(Copy1)(Copy1)(Copy1)(Copy1) (Copy 1)
Text that is printing : 剥癩獩潮‸㔵⡃潰礱⤨䍯灹ㄩ⡃潰礱⤨䍯灹ㄩ⡃潰礱⤨䍯灹ㄩ 䍯灹
As well please tell me is there any way to make font bold after implementing this code.
Thanks
Hi Haider,
Can you confirm that you are running elementBuilder.CreateUnicodeTextRun() rather than CreateTextRun()? If not, please change this as it is likely what is causing your issue.
If you are still having problems, please share the entirety of your code.
Thanks,
Kia
Yes, it did work for me after changing it to
eb.CreateUnicodeTextRun($"Page {itr.GetPageNumber()} of {pdfdoc.GetPageCount()}");
Thanks for this.
Can you please guide me how we could make it bold ? text we have stamped ?
Hi Haider,
Please view the following post:
Technical Support
Apryse SDK
PDF files do not have explicit setting for Bold. Instead, you need to actually select a Bold font face. Such as. myFont = Font.Create(pdfdoc, "ArialBold", ProcedureVersion);