PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Displaying complex scripts and indic text

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
ramses2



Joined: 08 Oct 2008
Posts: 1

PostPosted: Wed Oct 08, 2008 12:37 pm    Post subject: Displaying complex scripts and indic text Reply with quote

Hi All,

I am using pdfsharp to display some indic characters, the issue is that indic character set depends on the context of the unicode letters, so when i render the unicode text string, it gives me the character by character representation of the text i am trying to put in, instead of a glyph based represenation.


I am using an unicode opentype indic font and was also able to embed the font inside the pdf, but the final output is not correct, the characters are not shaping properly according to the rules of indic character display, instead they are just a bunch of indic character rendered on the PDF.

I also tried using TextRenderer class from .net, but even that's not helping. i also tried to get the graphics context by using the graphics property of the XGraphics object, even that fails.


this is a sample code that i have written





PdfDocument document = new PdfSharp.Pdf.PdfDocument();
PdfPage page = document.AddPage();
XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);

XGraphics gfx = XGraphics.FromPdfPage(page);
Graphics g = gfx.Graphics;

gfx.MUH = PdfFontEncoding.Unicode;
gfx.MFEH = PdfFontEmbedding.Always;

XFont ft = new XFont("Chandas", 16, XFontStyle.Regular, options);
gfx.DrawString(str1, ft, XBrushes.Red, 10, 20, XStringFormat.Default);

// These two lines are not working
g.DrawString(str1, f, Brushes.Red, 10, 10);
TextRenderer.DrawText(g, "hehe", f, Point(10, 140), Color.Red);


document.Save(fileName);
document.Close();


can anyone help me on how to write complex scripts using PDFsharp.


Thanks
Ram
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com