2012-01-03 50 views
0

我想在PDF頁面上插入文本。我厭倦了這樣的如何將希伯來文本插入pdf?

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

//繪製

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

PDF頁面上的文本,但PDF頁面上它看起來像什麼,而不是什麼,我試圖插入別的。任何人都可以告訴我,如果特定文本包含任何希伯來語文本,插入文本的正確方法是什麼。

感謝,

loganathan

+0

你用unicode試過了嗎?另外,看看我的答案[這裏](http://stackoverflow.com/questions/8700292/iphone-emoji-decimal-value-representation/8700398#8700398)其中unicode文本已被設置爲UILabel。 – Ilanchezhian 2012-01-03 11:28:57

回答

0

嘗試使用NSString附加

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

這對我的作品。

+0

感謝它很好:-) – 2012-01-06 07:44:17

+0

我很高興我可以幫助你:) – 2012-01-06 09:03:37