[iText-questions] Help on (java-pdf)

2002-04-22 Thread manojkumar singh

 Hi,

 Currently i am using ur very good I-TEXT tool for
 my requirment on java-pdf.

 The tool was very nice,but i have some problem.
 I am unable to found answer of my problem in
 I-Text.

 Would u plz help me to solve my technical
 problems.

 The problems are:

 1)Can i append the new text(String) anywhere in
 pdf file,so that resulting pdf will contain the new
 text(String) added with the original content of
 the pdf file?

 2)If you pass the The Page (on which page of pdf
 file), The String (Text to be added) and the
 Location (where the string to be added).
 How to put the Sting in correct PDF Page and
 Location without affecting the original content of  
pdf?
 So that resulting pdf content must be original
 content with newly added string(text) at correct page
and  location.

 Can i do the above tasks with I-Text?
 
I am stuck to do above tasks,the tasks are very
urgent.

Would u plz provide me the solution (Code/Ideas)
of  above problems.
 
 Waiting for ur helpful response.

 Thanks in Advance.

 Manoj S.


__
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] about TJ operator

2002-04-22 Thread KuMi
Hi,

I want to precisely adjust the space between two characters with "TJ"
operator.
Which class and method shoud I use.

Regards, KuMi


___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions


[iText-questions] about TJ operator

2002-04-22 Thread KuMi
Hi,

I want to precisely adjust the space between two characters with "TJ"
operator.
Which class and method should I use ?

Regards, KuMi


___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions


Re: [iText-questions] Help on (java-pdf)

2002-04-22 Thread Bruno Lowagie

Quoting manojkumar singh [EMAIL PROTECTED]:

  1)Can i append the new text(String) anywhere in
  pdf file,so that resulting pdf will contain the new
  text(String) added with the original content of
  the pdf file?

Please read these pages:
http://www.lowagie.com/iText/faq.html#template
http://www.lowagie.com/iText/tutorial/ch01.html#readingPDF

Remark: you can only copy content (text and graphics);
all Annotations, Outlines,... will be lost.

  2)If you pass the The Page (on which page of pdf
  file), The String (Text to be added) and the
  Location (where the string to be added).
  How to put the Sting in correct PDF Page and
  Location without affecting the original content of
 pdf?
  So that resulting pdf content must be original
  content with newly added string(text) at correct page
 and  location.

After adding the imported pages as described in Chapter 1,
add extra text using the PdfContentByte layer:
http://www.lowagie.com/iText/tutorial/ch10.html

___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] about TJ operator

2002-04-22 Thread Bruno Lowagie

Quoting KuMi [EMAIL PROTECTED]:

 Hi,
 
 I want to precisely adjust the space between two characters with TJ
 operator.
 Which class and method should I use ?

You can't do this to change the width between two characters
added with a HighLevelObject such as Phrase, Chunk,...

You can only change this space if you use PdfContentByte
to add text at absolute positions. The method you are looking
for is public void setCharacterSpacing(float charSpace)
in class PdfContentByte.

You learn more about this class in Chapter 10 of the tutorial.

kind regards,
Bruno

___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



RE: [iText-questions] about TJ operator

2002-04-22 Thread Paulo Soares

Use PdfContentByte.showText(PdfTextArray text).

