Re: [iText-questions] How can I set the correct leading!

2008-03-22 Thread Eric Summkeller
Ok! First thanks for your answer. The problem is, that I asked the wrong 
question. The question that I would ask was, what can I do, that the paragraph 
with the big font size will not overlap the paragraph with the small font 
size. The best thing for me would be if the small paragraph is directly 
written under the big paragraph without any overlaps. Any ideas what I could 
do? 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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] Does exist a concept like a container?

2008-03-22 Thread Paulo Soares
You can set a clipping path before adding the image that will define what 
will be visible. This clipping path can be a rectangle or any other shape or 
combination of shapes.

Paulo

- Original Message - 
From: "Daniele Dellafiore" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, March 22, 2008 6:29 PM
Subject: [iText-questions] Does exist a concept like a container?


> Hi all.
>
> I need to produce a pdf starting from a xml definition. The format of
> this xml gives me two information about the positioning of an image.
> They give me the coordinates and dimension of a box
>
> 
> 100
> 100
> 20
> 20
> 
>
> and then the relative coordinate and the scale of the image. Here the
> coordinates are relative to the box ones.
>
> 
> 0
> 0
> 1.9
> 1.9
> 
>
> So I am suppose to put a imaginary box at given position and
> dimension, then scale the image (typically it becomes bigger) and then
> put the image in the box.
> Usually the image is bigger and has benn told to me to cut the
> portions of the image that goes outside the box margins.
>
> Now, as far as I can see in iText there is no concept of a "Box",
> like, say, a Container in Swing or such. I simply put the image
> directly on the document. Is this right? So if I want to crop the
> image, I have to make it before adding it to the document.
>
> Is this right? Or iText /pdf provides some magical stuff to make the other 
> way?
>
> Thanks.
>
> -- 
> Daniele Dellafiore
> http://blog.ildella.net/


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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] Using Layers To Construct a PDF Foreground/Background Dynamically

2008-03-22 Thread Pat Waldo
Hello

 

I have used iText but have a question on which I would very much appreciate
some help.   I would like to create in iText a foreground PDF that is set of
images (some with hyperlinks), for example, a trail map.  I would like to
include in the document a hyperlink to the actual background terrain map PDF
document itself, which would be retrieved by clicking on the hyperlink in
the foreground PDF.  My objective is to pass the foreground PDF with the
trail map to the client browser session allowing the client to dynamically
superimpose the background map into the document so that the foreground
trail map overlays the background map on the client side.  

 

Ideally I would like to have this occur seamlessly in the client browser
session without the user needing to click anything with some embedded code
in the PDF but my first question is how to create the foreground layer that
can pull in the background layer in a client browser session.

 

Any suggestions very much appreciated?

 

Thank you very much

 

Pat

 

 

 

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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] Problem in PdfGraphics2D

2008-03-22 Thread Paulo Soares

- Original Message - 
From: "Bruno Lowagie" <[EMAIL PROTECTED]>
To: "Post all your questions about iText here" 

Sent: Saturday, March 22, 2008 3:52 PM
Subject: Re: [iText-questions] Problem in PdfGraphics2D


> Christoph Wagner wrote:
>> 476 if(underline)
>> 477 {
>> 478 // These two are supposed to be taken from the .AFM 
>> file
>> 479 //int UnderlinePosition = -100;
>> 480 int UnderlineThickness = 50;
>> 481 //
>> 482 double d = asPoints((double)UnderlineThickness,
>> (int)fontSize);
>> 483 setStroke(new BasicStroke((float)d));
>> 484 y = (float)((double)(y) +
>> asPoints((double)(UnderlineThickness), (int)fontSize));
>> 485 Line2D line = new Line2D.Double((double)x, (double)y,
>> (double)(width+x), (double)y);
>> 486 draw(line);
>> 487 }
>>
>> The problem is the setting of the stroke in line 483 without preserving 
>> the
>> current stroke. The fix should be to set the original stroke back after 
>> the
>> draw in line 486 ( make a call to setStroke(oldStroke); in line 487).
>>
>> Let me know what you think.
>
> At first sight, this looks like a good bugfix.
> The change is in SVN; if Paulo (who is more familiar
> with the PdfGraphics2D part) agrees, it will be in the
> next release.

