Problem with showtext method

View: New views
9 Messages — Rating Filter:   Alert me  

Problem with showtext method

by LauraCoB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I want to do a pdf with lines containing opened accents and cedillas using the PdfContentByte method showText. I  call this method with a String with words with these kinds of accents and the result isn't the expected one: in the output pdf file these accents are interrogations.

Anyone can help me with this problem? Can I use another method for this task or I am not using showText correctly ?

Thank you very much and sorry for my English
Laura

Re: Problem with showtext method

by Paulo Soares :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You may need another font or compilation switches or something else. Your
post is too vague.

Paulo

----- Original Message -----
From: "LauraCoB" <lauracoba@...>
To: <itext-questions@...>
Sent: Tuesday, May 13, 2008 5:50 PM
Subject: [iText-questions] Problem with showtext method


>
> Hello,
>
> I want to do a pdf with lines containing opened accents and cedillas using
> the PdfContentByte method showText. I  call this method with a String with
> words with these kinds of accents and the result isn't the expected one:
> in
> the output pdf file these accents are interrogations.
>
> Anyone can help me with this problem? Can I use another method for this
> task
> or I am not using showText correctly ?
>
> Thank you very much and sorry for my English
> Laura


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Re: Problem with showtext method

by 1T3XT info :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paulo Soares wrote:
> You may need another font or compilation switches or something else. Your
> post is too vague.

I think that if the font doesn't have the characters, nothing is shown.
My guess would be that the bytes are 'shaven'.
Either you have the Strings hard coded in your JAVA code and then
compiled that code using the wrong encoding; or you are getting the
Strings from an outside resource (file, database,...) and you're reading
them using the wrong encoding.
--
This answer is provided by 1T3XT BVBA

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Re: Problem with showtext method

by LauraCoB :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I tried using the method setLiteral ("q\n BT\n 36 806 Td\n0 -18 Td\n/F1 12 Tf\n(Hellú Wôrld)Tj\n0 0 Td\nET\nQ\n") and it the result
was wrong also... the first u doesnt appear and the word World is illegible...



2008/5/14 1T3XT info <info@...>:
Paulo Soares wrote:
> You may need another font or compilation switches or something else. Your
> post is too vague.

I think that if the font doesn't have the characters, nothing is shown.
My guess would be that the bytes are 'shaven'.
Either you have the Strings hard coded in your JAVA code and then
compiled that code using the wrong encoding; or you are getting the
Strings from an outside resource (file, database,...) and you're reading
them using the wrong encoding.
--
This answer is provided by 1T3XT BVBA

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Re: Problem with showtext method

by 1T3XT info :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Laura CB wrote:
> I tried using the method setLiteral ("q\n BT\n 36 806 Td\n0 -18 Td\n/F1
> 12 Tf\n(Hellú Wôrld)Tj\n0 0 Td\nET\nQ\n") and it the result
> was wrong also... the first u doesnt appear and the word World is
> illegible...

You are using setLiteral and you wrote some literal PDF syntax,
therefore one must assume that you are a PDF specialist; otherwise
you wouldn't be able to write the above PDF syntax.

As you are a PDF specialist, you surely understand that the following
counter question is very obvious, and that the answer to this counter
question is mandatory to solve the problem.

In your PDF syntax you are referring to a font by the name /F1.
In the resources dictionary that is defined in the dictionary
that comes with the stream containing the above PDF syntax, there
is an entry /F1 in the fonts entry of the resources dictionary.

Please tell us what's inside the corresponding font dictionary.
Is the font embedded? If not, look no further, you need to embed
the font to make sure those characters are shown correctly.

If the font is embedded: are the characters present in the font
program? If not, that's why they aren't shown. You should use a
font that knows how to draw the characters instead of a font that
doesn't.

If the font is embedded and there's a glyph description that
corresponds with the character, then the font should be displayed
as defined in the font program.
--
This answer is provided by 1T3XT BVBA

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Re: Problem with showtext method

by Paulo Soares :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't want to hear what Bruno is going to say about this... (Ohhh, my eyes
hurt)

Paulo

----- Original Message -----
From: "Laura CB" <lauracoba@...>
To: "Post all your questions about iText here"
<itext-questions@...>
Sent: Sunday, May 25, 2008 4:00 PM
Subject: Re: [iText-questions] Problem with showtext method


