[iText-questions] Error in Chapter object!

2007-07-20 Thread Eric Summkeller
First I create two Phrase objects with different Fonts. The first created 
Phrase has a bold Font and the second not. After that I add those both Phrase 
objects into a Paragraph. I create the Paragraph object with the first Font 
because I would like to create a Chapter out of this Paragraph and the number 
should have the same style like the first added Phrase object. The problem is 
that the second added Phrase object is now bold too although the Font of this 
Phrase isn't bold. Is this an error or do I something wrong in my 
implementation?

My code:

Font[] fonts = new Font[2];
fonts[0] = new Font(Font.TIMES_ROMAN, Font.DEFAULTSIZE, Font.BOLD);
fonts[1] = new Font(Font.TIMES_ROMAN, Font.DEFAULTSIZE, Font.NORMAL);

Paragraph par = new Paragraph(, fonts[0]);

Chunk chunk1 = new Chunk(Test_Bold, fonts[0]);
Phrase phrase1 = new Phrase();
phrase1.add(chunk1);

Chunk chunk2 = new Chunk(Test_Normal, fonts[1]);
Phrase phrase2 = new Phrase();
phrase1.add(chunk2);

par.add(phrase1);
par.add(phrase2);

Chapter chapter = new Chapter(par, 1);

document.add(chapter); 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Error in Chapter object!

2007-07-20 Thread mister bean

If you look at this code of yours with fresh eyes, I think you'll discover a
problem:

...

Phrase phrase2 = new Phrase();
phrase1.add(chunk2);

par.add(phrase1);
par.add(phrase2);

...

Phrase2 is empty. Try adding chunk2 to phrase2 and see if the problem goes
away.

Best wishes,

---Mister Bean

 re 

Eric Summkeller wrote:
 
 First I create two Phrase objects with different Fonts. The first created 
 Phrase has a bold Font and the second not. After that I add those both
 Phrase 
 objects into a Paragraph. I create the Paragraph object with the first
 Font 
 because I would like to create a Chapter out of this Paragraph and the
 number 
 should have the same style like the first added Phrase object. The problem
 is 
 that the second added Phrase object is now bold too although the Font of
 this 
 Phrase isn't bold. Is this an error or do I something wrong in my 
 implementation?
 
 My code:
 
 Font[] fonts = new Font[2];
 fonts[0] = new Font(Font.TIMES_ROMAN, Font.DEFAULTSIZE, Font.BOLD);
 fonts[1] = new Font(Font.TIMES_ROMAN, Font.DEFAULTSIZE, Font.NORMAL);
 
 Paragraph par = new Paragraph(, fonts[0]);
 
 Chunk chunk1 = new Chunk(Test_Bold, fonts[0]);
 Phrase phrase1 = new Phrase();
 phrase1.add(chunk1);
 
 Chunk chunk2 = new Chunk(Test_Normal, fonts[1]);
 Phrase phrase2 = new Phrase();
 phrase1.add(chunk2);
 
 par.add(phrase1);
 par.add(phrase2);
 
 Chapter chapter = new Chapter(par, 1);
 
 document.add(chapter); 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Error-in-Chapter-object%21-tf4115250.html#a11702749
Sent from the iText - General mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


[iText-questions] Multi-Line Text Alignment

2007-07-20 Thread Dennis Racine

Ok, this seems to be a wide spread problem, I'd I'd love to find a solution.
It seems that if you have a multi-line text field in your PDF and 
populate + flatten it the text ends up moving UP about 4-6 pixels from 
it's original position. In my case my customer has drawn horizontal 
lines in their multi-line fields so their dumb customers understand they 
have multiple lines for their information. Which in this case makes the 
problem really obvious.
I've tried not only iText, but also pdfTK, CFMX8 and activePDF. the only 
one that does the multi-line correct is activePDF. Which would be ok, 
except they can't seem to do ANYTHING else right.
So I'd like to use iText, everything works great except for the 
multi-line. Is there a way to adjust this to make it correct?