oldStroke is already transformed, it's the saved originalStroke that must be 
used. I commited the a new change but it would be better if Christoph Wagner 
said something about the fix in the SVN working (or not) for him.

Paulo


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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] Using Layers To Construct a PDF Foreground/Background Dynamically

2008-03-22 Thread 1T3XT info
Pat Waldo wrote:
> I have used iText but have a question on which I would very much 
> appreciate some help.   I would like to create in iText a foreground PDF 
> that is set of images (some with hyperlinks), for example, a trail map. 
>  I would like to include in the document a hyperlink to the actual 
> background terrain map PDF document itself, which would be retrieved by 
> clicking on the hyperlink in the foreground PDF.  My objective is to 
> pass the foreground PDF with the trail map to the client browser session 
> allowing the client to dynamically superimpose the background map into 
> the document so that the foreground trail map overlays the background 
> map on the client side.  
> 
>  
> 
> Ideally I would like to have this occur seamlessly in the client browser 
> session without the user needing to click anything with some embedded 
> code in the PDF but my first question is how to create the foreground 
> layer that can pull in the background layer in a client browser session.
> 
>  
> 
> Any suggestions very much appreciated?

Use OCG. There's an example of such a map in chapter 12
of the book "iText in Action". First the map looks like
a raster image, when the user zooms in, he says a vector
image. There's a "Layers pane" on the left he can use to
enable/disable layers. This pane could easily be replaced
by links (as described elsewhere in the book).
-- 
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/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] Using Layers To Construct a PDF Foreground/Background Dynamically

2008-03-22 Thread Pat Waldo
I have used iText but have a question on which I would very much appreciate
some help.   I would like to create in iText a foreground PDF that is set of
images (some with hyperlinks), for example, a trail map.  I would like to
include in the document a hyperlink to the actual background terrain map PDF
document itself, which would be retrieved by clicking on the hyperlink in
the foreground PDF.  My objective is to pass the foreground PDF with the
trail map to the client browser session allowing the client to dynamically
superimpose the background map into the document so that the foreground
trail map overlays the background map on the client side.  

 

Ideally I would like to have this occur seamlessly in the client browser
session without the user needing to click anything with some embedded code
in the PDF but my first question is how to create the foreground layer that
can pull in the background layer in a client browser session.

 

Any suggestions very much appreciated?

 

Thank you very much

 

Pat

 

 

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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] Can I insert a TextField in PdfTable?

2008-03-22 Thread 1T3XT info
Kristof Taveirne wrote:
> I've tried to insert code like it is mentioned in the book in chapter 15:
> TextField tf1 =
> new TextField(writer, new Rectangle(40, 720, 360, 750), "fox");
> tf1.setBackgroundColor(Color.YELLOW);
> tf1.setBorderColor(Color.RED);
> tf1.setBorderWidth(2);
> tf1.setBorderStyle(PdfBorderDictionary.STYLE_BEVELED);
> tf1.setText("Quick brown fox jumps over the lazy dog");
> tf1.setAlignment(Element.ALIGN_CENTER);
> tf1.setOptions(TextField.REQUIRED);
> writer.addAnnotation(tf1.getTextField());
> 
> But this doesn't work at all, I don't find a trace ot this text field
> in the resulting PDF.

What do you mean by "this doesn't work at all"?
Have you looked at the area you defined with the
coordinates (40, 720), (360, 750)? I mean: you say
you want the TextField to be added at some position,
then you arbitrarily chose some coordinates.

What do you mean by "I don't find a trace of this
text field in the resulting PDF"? Have you opened
the PDF in a text editor and found out there is no
AcroForm? Have you looked at the PDF in an analyzing
tool such as RUPS and seen there is no form present?

Personally, I'd add the TextField in a cell event.
The cell event passes the writer and the necessary
coordinates. You refer to the book: do the examples
that come with the book work for you?
-- 
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/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] Problem in PdfGraphics2D

