【问题标题】:How to insert Hebrew text into pdf?如何将希伯来语文本插入pdf?
【发布时间】:2012-01-03 20:09:36
【问题描述】:

我想在 PDF 页面上插入文本。我厌倦了这个

 NSString *str = @"יככעימבבגיננימ";  //hebrew characters
 const char *cstr = [str UTF8String];

//在pdf页面上绘制文字

 CGContextShowTextAtPoint(PDFPagecontext, 100, 100), cstr,strlen(cstr));

但在 Pdf 页面上,它看起来像别的东西,而不是我试图插入的东西。如果特定文本包含任何希伯来文本,谁能告诉我插入文本的正确方法是什么。

谢谢,

龙舌兰

【问题讨论】:

  • 你试过unicode吗?另外,请查看我的答案here,其中 unicode 文本已设置为 UILabel。

标签: iphone ios


【解决方案1】:

尝试使用 NSString Additions

CGContextSetTextDrawingMode (ctx, kCGTextFill);  //ctx is CGContextRef
UIGraphicsPushContext(ctx);
[str drawAtPoint:CGPointMake(100,100) withFont:[UIFont fontWithName:@"Times New Roman" size:10]]
UIGraphicsPopContext();

它对我有用。

【讨论】:

    猜你喜欢
    • 2021-12-29
    • 2013-12-16
    • 1970-01-01
    • 2011-09-02
    • 1970-01-01
    • 2012-12-11
    • 2013-12-17
    • 1970-01-01
    • 2011-11-29
    相关资源
    最近更新 更多