Any help would be great, I'm tired of dealing with activePDF and all 
their Sandford  Son Fixes for things that iText just does correct to 
begin with :)


I setup a test URL with the 4 methods here: 
http://ho.racine-web.com/pdf_test.cfm


--
--
Racine-Web Design
Dennis Racine

Tel. 530-470-8751
Fax (408) 904-4816

website: http://www.racine-web.com
[EMAIL PROTECTED]


Instant Messangers:
Yahoo: dennis_racine
MSN: [EMAIL PROTECTED] (IM Only)
AIM: DRacine33E
ICQ: 967354


--

begin:vcard
fn:Dennis Racine
n:Racine;Dennis
org:Racine-Web Design
adr:;;15293 Beeman Lane;Grass Valley;CA;95949;USA
email;internet:[EMAIL PROTECTED]
tel;work:530-470-8751
tel;fax:408-904-4816
tel;cell:530-575-9268
x-mozilla-html:TRUE
url:http://www.racine-web.com
version:2.1
end:vcard

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Multi-Line Text Alignment

2007-07-20 Thread Paulo Soares
http://itext.ugent.be/library/question.php?id=54

Paulo

- Original Message - 
From: Dennis Racine [EMAIL PROTECTED]
To: itext-questions@lists.sourceforge.net
Sent: Thursday, July 19, 2007 11:21 PM
Subject: [iText-questions] Multi-Line Text Alignment


 Ok, this seems to be a wide spread problem, I'd I'd love to find a 
 solution.
 It seems that if you have a multi-line text field in your PDF and
 populate + flatten it the text ends up moving UP about 4-6 pixels from
 it's original position. In my case my customer has drawn horizontal
 lines in their multi-line fields so their dumb customers understand they
 have multiple lines for their information. Which in this case makes the
 problem really obvious.
 I've tried not only iText, but also pdfTK, CFMX8 and activePDF. the only
 one that does the multi-line correct is activePDF. Which would be ok,
 except they can't seem to do ANYTHING else right.
 So I'd like to use iText, everything works great except for the
 multi-line. Is there a way to adjust this to make it correct?

 Any help would be great, I'm tired of dealing with activePDF and all
 their Sandford  Son Fixes for things that iText just does correct to
 begin with :)

 I setup a test URL with the 4 methods here:
 http://ho.racine-web.com/pdf_test.cfm

 -- 
 --
 Racine-Web Design
 Dennis Racine

 Tel. 530-470-8751
 Fax (408) 904-4816

 website: http://www.racine-web.com
 [EMAIL PROTECTED]


 Instant Messangers:
 Yahoo: dennis_racine
 MSN: [EMAIL PROTECTED] (IM Only)
 AIM: DRacine33E
 ICQ: 967354


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Error in Chapter object!

2007-07-20 Thread Eric Summkeller
First thanks for your help!
I fixed the bug in my code, but the effect is still the same. The second 
Phrase in the Paragraph is written in bold although it is not formatted in 
bold. Any other ideas what I could do?





-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


[iText-questions] PdfAction

2007-07-20 Thread Francesco Persico
i am tring to add an PdfAction o DOCUMENT_CLOSE

this is my snipplet:

public static void main(String[] args) {

System.out.println(Hello World);

// step 1: creation of a document-object
Document document = new Document();
try {
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter pdfWriter =  PdfWriter.getInstance(document,
new FileOutputStream(C:\\HelloWorld.pdf));

// step 3: we open the document
document.open();
// step 4: we add a paragraph to the document
document.add(new Paragraph(Hello World));
PdfAction pdfAction = new PdfAction(http://www.xxxyyyttt.it;);
pdfWriter.setAdditionalAction(PdfWriter.DOCUMENT_CLOSE, 
pdfAction);
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}

// step 5: we close the document
document.close();
}

but it seem not working, whta you think i am doing wrong?
 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Problemi di Liquidità? Con Logos Finanziaria 30.000 € in 24 ore a dipendenti e 
lavoratori autonomi con rimborsi fino a 120 mesi clicca qui
* 
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2907d=20-7

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] iText-questions Digest, Vol 14, Issue 46