Best Regards,
Paulo Soares

 -Original Message-
 From: Bruno Lowagie [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, April 22, 2002 9:27
 To:   KuMi
 Cc:   [EMAIL PROTECTED]
 Subject:  Re: [iText-questions] about TJ operator
 
 Quoting KuMi [EMAIL PROTECTED]:
 
  Hi,
  
  I want to precisely adjust the space between two characters with TJ
  operator.
  Which class and method should I use ?
 
 You can't do this to change the width between two characters
 added with a HighLevelObject such as Phrase, Chunk,...
 
 You can only change this space if you use PdfContentByte
 to add text at absolute positions. The method you are looking
 for is public void setCharacterSpacing(float charSpace)
 in class PdfContentByte.
 
 You learn more about this class in Chapter 10 of the tutorial.
 
 kind regards,
 Bruno
 
 ___
 iText-questions mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/itext-questions

___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



RE: [iText-questions] about TJ operator

2002-04-22 Thread Paulo Soares

You are right but it doesn't have to be this way. I attach a new
PdfContentByte and PdfTextArray.

Best Regards,
Paulo Soares

 tj.zip 

 -Original Message-
 From: Kumata Mitsugu [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, April 22, 2002 10:41
 To:   Paulo Soares
 Subject:  Re: [iText-questions] about TJ operator
 
 Thank you for your quick response to my question.
 And I am very sorry for mistakenly sending the same mail 3 times.
 
 I am trying to use PdfContentByte.showText(PdfTextArray text) as your
 advise.
 Now, I have another question.
 PdfTextArray needs PdfString which is package private.
 How do I get PdfString object ?
 
 thank you in advance,
 KuMi
 
 
  Use PdfContentByte.showText(PdfTextArray text).
  
  Best Regards,
  Paulo Soares
  
  -Original Message-
  From:Bruno Lowagie [SMTP:[EMAIL PROTECTED]]
  Sent:Monday, April 22, 2002 9:27
  To:KuMi
  Cc:[EMAIL PROTECTED]
  Subject:Re: [iText-questions] about TJ operator
  
  Quoting KuMi [EMAIL PROTECTED]:
  
  Hi,
  
  I want to precisely adjust the space between two characters with TJ
  operator.
  Which class and method should I use ?
  
  You can't do this to change the width between two characters
  added with a HighLevelObject such as Phrase, Chunk,...
  
  You can only change this space if you use PdfContentByte
  to add text at absolute positions. The method you are looking
  for is public void setCharacterSpacing(float charSpace)
  in class PdfContentByte.
  
  You learn more about this class in Chapter 10 of the tutorial.
  
  kind regards,
  Bruno
  
  ___
  iText-questions mailing list
  [EMAIL PROTECTED]
  https://lists.sourceforge.net/lists/listinfo/itext-questions
  



tj.zip
Description: Binary data


[iText-questions] Varying Table Size

2002-04-22 Thread Haseen ul Haq

Letters I am creating has logo, today's date and  two addresses as two 
adjacent cells of a table.  Contents come from database so the width of 
table is not fixed.  The problem is when we have 3 rows in table cell in 
comparison to 5, table as well as date which is over the table shifts up as 
a result of which our letters have different position of date and addresses. 
  Since I am using absolute position for logo, it is stationery and is not 
moving up and down. The addresses go in envelope window and it is shifting 
everything.

Can you please suggest some solution.  Right now I am using version 0.70.

Thanks.

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] RE: Rectangleelement in a PdfPCell

2002-04-22 Thread Paulo Soares

Create a template with the checkbox drawing, create an image with this
template and insert this image in the cell.

Best Regards,
Paulo Soares

 -Original Message-
 From: Thomas Kübler [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, April 22, 2002 14:23
 To:   Paulo Soares
 Subject:  Re: Rectangleelement in a PdfPCell
 
 Yes, the only one. This will be a checkbox for a formular.
 
 
 thanks.
 - Original Message -
 From: Paulo Soares [EMAIL PROTECTED]
 To: 'Thomas Kübler' [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Monday, April 22, 2002 1:57 PM
 Subject: RE: Rectangleelement in a PdfPCell
 
 
  Yes. Is the rectangle the only element in the cell?
 
  Best Regards,
  Paulo Soares
 
   -Original Message-
   From: Thomas Kübler [SMTP:[EMAIL PROTECTED]]
   Sent: Monday, April 22, 2002 13:05
   To: [EMAIL PROTECTED]
   Subject: Rectangleelement in a PdfPCell
  
   hallo,
  
   i want to put a Rectangle-Element in a PdfPCell. Is there any way to
 do
   this?
  
  
   thanks thomas

___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] diffrent PDF formats on Windows and Unix?

2002-04-22 Thread BRITT . WOROFSKY


Hi all,

I experienced a problem when generating PDF files with iText 0.81
(and also 0.91):
if I create a file with my program running with java VM 1.3 under HPUX, 
I can read this file with acroread 3.0 under HPUX, 
but not with acroread 5.0 under Win2000. Acroread gives an error message
... Problems occured while reading the document (114)
If I create the same file with the same java program code executed by
java VM 1.3.1_02 under Win2000 it is vice versa: I can read it
with acroread5.0 under Win2000 but not with acroread3.0 under HPUX.

Has anybody experienced this problem, too? 
Does anybody has an idea of a solution?

Please help me, I urgently need a solution!!!



Best regards

Britt



Britt Worofsky

Consultant
Lufthansa Systems AS GmbH
Aspelohe 27c
22848 Norderstedt
www.lhsystemsas.de

 

___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] leading in pdfpcell

2002-04-22 Thread Thomas Kübler




hallo,

i have an another question. how do i set the 
leading of a phrase in 
a pdfpcell. when i set 

PdfPCell zelle = new PdfPCell( new 
Phrase("testlauf"));
zelle.setLeading(durch,1f);

where durch = fontsize * 1.5;

i get not very good results with this parameter, i 
tried zelle.setLeading(durch,0f), this
works for some text good, but when the fontsize 
will be bigger, the lines will be together.


thanks 
thomas.


[iText-questions] PdfGraphics2D: unbalanced save/Restore Exception

2002-04-22 Thread Erwin Achermann

Hi iTexters, 

during the last week I was doing exactly a PdfGraphics class as you seem to have done. 
I was only implementing the features which we currently are using. Especially I was 
cheating with the FontMetrics. Now I realized this morning that you have done a more 
complete implementation in the PdfGraphics2D, reason enough for me to abandom my 
implementation and switch to the far more complete one of iText. But the problem I'm 
observing is show in the following code: 

/**
 * codecreatePdf/code prints a set of pages into the PDF
 * file.
 */
public void createPdf() {
// make an instance of a PdfGraphics Object for the document
DefaultFontMapper fm = new DefaultFontMapper();
java.awt.Graphics2D g = null;

// don't do anything if pageable is null
if (pageable != null) {
// read all fonts recognized be iText in system font path

fm.insertDirectory(sun.awt.font.NativeFontWrapper.getFontPath(true));
   
   
System.out.println(PdfJob.createPdf:  started);
int pages = pageable.getNumberOfPages();
System.out.println(PdfJob.createPdf:  pages to print: 
+pages+\n);

// set pageSize of first page before the document opens!!
float width = 
(float)pageable.getPageFormat(0).getPaper().getWidth();
float height = 
(float)pageable.getPageFormat(0).getPaper().getHeight();
theDocument.setPageSize(new Rectangle(width, height));

// g.setPageSize(pageable.getPageFormat(0));
  theDocument.open();
g = pdfWriter.getDirectContent().createGraphics(width, height, 
fm);

for (int  p = 0;  p  pages ; ++p) {
Printable thePage = pageable.getPrintable(p);
try {
// print! 
thePage.print(g, pageable.getPageFormat(p), p);
System.out.println(PdfJob.createPdf:  page  
+ p +  printed);
if (p  pages-1) {
// next page, please! on its proper 
PageSize 
width = 
(float)pageable.getPageFormat(p+1).getPaper().getWidth();
height = 
(float)pageable.getPageFormat(p+1).getPaper().getHeight();
theDocument.setPageSize(new 
Rectangle(width, height));
} // end of if (p  pages-1)
theDocument.newPage();


// iText-Error!? 
// g.dispose(); // use of dispose leads to a
// unbalanced save/restore exception not 
using
// g.dispose() is producing erroneous PDF:
// Acrobat Reader complains about unmatched
// save/restore commands if the document 
consist
// of Portrait and Landscape format. Acrobat 
Reader
// show one empty additional page if the 
document
// is only one page format

/
g = 
pdfWriter.getDirectContent().createGraphics(width, height, fm);
} catch ( PrinterException e) {
e.printStackTrace();
}
catch(DocumentException de) {
de.printStackTrace();
}
} // end of for (int p = 0; p  pages; p++)
// write the document and clear all references
end();  // = theDocument.close()
} // end of if (pageable) 
} // end createPdf


___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] diffrent PDF formats on Windows and Unix?

