PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu May 23, 2024 11:06 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Nov 19, 2014 1:23 am 
Offline

Joined: Wed Nov 19, 2014 1:09 am
Posts: 6
Hi All,

I have an requirement where I need to show time 9:30 am as 9^30 a. I am able to generate the string as required from c#. But when I pass this value to AddParagraph() method the output is something like
"9^3<junkvalue like square, mue> a". Looks like 1st is displayed correctly but second letter is not.

endTime.AddParagraph("9^30a");

Can any one please help me in resolving this issue.

Thanks
lax


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 19, 2014 9:07 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3098
Location: Cologne, Germany
Hi!

Often the problem is not in the code snippet shown on the forum, but somewhere else.
See also:
viewtopic.php?p=2094#p2094

What is "endTime"?

The line
Code:
section.AddParagraph("9^30a");
works as expected - I get "9^30a" in my PDF.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 19, 2014 6:54 pm 
Offline

Joined: Wed Nov 19, 2014 1:09 am
Posts: 6
Hi Sir,

Thanks for the reply. I have analysed further and found that it's not about second letter. I have changed the font style to Verdana. It's working fine for all the numbers except '0'.

I am using the unicode: \u2070.

Is there any font which works for all the numbers?

And about "endTime" it's just a cell to hold text.
My version is : GDI.1.32.3879.0

Please let me know if I am doing anything wrong.

Thanks
lax


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 20, 2014 8:30 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 341
Hi!
You can use AddFormattedText to use superscript and subscript with all fonts and all characters. No need to mess around with Unicode characters 0x2070 &c.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 23 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