PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Aug 19, 2024 6:14 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Sep 08, 2010 6:58 am 
Offline

Joined: Wed Sep 08, 2010 6:26 am
Posts: 2
Hello there!
To begin with, I would like to apologize for creating new topic, but I haven't found any article that would be in any way connected to this problem.

I am writing due to my problems in MigraDoc latin character encoding.
When I add paragraph(text) to row, it works fine for most characters, but there are 2 of them that
are specifically causing problems: č, Č . These 2 are automatically converted to c,C (no sign above them).
I tried to write down chars from 1 to 3000(in MigraDoc .AddParagraph() method ) on PDF page I created with PDFsharp, but those 2 are not included in MigraDoc as it seems.
However, those 2 chars work well in PDFsharp, so I am wondering if there is any way to include them in MigraDoc fonts.
Encoding is Unicode in PDFSharp, and char number for these 2 are: 268 and 269.
In c# you would write it like this: (char)268 & (char)269

So now I am wondering, is this some kind of bug? I'd be pleasant if you could point me in the right direction, as I hardly need Those 2 characters in my Tables.

Reason why I want to use MigraDoc drawing system instead of PDFSharp, is that PDFSharp.XGraphics' method "DrawString(,,,,)" makes PDF file bigger for 10KB atleast for each string you Draw.
Therefore if I have atleast one: Č,č char in each of 15 strings, my PDF file size would increase over 100KB's, but this is what i want to omit.

Thanks for your patience and understanding, in hope to hear from you soon.


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 08, 2010 8:19 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 345
I hope you enabled Unicode in MigraDoc.

If you did, we'll check this problem after the holidays.

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


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 09, 2010 8:19 am 
Offline

Joined: Wed Sep 08, 2010 6:26 am
Posts: 2
Hi again.

I have gone deeper into the MigraDoc waters, so I can explain those aspects of my problem even closer:

When you create MigraDoc table, you have to render it, for what you have 2 options:
1st: using DocumentRenderer.RenderObject(,,,,)
and
2nd: using PdfDocumentRenderer.RenderPages(,,,) -> ( yes, I did this:" PdfDocumentRenderer renderer = new PdfDocumentRenderer(true); renderer.Document = MG_document " (while MG_document is MigraDoc document).)

The difference is, that RenderObject(,,,,) is the one it keeps PDF file(in this case table) small(probably due to some "object compression")(and the one I'm currently using). But this Method puts away those 2 chars: Č,č.
Second method works with Č,č but it makes pdf file so much bigger. For example, with RenderObject(,,,,) size of a table is about 3 KB(contains max 70 chars), while with PdfDocumentRenderer.RenderPages is 30 KB atleast.
Lets assume I have to create 4 Tables on same PDFpage, and that PDFfile must not exceed 50 KB. This is what I am streaming for, but not many solutions so far.

I'm still hoping just to make RenderObject to accept Č,č and no other modifications needed.
Looking forward to hear from you


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 127 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