2002-04-22 Thread Paul Cooley

We are generating pdfs on solaris and having them
opened via a browser on windows and are experiencing
no problems between the two.  I think perhaps you
should check to make sure the pdfs are getting written
as text when tranferred.  Are you ftping the files
from one system to another?
--- [EMAIL PROTECTED] wrote:
 
 Hi all,
 
 I experienced a problem when generating PDF files
 with iText 0.81
 (and also 0.91):
 if I create a file with my program running with java
 VM 1.3 under HPUX, 
 I can read this file with acroread 3.0 under HPUX, 
 but not with acroread 5.0 under Win2000. Acroread
 gives an error message
 ... Problems occured while reading the document
 (114)
 If I create the same file with the same java program
 code executed by
 java VM 1.3.1_02 under Win2000 it is vice versa: I
 can read it
 with acroread5.0 under Win2000 but not with
 acroread3.0 under HPUX.
 
 Has anybody experienced this problem, too? 
 Does anybody has an idea of a solution?
 
 Please help me, I urgently need a solution!!!
 
 
 
 Best regards
 
 Britt
 
 
 
 Britt Worofsky
 
 Consultant
 Lufthansa Systems AS GmbH
 Aspelohe 27c
 22848 Norderstedt
 www.lhsystemsas.de
 
  
 
 ___
 iText-questions mailing list
 [EMAIL PROTECTED]

