PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

Latin support in MigraDoc?, it is, but not for certain char
http://forum.pdfsharp.de/viewtopic.php?f=2&t=1327
Page 1 of 1

Author:  frenk [ Wed Sep 08, 2010 6:58 am ]
Post subject:  Latin support in MigraDoc?, it is, but not for certain char

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.

Author:  () => true [ Wed Sep 08, 2010 8:19 pm ]
Post subject:  Re: Latin support in MigraDoc?, it is, but not for certain char

I hope you enabled Unicode in MigraDoc.

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

Author:  frenk [ Thu Sep 09, 2010 8:19 am ]
Post subject:  Re: Latin support in MigraDoc?, it is, but not for certain char

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/