2008-03-22 Thread Bruno Lowagie
Christoph Wagner wrote:
> 476 if(underline)
> 477 {
> 478 // These two are supposed to be taken from the .AFM file
> 479 //int UnderlinePosition = -100;
> 480 int UnderlineThickness = 50;
> 481 //
> 482 double d = asPoints((double)UnderlineThickness,
> (int)fontSize);
> 483 setStroke(new BasicStroke((float)d));
> 484 y = (float)((double)(y) +
> asPoints((double)(UnderlineThickness), (int)fontSize));
> 485 Line2D line = new Line2D.Double((double)x, (double)y,
> (double)(width+x), (double)y);
> 486 draw(line);
> 487 }
> 
> The problem is the setting of the stroke in line 483 without preserving the
> current stroke. The fix should be to set the original stroke back after the
> draw in line 486 ( make a call to setStroke(oldStroke); in line 487).
> 
> Let me know what you think.

At first sight, this looks like a good bugfix.
The change is in SVN; if Paulo (who is more familiar
with the PdfGraphics2D part) agrees, it will be in the
next release.
br,
Bruno

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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 1.4 questions

2008-03-22 Thread Bruno Lowagie
Paulo Soares wrote:
> iText 2.0 was extensively reviewed. Many things were removed/changed and all 
> your questions were addressed.

Actually iText 1.5.4 is the version that is officially approved
for use in IBM products by their lawyers in Canada. Anticipating
questions about later versions, I now keep strict logs about all
changes and license stuff.

They won't get any help for reviewing older versions, but
if IBM's lawyers in the US want to spend an equal amount of
money for the same job, they'd better invest it in further
development of 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/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] help me with ITEXT

2008-03-22 Thread 1T3XT info
thien su wrote:
> i want to make a appication with JAVA use ITEXT library change HTML
> to PDF
> i use Jcreator to write ,but when  i build ,have to error "package
> com.lowagie.text does not exit"
> how i  must download this library and insert it  ?
> and i need document about change HTML to PDF
> help me !!!

This is not an iText related question. This is a simple JAVA
question. If you don't know how to add a jar to the CLASSPATH,
you should first learn more about Java.
-- 
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/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] Problem in PdfGraphics2D

2008-03-22 Thread Christoph Wagner
Hi,

I am using the PdfGraphics2D to print a rather complex UI to a PDF using
iText. I got a problem where rectangles changed their thickness
intermittently. After hours of debugging I found the reason for the change:
Before that I printed a underline string using this code:

AttributedString as = new AttributedString (textToPrint);
as.addAttribute (TextAttribute.FONT, font);
if (isUnderlined)
{
as.addAttribute (TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
}
pdfGraphics.drawString (as.getIterator (), left, (float) top);

This lead me to debugging the PdfGraphics2D class where I found the
following codeblock:

476 if(underline)
477 {
478 // These two are supposed to be taken from the .AFM file
479 //int UnderlinePosition = -100;
480 int UnderlineThickness = 50;
481 //
482 double d = asPoints((double)UnderlineThickness,
(int)fontSize);
483 setStroke(new BasicStroke((float)d));
484 y = (float)((double)(y) +
asPoints((double)(UnderlineThickness), (int)fontSize));
485 Line2D line = new Line2D.Double((double)x, (double)y,
(double)(width+x), (double)y);
486 draw(line);
487 }

The problem is the setting of the stroke in line 483 without preserving the
current stroke. The fix should be to set the original stroke back after the
draw in line 486 ( make a call to setStroke(oldStroke); in line 487).

Let me know what you think.


Christoph Wagner


PS. And many thanks for the work on this great piece of open source software



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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] help me with ITEXT

2008-03-22 Thread thien su
2008/3/22, huutai [EMAIL PROTECTED]:


>  i want to make a appication with JAVA use ITEXT library change HTML to
> PDF
> i use Jcreator to write ,but when  i build ,have to error "package
> com.lowagie.text does not exit"
> how i  must download this library and insert it  ?
> and i need document about change HTML to PDF
> help me !!!
>



-- 
huu tai
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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/