https://lists.sourceforge.net/lists/listinfo/itext-questions


__
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] diffrent PDF formats on Windows and Unix?

2002-04-22 Thread Paul Cooley

Sorry.  Meant to say you should make sure they are NOT
getting written to text during transfer!
--- Paul Cooley [EMAIL PROTECTED] wrote:
 We are generating pdfs on solaris and having them
 opened via a browser on windows and are experiencing
 no problems between the two.  I think perhaps you
 should check to make sure the pdfs are getting
 written
 as text when tranferred.  Are you ftping the files
 from one system to another?
 --- [EMAIL PROTECTED] wrote:
  
  Hi all,
  
  I experienced a problem when generating PDF files
  with iText 0.81
  (and also 0.91):
  if I create a file with my program running with
 java
  VM 1.3 under HPUX, 
  I can read this file with acroread 3.0 under HPUX,
 
  but not with acroread 5.0 under Win2000. Acroread
  gives an error message
  ... Problems occured while reading the document
  (114)
  If I create the same file with the same java
 program
  code executed by
  java VM 1.3.1_02 under Win2000 it is vice versa: I
  can read it
  with acroread5.0 under Win2000 but not with
  acroread3.0 under HPUX.
  
  Has anybody experienced this problem, too? 
  Does anybody has an idea of a solution?
  
  Please help me, I urgently need a solution!!!
  
  
  
  Best regards
  
  Britt
  
  
  
  Britt Worofsky
  
  Consultant
  Lufthansa Systems AS GmbH
  Aspelohe 27c
  22848 Norderstedt
  www.lhsystemsas.de
  
   
  
  ___
  iText-questions mailing list
  [EMAIL PROTECTED]
 

https://lists.sourceforge.net/lists/listinfo/itext-questions
 
 
 __
 Do You Yahoo!?
 Yahoo! Games - play chess, backgammon, pool and more
 http://games.yahoo.com/
 
 ___
 iText-questions mailing list
 [EMAIL PROTECTED]

https://lists.sourceforge.net/lists/listinfo/itext-questions


__
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] PdfGraphics2D: unbalanced save/Restore Exception

2002-04-22 Thread jim moore

On first glance it looks like your PdfGraphics2D creates and disposes are
mismatched. You create one before the for loop. If there are more pages, you
dispose it and create a new one. This new one never gets disposed though. I
think this code below should fix it:

/**
 * codecreatePdf/code prints a set of pages into the PDF
 * file.
 */
public void createPdf() {
// make an instance of a PdfGraphics Object for the document
DefaultFontMapper fm = new DefaultFontMapper();
java.awt.Graphics2D g = null;

// don't do anything if pageable is null
if (pageable != null) {
// read all fonts recognized be iText in system font path
fm.insertDirectory(sun.awt.font.NativeFontWrapper.getFontPath(true));

System.out.println(PdfJob.createPdf:  started);
int pages = pageable.getNumberOfPages();
System.out.println(PdfJob.createPdf:  pages to print: +pages+\n);

// set pageSize of first page before the document opens!!
float width = (float)pageable.getPageFormat(0).getPaper().getWidth();
float height = (float)pageable.getPageFormat(0).getPaper().getHeight();
theDocument.setPageSize(new Rectangle(width, height));

// g.setPageSize(pageable.getPageFormat(0));
  theDocument.open();

for (int  p = 0;  p  pages ; ++p) {
//moved the create into the for loop
g = pdfWriter.getDirectContent().createGraphics(width, height, fm);
Printable thePage = pageable.getPrintable(p);
try {
// print!
thePage.print(g, pageable.getPageFormat(p), p);
System.out.println(PdfJob.createPdf:  page  + p +  printed);
if (p  pages-1) {
// next page, please! on its proper PageSize
width =
(float)pageable.getPageFormat(p+1).getPaper().getWidth();
height =
(float)pageable.getPageFormat(p+1).getPaper().getHeight();
theDocument.setPageSize(new Rectangle(width, height));
} // end of if (p  pages-1)


theDocument.newPage();
} catch ( PrinterException e) {
e.printStackTrace();
}
catch(DocumentException de) {
  de.printStackTrace();
}

g.dispose(); //dispose it here when you are done with it
} // end of for (int p = 0; p  pages; p++)
// write the document and clear all references
end();  // = theDocument.close()
} // end of if (pageable)
} // end createPdf


