Welcome Guest Search | Active Topics | Sign In | Register

EO.Pdf Charset Options
David Pires
Posted: Tuesday, January 25, 2011 10:57:53 AM
Rank: Member
Groups: Member

Joined: 1/6/2011
Posts: 10
Hello once again,

I have been using the EO.Pdf and being grateful for the hours saved in programming, but i have encountered a small problem in witch i hope it can be solved.

When printing, the final result (the pdf file) it does not allow Portuguese characters, it leaves a blank space in the spot where it should write the character.

Is there any way to use the following characters ( á à ã â - é è ê - í ì î - ó ò õ ô - ú ù û - ç ) and also in uppercase?

Thanks in advance.
eo_support
Posted: Tuesday, January 25, 2011 11:04:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

We are not aware of such problems. Do those characters display correctly when viewing with Acrobat Reader? Can you provide a small peice of test code to demonstrate the problem?

Thanks!
David Pires
Posted: Tuesday, January 25, 2011 12:21:33 PM
Rank: Member
Groups: Member

Joined: 1/6/2011
Posts: 10
I have just tested in a test application the simplest i could do.

A simple windows form application with:

1 Button: Called Button1

1 TextBox: Called TextBox1

No formats or properties were set to the form controls.

And inserted the following code:

Code: Visual Basic.NET
Imports EO.Pdf.Acm
Imports EO.Pdf

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'Create a new PdfDocument
        Dim doc As PdfDocument = New PdfDocument()

        'Create a new AcmRender object
        Dim render As AcmRender = New AcmRender(doc)
        render.SetDefPageSize(New System.Drawing.SizeF(12.0F, 9.5F))

        Dim Linha1 As AcmParagraph = New AcmParagraph(New AcmText(TextBox1.Text))
        Linha1.Style.FontSize = 20.0F
        Linha1.Style.ForegroundColor = Color.DarkBlue
        Linha1.Style.HorizontalAlign = AcmHorizontalAlign.Center

        Dim Linha2 As AcmParagraph = _
                            New AcmParagraph(New AcmText("á à ã â - é è ê - í ì î - ó ò õ ô - ú ù û - ç"))
        Linha2.Style.FontSize = 20.0F
        Linha2.Style.ForegroundColor = Color.DarkRed
        Linha2.Style.HorizontalAlign = AcmHorizontalAlign.Center

        render.Render(Linha1, Linha2)

        My.Computer.FileSystem.CreateDirectory("C:\Test_Aplication\")
        Dim file_name_and_path As String = "C:\Test_Aplication\Listagem_TEST.pdf"

        'Save the PDF file
        doc.Save(file_name_and_path)
    End Sub
End Class


I inserted in the TextBox1 Control the same input for the variable 'Linha2'.

The .pdf file was created successfully and the result presented in the Acrobat Reader (version 9.3.2) is:

a a a a - e e e - . . . - o o o o - . . . - c
a a a a - e e e - . . . - o o o o - . . . - c

--- The '.' (dots) are there only for replacing the missing/not visible chars---


While i was posting this message i realize that when i copy the text and pasted it after (here) the result was:

á à ã â - é è ê - í ì î - ó ò õ ô - ú ù û - ç
á à ã â - é è ê - í ì î - ó ò õ ô - ú ù û - ç


Sooooo... I have a problem.

The characters created in the pdf are correct but the visualization isn't , maybe its the font used that does not support the characters.

Also tried to open the pdf with PhotoShop and the result was the same that with the Acrobat.

eo_support
Posted: Tuesday, January 25, 2011 12:28:45 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

Yes. The font must be the problem. The default font used by EO.Pdf is "Arial", which probably does not have those characters. Windows usually substitute those characters when displaying it, but Acrobat Reader does not.

In order to correctly display those characters, please try to explicitly set the correct font name on your Style object. We do not know which font to use because we do not know which font has those characters.

Thanks!
David Pires
Posted: Thursday, January 27, 2011 12:21:39 PM
Rank: Member
Groups: Member

Joined: 1/6/2011
Posts: 10
Sorry for the delay.

I have tried several fonts witch are applied but they still don't show the characters right, the font types support the characters, I've checked, and i use them regularly also with Acrobat.

Once again, the characters are correct and even some of the Fonts used can display some of the characters, but none of the fonts can display them all the strange part is that i use the same acrobat daily for other purposes and all of the fonts i tried have worked and the characters are displayed correctly.

I have also tried to use ASCII char codes and directly from the textbox... same result.

Wat can i do?

The code used is the following:

Code: Visual Basic.NET
Imports EO.Pdf.Acm
Imports EO.Pdf

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'Create a new PdfDocument
        Dim doc As PdfDocument = New PdfDocument()

        'Create a new AcmRender object
        Dim render As AcmRender = New AcmRender(doc)
        render.SetDefPageSize(New System.Drawing.SizeF(12.0F, 9.5F))

        Dim str As String = Chr(231) & Chr(227) & Chr(218)

        Dim Linha0 As AcmText = New AcmText("TESTE CHARS (" & str & " ||| " & Hex("0x00E7") & ")")
       
        Dim Linha1 As AcmParagraph = New AcmParagraph(New AcmText("Arial (á à ã â - é è ê - í ì î - ó ò õ ô - ú ù û - ç)"))
        Linha1.Style.FontSize = 20.0F
        Linha1.Style.FontName = "Arial"
        Linha1.Style.ForegroundColor = Color.DarkRed
        Linha1.Style.HorizontalAlign = AcmHorizontalAlign.Center

        Dim Linha2 As AcmParagraph = New AcmParagraph(New AcmText("Times New Roman (á à ã â - é è ê - í ì î - ó ò õ ô - ú ù û - ç)"))
        Linha2.Style.FontSize = 20.0F
        Linha2.Style.FontName = "Times New Roman"
        Linha2.Style.ForegroundColor = Color.DarkRed
        Linha2.Style.HorizontalAlign = AcmHorizontalAlign.Center

        Dim Linha3 As AcmParagraph = New AcmParagraph(New AcmText("Verdana (á à ã â - é è ê - í ì î - ó ò õ ô - ú ù û - ç)"))
        Linha3.Style.FontSize = 20.0F
        Linha3.Style.FontName = "Verdana"
        Linha3.Style.ForegroundColor = Color.DarkRed
        Linha3.Style.HorizontalAlign = AcmHorizontalAlign.Center

        Dim Linha4 As AcmParagraph = New AcmParagraph(New AcmText("Courier New (á à ã â - é è ê - í ì î - ó ò õ ô - ú ù û - ç)"))
        Linha4.Style.FontSize = 20.0F
        Linha4.Style.FontName = "Courier New"
        Linha4.Style.ForegroundColor = Color.DarkRed
        Linha4.Style.HorizontalAlign = AcmHorizontalAlign.Center

        Dim Linha5 As AcmParagraph = New AcmParagraph(New AcmText("Microsoft Sans Serif (á à ã â - é è ê - í ì î - ó ò õ ô - ú ù û - ç)"))
        Linha5.Style.FontSize = 20.0F
        Linha5.Style.FontName = "Microsoft Sans Serif"
        Linha5.Style.ForegroundColor = Color.DarkRed
        Linha5.Style.HorizontalAlign = AcmHorizontalAlign.Center

        Dim Linha6 As AcmParagraph = New AcmParagraph(New AcmText("FROM TEXTBOX: (" & TextBox1.Text & ")"))
        Linha6.Style.FontSize = 20.0F
        Linha6.Style.FontName = "Microsoft Sans Serif"
        Linha6.Style.ForegroundColor = Color.DarkRed
        Linha6.Style.HorizontalAlign = AcmHorizontalAlign.Center

        '0xE7	0x00E7	#LATIN SMALL LETTER C WITH CEDILLA

        render.Render(Linha0, Linha1, Linha2, Linha3, Linha4, Linha5, Linha6)

        My.Computer.FileSystem.CreateDirectory("C:\Test_Aplication\")
        Dim file_name_and_path As String = "C:\Test_Aplication\Listagem_TEST.pdf"

        'Save the PDF file
        doc.Save(file_name_and_path)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim newViewer As New F_pdf
        newViewer.file_to_load("C:\Test_Aplication\Listagem_TEST.pdf")
        newViewer.Show()
    End Sub

End Class



The output of the code (PDF):


David Pires
Posted: Thursday, January 27, 2011 12:58:51 PM
Rank: Member
Groups: Member

Joined: 1/6/2011
Posts: 10
I created a word (.doc) document and pasted the supposed chars as they were pasted inside VB.

So, with same input in bd. after creating the file i have another output, after converting it online to pdf, i opened the pdf file and all is OK.

So there should be no problem in the acrobat readed.

Link to image:



Uploaded with ImageShack.us
eo_support
Posted: Thursday, January 27, 2011 2:16:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

Can you email us the following information in a zip file?

1. A simple piece of test code that uses our library to generates the PDF file with "problem" characters. This can be the same code you posted above;
2. The result PDF file generated by step 1. This is the PDF file with problem;
3. A simple PDF file that you created through other means that also contain the same "problem" characters but displays fine. This is the PDF file without problem;

We will PM you as to where to send these files. Once we have those files, we will look into the file and see what we can find.

Thanks!
eo_support
Posted: Friday, January 28, 2011 2:49:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

We have looked into your test files and confirmed it is a bug in our library. We will fix it and provide you an update build as soon as possible (hopefully early next week). Thank you very much for your help and patience.

Thanks!
eo_support
Posted: Sunday, January 30, 2011 5:11:23 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

We have posted a new build that should fix this problem. Please see your private message for the download location.

Thanks!
Irene Spanou
Posted: Monday, January 31, 2011 8:58:00 AM
Rank: Newbie
Groups: Member

Joined: 1/31/2011
Posts: 3
Hello,

I encountered the same problem with Greek characters.

If my generated PDF's contents are in English, then everything works fine. But when I try to generate a PDF file with Greek text, each character is either printed as a blank space (which is the case for most characters) or as a number.

Is there support for Greek characters?

Thanks in advance.
eo_support
Posted: Monday, January 31, 2011 9:04:21 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

EO.Pdf should support any character as long as you have the font installed on your system. We have recently fixed an issue with character set. Please see your private message for the download location of the new build and let us know whether it works for you.

Thanks!
David Pires
Posted: Monday, January 31, 2011 2:31:15 PM
Rank: Member
Groups: Member

Joined: 1/6/2011
Posts: 10

Hello,

I only now had the time to try the new build you sent me, just installed and made a quick test, so far everything is fixed correctly and all the characters are displayed correctly in the generated PDF.

Thanks once again for all the support and for the quickness for the solution.


Rating the online Support:

Solving thread: 5/5
-------- Time to Reply: 5/5
-------- Solutions offered: 5/5
-------- Remote support: 5/5


eo_support
Posted: Monday, January 31, 2011 2:44:51 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Cool. Thanks for confirming that it works for you!
Irene Spanou
Posted: Tuesday, February 1, 2011 7:40:21 AM
Rank: Newbie
Groups: Member

Joined: 1/31/2011
Posts: 3
Hello again,

I also tried the new build, but unfortunately, the results didn't change for me. Here is a small example of what I'm trying to do:

Code: C#
PdfDocument doc = new PdfDocument();
        AcmRender render = new AcmRender(doc);

        AcmText text = new AcmText("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ");
        render.Render(text);

        text = new AcmText("ΆΈΉΊΪΌΎΫΏ");
        render.Render(text);

        text = new AcmText("αβγδεζηθικλμνξοπρστυφχψως");
        render.Render(text);

        text = new AcmText("άέήίϊΐόύϋΰώ");
        render.Render(text);

        doc.Save(outputFileName);


The above is simply a test, in order to create a pdf file that contains all the characters of the greek alphabet.

The result I should be getting can be found here:
Desired result, created with Microsoft Word and printed as PDF
Corresponding screenshot

Instead, what I get is this:
PDF generated by the above code
Corresponding screenshot

I haven't set any font in my code, so I'm guessing that it defaults to Arial. The desired result is also created using Arial, so I don't think the problem has to do with the fonts.

Is there something else I can try?
eo_support
Posted: Tuesday, February 1, 2011 7:59:37 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

Thanks for the testing code. We are looking into this issue and will let you know as soon as we find anything.

Thanks!
eo_support
Posted: Tuesday, February 1, 2011 10:20:07 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

We have posted a new build that should fix the greek character problem. Please see your private message for the download location.

Thanks!
Irene Spanou
Posted: Wednesday, February 2, 2011 7:59:39 AM
Rank: Newbie
Groups: Member

Joined: 1/31/2011
Posts: 3
Thank you very much for your quick response, I've tested the new build with Greek characters and so far it works like a charm!

Thanks again!
eo_support
Posted: Wednesday, February 2, 2011 8:17:27 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
You are very welcome. Thank you very much for confirming the fix!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.