2007-07-20 Thread Satyajeet Hattangadi
Hi,

Doesn't anybody know how to do this, or am I asking some obvious question 
that's been asked before.. sorry if that's the case.

I'm trying to find out a way to add some javascript to an existing pdf file 
that will open up an alert as well as open up a url in the users browser when 
the pdf file is closed.

I have managed to add javascript code using the pdfstamper that opens up an 
alert when the file loads. Could someone please send me a code snippet that can 
do the same when the file is closed.


Here is my code using stamper to show a javascript alert when the file is 
opened.

Dim p As New PdfReader(c:\a.pdf)

Dim s As New PdfStamper(p, New FileStream(c:\b.pdf, FileMode.Create))

s.JavaScript = app.alert(Javascript Alert!);
s.Close()


I tried extending the PdfPageEventHelper but the onOpenDocument method
uses the pdfwriter and document as arguments, so if I use the writer then
it assumes that its a new document, where as I need the code added to an 
existing file.

Thanks

[EMAIL PROTECTED] wrote: Send iText-questions mailing list submissions to
 itext-questions@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
 https://lists.sourceforge.net/lists/listinfo/itext-questions
or, via email, send a message with subject or body 'help' to
 [EMAIL PROTECTED]

You can reach the person managing the list at
 [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than Re: Contents of iText-questions digest...


Today's Topics:

   1. Re: Reducing memory for JAI-ImageIO images (Paulo Soares)
   2. Re: Adding monochrome image as gray (Paulo Soares)
   3. IText problem with images ([EMAIL PROTECTED])
   4. Re: IText problem with images (Paulo Soares)
   5. How to add Arabic text to a PDF (dayvidpow)
   6. Re: IText problem with images (geronimo ferreira)
   7. Re: How to add Arabic text to a PDF (Bart Allen)


--

Message: 1
Date: Thu, 19 Jul 2007 14:42:23 +0100
From: Paulo Soares 

Subject: Re: [iText-questions] Reducing memory for JAI-ImageIO images
To: Post all your questions about iText here
 
Message-ID:
 [EMAIL PROTECTED]
Content-Type: text/plain;  charset=utf-8

Save it with JAI as a jpeg and use that jpeg in iText.

Paulo 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Schal?ck, Elmar
 Sent: Thursday, July 19, 2007 2:21 PM
 To: itext-questions@lists.sourceforge.net
 Subject: [iText-questions] Reducing memory for JAI-ImageIO images
 
 Hi,
 it's a bit of off topic :-(
 I load an image (tiff multipage with old jpeg in tiff 
 encoding) via JAI ImageIO.
 The resulting image is larger than the memory within the 
 original tiff.
 So my resulting PDF is about twice the size of the original tiff file.
 Does anyone has any good idea about reducing the size?
 
 Thanks
 Elmar


Aviso Legal:
Esta mensagem ? destinada exclusivamente ao destinat?rio. Pode conter 
informa??o confidencial ou legalmente protegida. A incorrecta transmiss?o desta 
mensagem n?o significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. ? proibido a qualquer pessoa que n?o o destinat?rio de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


--

Message: 2
Date: Thu, 19 Jul 2007 14:46:26 +0100
From: Paulo Soares 

Subject: Re: [iText-questions] Adding monochrome image as gray
To: Post all your questions about iText here
 
Message-ID:
 [EMAIL PROTECTED]
Content-Type: text/plain; charset=us-ascii

This is something that I'll have to fix.

Paulo

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Allen Ziegenfus
 Sent: Tuesday, July 17, 2007 10:51 PM
 To: itext-questions@lists.sourceforge.net
 Subject: [iText-questions] Adding monochrome image as gray
 
 We are looking at moving a bunch printing code from Postscript to PDF.
 We have a large set of monochrome CCITT TIFF images that are used on
 various documents. Some of these images need to be screened to appear
 gray. In Postscript I was able to accomplish this by adding a 
 Decode to
 the image attributes like this:
 
 /Decode [GrayScaleValue 1.0]
 
 Our RIP then sees the gray and does its screening algorithm.  
 
 I see that PDF also supports /Decode and I was able to insert 
 a line of
 code into PdfImage.cs that does the job as follows.
 
 Put(PdfName.DECODE, 

[iText-questions] Manipulation of a Cell's Height

2007-07-20 Thread Lars Nagel (Trium)
Hi all,

Is it possible to set / manipulate the height of a Table's Cell?
I have Cells containing one Phrase each, and some of the Phrases (and 
complete rows) wrap only empty Strings. Now I want to avoid that Cells 
with empty Phrases collapse.

Have you any idea?

Thanks in advance,
Lars

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Multi-Line Text Alignment

2007-07-20 Thread Dennis Racine

awesome, a huge step in the right direction.

i think this is what i need to dynamically apply the setExtraMargin to 
only the multi-line fields.
Now my problem is i'm using coldfusion to do this, and I'm not real sure 
how to convert this to a CFSCRIPT


anyone out there have CF background can help with converting this to 
something I can use?


public static void setField(AcroFields af, String name, String value)
throws Exception {
   AcroFields.Item item = af.getFieldItem(name);
   if (item == null)
   return;
   PdfDictionary merged = (PdfDictionary)item.merged.get(0);
   if (PdfName.TX.equals(merged.get(PdfName.FT))) {
   PdfNumber n = (PdfNumber)merged.get(PdfName.FF);
   if (n != null  (n.intValue()  PdfFormField.FF_MULTILINE) !=
0)
   af.setExtraMargin(0, 6);
   }
   af.setField(name, value);
   af.setExtraMargin(0, 0);
} 





Paulo Soares wrote:

http://itext.ugent.be/library/question.php?id=54

Paulo

- Original Message - 
From: Dennis Racine [EMAIL PROTECTED]

To: itext-questions@lists.sourceforge.net
Sent: Thursday, July 19, 2007 11:21 PM
Subject: [iText-questions] Multi-Line Text Alignment


  
Ok, this seems to be a wide spread problem, I'd I'd love to find a 
solution.

It seems that if you have a multi-line text field in your PDF and
populate + flatten it the text ends up moving UP about 4-6 pixels from
it's original position. In my case my customer has drawn horizontal
lines in their multi-line fields so their dumb customers understand they
have multiple lines for their information. Which in this case makes the
problem really obvious.
I've tried not only iText, but also pdfTK, CFMX8 and activePDF. the only
one that does the multi-line correct is activePDF. Which would be ok,
except they can't seem to do ANYTHING else right.
So I'd like to use iText, everything works great except for the
multi-line. Is there a way to adjust this to make it correct?

Any help would be great, I'm tired of dealing with activePDF and all
their Sandford  Son Fixes for things that iText just does correct to
begin with :)

I setup a test URL with the 4 methods here:
http://ho.racine-web.com/pdf_test.cfm

--
--
Racine-Web Design
Dennis Racine

Tel. 530-470-8751
Fax (408) 904-4816

website: http://www.racine-web.com
[EMAIL PROTECTED]


Instant Messangers:
Yahoo: dennis_racine
MSN: [EMAIL PROTECTED] (IM Only)
AIM: DRacine33E
ICQ: 967354




-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/



--
If this email is spam, report it here:
http://www.OnlyMyEmail.com/reportSpam?Id=MzEyMjU6MzU4MDQ4ODE3OmRlbm5pc0ByYWNpbmUtd2ViLmNvbQ%3D%3D


  


begin:vcard
fn:Dennis Racine
n:Racine;Dennis
org:Racine-Web Design
adr:;;15293 Beeman Lane;Grass Valley;CA;95949;USA
email;internet:[EMAIL PROTECTED]
tel;work:530-470-8751
tel;fax:408-904-4816
tel;cell:530-575-9268
x-mozilla-html:TRUE
url:http://www.racine-web.com
version:2.1
end:vcard

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/