___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



RE: [iText-questions] leading in pdfpcell

2002-04-22 Thread Paulo Soares

Use zelle.setLeading(0, 1.5f) to start with and then read the javadocs for
the method in ColumnText.

Best Regards,
Paulo Soares

 -Original Message-
 From: Thomas Kübler [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, April 22, 2002 15:52
 To:   [EMAIL PROTECTED]
 Subject:  [iText-questions] leading in pdfpcell
 
 hallo,
  
 i have an another question. how do i set the leading of a phrase in 
 a pdfpcell. when i set 
  
 PdfPCell zelle = new PdfPCell( new Phrase(testlauf));
 zelle.setLeading(durch,1f);
  
 where durch = fontsize * 1.5;
  
 i get not very good results with this parameter, i tried
 zelle.setLeading(durch,0f), this
 works for some text good, but when the fontsize will be bigger, the lines
 will be together.
  
  
 thanks thomas.

___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] SVGs in PDf Files

2002-04-22 Thread Joachim F. Petzold

Hi all,

what is the easiest (and or best) way to add an existing SVG graphic to a
PDF document created with iText?
If the answer is complex, just a pointer in the right direction will do.

Thanks in advance,
Joachim


Joachim F. Petzold
[EMAIL PROTECTED]
phone: 416.925.8440
fax: 416.925.0993




___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



RE: [iText-questions] SVGs in PDf Files

2002-04-22 Thread Paulo Soares

There's no best way without converting first to some supported format. You
can try batik or fop to convert it to other format.

Best Regards,
Paulo Soares

 -Original Message-
 From: Joachim F. Petzold [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, April 22, 2002 16:34
 To:   iText Mailing List
 Subject:  [iText-questions] SVGs in PDf Files
 
 Hi all,
 
 what is the easiest (and or best) way to add an existing SVG graphic to a
 PDF document created with iText?
 If the answer is complex, just a pointer in the right direction will do.
 
 Thanks in advance,
 Joachim
 
 
 Joachim F. Petzold
 [EMAIL PROTECTED]
 phone: 416.925.8440
 fax: 416.925.0993
 
 
 
 
 ___
 iText-questions mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/itext-questions

___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



RE: [iText-questions] PdfGraphics2D: unbalanced save/Restore Exception

2002-04-22 Thread Paulo Soares

Post a complete working sample with the wrong behavior. I can't reproduce
the problem with only what you have provided. I did this program and it
works.

import java.io.*;

import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import java.awt.*;

public class g2_landscape {
public static void main(String[] args) {
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
Document.compress = false;
try {
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream(c:\\g2_landscape.pdf));
document.open();
PdfContentByte cb = writer.getDirectContent();
Graphics2D g2 = cb.createGraphics(100, 100);
g2.drawLine(0, 0, 100, 100);
g2.dispose();
document.setPageSize(PageSize.A4.rotate());
document.newPage();
g2 = cb.createGraphics(100, 100);
g2.drawLine(0, 0, 100, 100);
g2.dispose();
document.close();
System.out.println(Finished.);
}
catch (Exception de) {
de.printStackTrace();
}
}
}