I tried using the method setLiteral ("q\n BT\n 36 806 Td\n0 -18 Td\n/F1 12
Tf\n(Hellú Wôrld)Tj\n0 0 Td\nET\nQ\n") and it the result
was wrong also... the first u doesnt appear and the word World is
illegible...



2008/5/14 1T3XT info <info@...>:

> Paulo Soares wrote:
> > You may need another font or compilation switches or something else.
> > Your
> > post is too vague.
>
> I think that if the font doesn't have the characters, nothing is shown.
> My guess would be that the bytes are 'shaven'.
> Either you have the Strings hard coded in your JAVA code and then
> compiled that code using the wrong encoding; or you are getting the
> Strings from an outside resource (file, database,...) and you're reading
> them using the wrong encoding.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Re: Problem with showtext method

by Bruno Lowagie (iText) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paulo Soares wrote:
> I don't want to hear what Bruno is going to say about this... (Ohhh, my eyes
> hurt)

About the "hurting eyes" and other rudenesses: I had a bad Friday.

There were a lot of dates in my agenda I had filled in before Inigo's
diagnosis: a party because Inigo is in his last year of primary school,
the school's annual feast for which Inigo used to design decorations,
his week long school trip,... I had to strike all this fun stuff from
my calendar and replace them with "next week: Inigo's knee operation".

It's no excuse, I know, but still: I couldn't hide the pain I felt
as a father. It seems like such a long time ago since we know Inigo
has Cancer, but after his knee surgery, we're only at 1/3 of the
chemo treatment, meaning six more difficult months (and after that
still no certainty that the Cancer will be gone).

As for Laura's question, even with "ú" and "ô" in the Java source code,
Laura has to make sure she compiles the source code using the right
encoding. But how can I make this clear now that some people say that
I don't have the right impersonate Basil Fawlty or René from the café?

The only schizophrenic trait I'm allowed to have is to be the "friendly"
Bruno or the "rude" 1T3XT. (Or was it the other way round?)
;-)

br,
Bruno

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Re: Problem with showtext method

by wasegraves :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-------------- Original message ----------------------
From: Bruno Lowagie <bruno@...>
>
> Paulo Soares wrote:
> > I don't want to hear what Bruno is going to say about this... (Ohhh, my eyes
> > hurt)
>
> About the "hurting eyes" and other rudenesses: I had a bad Friday.
<snip>

Nettie and I will have Inigo in our prayers for a successful outcome of the surgery. You are indeed an esteemed and respected friend, even though some of the list participants don't show it in their behavior.

> The only schizophrenic trait I'm allowed to have is to be the "friendly"
> Bruno or the "rude" 1T3XT. (Or was it the other way round?)
> ;-)

Bruno and 1T3XT are very consistent in their behaviors, when their responses are triggered by certain undesirable acts on the part of some participants on the discussion list. IMO, before posting, participants should lurk a while, so they can learn the triggers they should avoid.

Operating in "Blurt mode", asking questions that have already been answered many times before, and asking questions the answers of which can easily be found by seaching the book, tutorials, examples, documentation, and list archives, are easily-discernable triggers.

A Google search for "posting guidelines comp.lang.perl.misc" will show a new participant a sample of guidelines that should be followed -- substitute "iText" for "Perl".

Best regards,
Bill Segraves

P.S. Congratulations, Bruno, on the outstanding 1st-year success of _iText in Action_. It would be the number one reference on my technical bookshelf, except it stays instead on the top of a stack of reference books, close at hand, next to my computer. I wonder how many people are ready for a 2nd copy, e.g., one to replace the one that's nearly worn out. :-)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Re: Problem with showtext method

by Bruno Lowagie (iText) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

wasegraves@... wrote:
> P.S. Congratulations, Bruno, on the outstanding 1st-year success of _iText in Action_.

Thanks! I'm very happy with the reactions and the sales.

> I wonder how many people are ready for a 2nd copy, e.g., one to replace the one
> that's nearly worn out. :-)

I've already 'broken the back' of two copies myself.
And what's more: I've added plenty of remarks and little papers
with ideas. I don't think I'll write a 'revision' because I'm
not that happy with the 'University of Foobar' examples anymore.
I'd like to bring a new 'story,' so I've written a set of
'filmfestival' and 'newspaper' examples explaining how to make
PDFs from a database (no XML this time).

You can already find some examples here:
http://www.1t3xt.info/examples/classroom.php

For instance:
http://www.1t3xt.info/examples/results/classroom/filmfestival/movies11.pdf
http://www.1t3xt.info/examples/results/classroom/filmfestival/movies14.pdf
http://www.1t3xt.info/examples/results/classroom/filmfestival/movies17.pdf
http://www.1t3xt.info/examples/results/classroom/filmfestival/movies20.pdf
http://www.1t3xt.info/examples/results/classroom/filmfestival/movies24.pdf
http://www.1t3xt.info/examples/results/classroom/filmfestival/movies25.pdf

I'll present the movies24 and movies25 examples on an OpenOffice event
on my birthday (June 10) in Brussels. The idea is that you can make your
form with OpenOffice and fill it using iText.

br,
Bruno

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@...
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar