PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 10:34 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Wed Dec 01, 2010 5:17 pm 
Offline

Joined: Wed Dec 01, 2010 5:09 pm
Posts: 2
Hello. I have just discovered PDAsharp and MigraDoc - splendid work. I succesfully created some tests document, but faced a problem using Greek characters in the table of contents (whereas in the main document area, the same characters are displayed with no problem).

Take a look at the attached picture, which displays Adobe reader showing the document created by MigraDoc. As you can see, in the main document area, there are two tables and each has a caption written in proper greek letters. However, the same captions are displayed as junk letters in the bookmark list at the left.

The doc I used to create this document came from the samples and is the following:

Code:
       
        Dim doc As Document = CreateDoc("Στατιστικά βάσης δεδομένων", "Στατιστικά στοιχεία για τη βάση δεδομένων")
        DefineStyles(doc)
        Dim paragraph As Paragraph = doc.LastSection.AddParagraph("Γενικά στοιχεία", "Heading2")
        Dim tbl As Table = CreateTable(2)
        AddRow(tbl, "Διακομιστής βάσης δεδομένων", db.ServerName).Cells(0).Shading.Color = Colors.PaleGoldenrod
        AddRow(tbl, "Βάση δεδομένων", db.ServerDB).Cells(0).Shading.Color = Colors.PaleGoldenrod
        doc.LastSection.Add(tbl)

        doc.LastSection.AddParagraph("Πίνακες", "Heading2")
        tbl = CreateTable(2, "Πίνακας", "Εγγραφές")
        AddRow(tbl, "idioktites", db.GetInteger("select count(*) from idioktites")).Cells(0).Shading.Color = Colors.PaleGreen
        AddRow(tbl, "oikopeda", db.GetInteger("select count(*) from oikopeda")).Cells(0).Shading.Color = Colors.PaleGoldenrod
        AddRow(tbl, "merides", db.GetInteger("select count(*) from merides")).Cells(0).Shading.Color = Colors.PaleGoldenrod
        doc.LastSection.Add(tbl)

        MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToFile(doc, "MigraDoc.mdddl")
        Dim render As New PdfDocumentRenderer(True, PdfSharp.Pdf.PdfFontEmbedding.Always)
        render.Document = doc
        render.RenderDocument()
        Dim filename As String = System.IO.Path.Combine(FileOperations.GetMyDocumentsFolder, "DbStats.pdf")
        render.PdfDocument.Save(filename)
        Process.Start(filename)


So, I guess that the problem lies in the lines:
Dim paragraph As Paragraph = doc.LastSection.AddParagraph("Γενικά στοιχεία", "Heading2")
and
Dim paragraph As Paragraph = doc.LastSection.AddParagraph("Γενικά στοιχεία", "Heading2")

The first parameter of AddParagraph is displayed correctly in the document area, but wrongly in the bookmarks list.

Thanks for reading this.


Attachments:
migra.jpg
migra.jpg [ 33.4 KiB | Viewed 17580 times ]
Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 02, 2010 9:10 am 
Offline
PDFsharp Guru
User avatar

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

You can try the patch posted here:
viewtopic.php?f=2&t=1309

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 02, 2010 2:28 pm 
Offline

Joined: Wed Dec 01, 2010 5:09 pm
Posts: 2
Thanks! This works perfectly.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 12, 2014 1:15 pm 
Offline

Joined: Tue Feb 28, 2012 9:36 pm
Posts: 11
Hi!

patch is working great for German, Russian...languages.

I any possibility to modify it for Slovenian, Croatian, Polish... languages?

With regards, Viljem


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 12, 2014 1:26 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!
viljemt wrote:
patch is working great for German, Russian...languages.
I any possibility to modify it for Slovenian, Croatian, Polish... languages?
How can it be that it works for Russian, but not for Polish?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 12, 2014 1:34 pm 
Offline

Joined: Tue Feb 28, 2012 9:36 pm
Posts: 11
Hi!

if I would only know. In attachment.
Attachment:
Test-RUS-POL.png
Test-RUS-POL.png [ 22.52 KiB | Viewed 15747 times ]


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 12, 2014 1:45 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
It works for me:
Attachment:
forum_14-11-12.png
forum_14-11-12.png [ 28.51 KiB | Viewed 15744 times ]

How urgent is it?
The version supposed to be released later this year seems to work fine.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 12, 2014 1:52 pm 
Offline

Joined: Tue Feb 28, 2012 9:36 pm
Posts: 11
Wow great!

It is urgent. If it is possible...can I beta test it?


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 15, 2014 7:34 am 
Offline

Joined: Sat Aug 28, 2010 6:54 pm
Posts: 4
viljemt wrote:
Hi!
if I would only know. In attachment.


Hi. I corrected this issue. Try to use the files in the attachment.


Attachments:
fixed_files.zip [9.9 KiB]
Downloaded 618 times
Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 17, 2014 2:42 pm 
Offline

Joined: Tue Feb 28, 2012 9:36 pm
Posts: 11
maloi_alex wrote:
Hi. I corrected this issue. Try to use the files in the attachment.


wow, this works great!! Thank you!


p.s.: in Lexer.cs there is double '((' and '))'.
Attachment:
2014-11-17_15-38_PdfSharp modified_files.jpg
2014-11-17_15-38_PdfSharp modified_files.jpg [ 92.23 KiB | Viewed 15691 times ]


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 18, 2014 7:10 am 
Offline

Joined: Sat Aug 28, 2010 6:54 pm
Posts: 4
viljemt wrote:
p.s.: in Lexer.cs there is double '((' and '))'.


You're right. This code is dirty, because was written by me in the "flow of mind" mode.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 18, 2014 9:39 am 
Offline

Joined: Tue Feb 28, 2012 9:36 pm
Posts: 11
Hi!

I does not mater how it looks. Code works, that is important for me.

Thank you again!


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

All times are UTC


Who is online

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