Best Regards,


 -Original Message-
 From: Erwin Achermann [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, April 22, 2002 17:05
 To:   jim moore; [EMAIL PROTECTED]
 Subject:  RE: [iText-questions] PdfGraphics2D: unbalanced save/Restore
 Exception
 
 Hi Jim, 
 you're right they were mismatched but still after fixing that i get wrong
 behaviour. 
 It seems like the the PdfGraphics2D is doing some chaching or
 optimization, concerning the save/resore graphicsState.
 
   // set pageSize of first page before the document
 opens!!
   float width =
 (float)pageable.getPageFormat(0).getPaper().getWidth();
   float height =
 (float)pageable.getPageFormat(0).getPaper().getHeight();
   theDocument.setPageSize(new Rectangle(width,
 height));
   // g.setPageSize(pageable.getPageFormat(0)); // this
 was my old implementation
   theDocument.open();
   g =
 pdfWriter.getDirectContent().createGraphics(width, height, fm);
   
   for (int  p = 0;  p  pages ; ++p) {
   Printable thePage =
 pageable.getPrintable(p);
   try {
   // print! 
   thePage.print(g,
 pageable.getPageFormat(p), p);
   
 System.out.println(PdfJob.createPdf:  page  + p +  printed);
   if (p  pages-1) {
   // next page, please! on its
 proper PageSize 
   //
 g.setPageSize(pageable.getPageFormat(p+1));
   width =
 (float)pageable.getPageFormat(p+1).getPaper().getWidth();
   height =
 (float)pageable.getPageFormat(p+1).getPaper().getHeight();
   theDocument.setPageSize(new
 Rectangle(width, height));
   } // end of if (p  pages-1)
   theDocument.newPage();
   g.dispose();
   g =
 pdfWriter.getDirectContent().createGraphics(width, height, fm);
   } catch ( PrinterException e) {
   e.printStackTrace();
   }
   catch(DocumentException de) {
   de.printStackTrace();
   }
   } // end of for (int p = 0; p  pages; p++)
   g.dispose();
   // write the document and clear all references
   end();
 
 The idea is to have a PdfGraphicsObject per page. I therefore issue a
 g.dispose() before each new GraphicsObject is created, and one g.dispose()
 after the last page (outside of the the loop) create-dispose pairs match
 now. But still the paper orientation is not correctly set to the
 respective page orientation. In my onwn old PdfGraphics implementation I
 had the following method: 
   
   public void setPageSize(PageFormat pf) {
   Paper p = pf.getPaper();
   System.out.println( Paper: w:+p.getWidth()+,
 h:+p.getHeight());
   System.out.println( PageFormat: w:+pf.getWidth()+
 h:+pf.getHeight() 
  +  Orient:
 +pf.getOrientation());
   System.out.println( DocTop: +doc.top());
   System.out.println( Doc.Page.Height:
 +doc.getPageSize().height());
   
   doc.setPageSize(new Rectangle((float)pf.getWidth(),
 (float)pf.getHeight()));
   
   // do 

[iText-questions] Problem after upgrading to Tomcat 4.0

2002-04-22 Thread Jay Teo


Hi,

I have been using iText to generate PDF from Java servlets for some time 
now and it has worked great until I upgraded Tomcat from 3.3 to 4.0.

After the upgrade, it's still working fine with IE 5.5. IE 6.0, however, 
would pop up a window asking the user if he wants to Open or Save the 
file. And regardless of which one you pick, it would say it's unable to 
open.

Using a program called JSnoop to trace the HTTP communication between IE 
and Tomcat, I got the following headers:


- (TOMCAT 3.3) -

HTTP/1.0 200 OK
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
Content-Type: application/pdf
Content-Length: 12543
Servlet-Engine: Tomcat Web Server/3.2.1 (JSP 1.1; Servlet 2.2; Java 
1.3.0; Linux 2.2.16-22 i386; java.vendor=Sun Microsystems Inc.)


- (TOMCAT 4.0.3) -

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Length: 12543
Date: Mon, 22 Apr 2002 14:56:46 GMT
Pragma: no-cache
Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT

--


As you can see, they both have Content-Type set to application/pdf. 
So what is wrong here?

I'm at a loss, any help/suggestions would be appreciated.



-j




_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] wrap text around a table

2002-04-22 Thread Chad Brandt

Is it possible to have a small table that takes up about 40% of page width 
and have text wrap around the table?

Thanks
Chad


___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] Problem after upgrading to Tomcat 4.0

2002-04-22 Thread Nicolas Ivering

Is it ie6 or acroread saying it can't open the file? It it is acroread 
it may be that tomcat 4 is sending as ASCII instead of  binary.

Best Regards
Nicolas Ivering

