PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 5:31 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Oct 08, 2008 12:37 pm 
Offline

Joined: Wed Oct 08, 2008 12:23 pm
Posts: 1
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 372 guests


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 post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group