Jay Teo wrote:


 Hi,

 I have been using iText to generate PDF from Java servlets for some 
 time now and it has worked great until I upgraded Tomcat from 3.3 to 4.0.

 After the upgrade, it's still working fine with IE 5.5. IE 6.0, 
 however, would pop up a window asking the user if he wants to Open or 
 Save the file. And regardless of which one you pick, it would say it's 
 unable to open.

 Using a program called JSnoop to trace the HTTP communication between 
 IE and Tomcat, I got the following headers:


 - (TOMCAT 3.3) -

 HTTP/1.0 200 OK
 Pragma: no-cache
 Expires: Thu, 01 Jan 1970 00:00:00 GMT
 Cache-Control: no-cache
 Content-Type: application/pdf
 Content-Length: 12543
 Servlet-Engine: Tomcat Web Server/3.2.1 (JSP 1.1; Servlet 2.2; Java 
 1.3.0; Linux 2.2.16-22 i386; java.vendor=Sun Microsystems Inc.)


 - (TOMCAT 4.0.3) -

 HTTP/1.1 200 OK
 Content-Type: application/pdf
 Content-Length: 12543
 Date: Mon, 22 Apr 2002 14:56:46 GMT
 Pragma: no-cache
 Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
 Cache-Control: no-cache
 Expires: Thu, 01 Jan 1970 00:00:00 GMT

 --


 As you can see, they both have Content-Type set to 
 application/pdf. So what is wrong here?

 I'm at a loss, any help/suggestions would be appreciated.



 -j




 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com


 ___
 iText-questions mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/itext-questions





___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] Problem after upgrading to Tomcat 4.0

2002-04-22 Thread Nicolas Ivering

Glad you found a solution. I'm on a project involving tomcat 4 and pdfs 
too so I would probably have stumbled upon the same problem eventually.

/Nicolas

Jay Teo wrote:


 Nicolas,

 Thanks for you response.

 I just solved my problem (or at least found a workaround). I think 
 it's an IE6 bug.

 After posting my original message, it was clear that the only 
 difference in the response header was HTTP/1.0 vs HTTP/1.1.  So I 
 configured Tomcat 4 to use the HTTP 1.0 Connector and now ie6 is happy.

 One more thing, right after posting my question, I realized the iText 
 mailing list may not be the most appropriate place to post this 
 question. I apologize if that's the case.


 -j





 Nicolas Ivering wrote:

 Is it ie6 or acroread saying it can't open the file? It it is 
 acroread it may be that tomcat 4 is sending as ASCII instead of  binary.

 Best Regards
 Nicolas Ivering

 Jay Teo wrote:


 Hi,

 I have been using iText to generate PDF from Java servlets for some 
 time now and it has worked great until I upgraded Tomcat from 3.3 to 
 4.0.

 After the upgrade, it's still working fine with IE 5.5. IE 6.0, 
 however, would pop up a window asking the user if he wants to Open 
 or Save the file. And regardless of which one you pick, it would say 
 it's unable to open.

 Using a program called JSnoop to trace the HTTP communication 
 between IE and Tomcat, I got the following headers:


 - (TOMCAT 3.3) -

 HTTP/1.0 200 OK
 Pragma: no-cache
 Expires: Thu, 01 Jan 1970 00:00:00 GMT
 Cache-Control: no-cache
 Content-Type: application/pdf
 Content-Length: 12543
 Servlet-Engine: Tomcat Web Server/3.2.1 (JSP 1.1; Servlet 2.2; Java 
 1.3.0; Linux 2.2.16-22 i386; java.vendor=Sun Microsystems Inc.)


 - (TOMCAT 4.0.3) -

 HTTP/1.1 200 OK
 Content-Type: application/pdf
 Content-Length: 12543
 Date: Mon, 22 Apr 2002 14:56:46 GMT
 Pragma: no-cache
 Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector)
 Cache-Control: no-cache
 Expires: Thu, 01 Jan 1970 00:00:00 GMT

 --


 As you can see, they both have Content-Type set to 
 application/pdf. So what is wrong here?

 I'm at a loss, any help/suggestions would be appreciated.



 -j




 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com


 ___
 iText-questions mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/itext-questions







 ___
 iText-questions mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/itext-questions







___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] Headers and Footers

2002-04-22 Thread Ben Sinclair

Is it possible to do more advanced formatting and insert images or other PDF
files into headers and footers? As far as I can tell, all I can do is text and
alignment.

--
Ben Sinclair
[EMAIL PROTECTED]


___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions