Re: [iText-questions] Question about page number footers

2011-03-23 Thread Klas Lindbäck
I assume you want the same date and time on all pages. So you should generate the date/time string only once and then use it on each page. I assume you want different page numbers on each page. So you should generate the page number once for each page. It loooks like you are applying the page n

Re: [iText-questions] problem with Lucida Grande Font and MacRoman

2011-03-21 Thread Klas Lindbäck
Bruno: This is a very common question. You should add the example to the website and tag it with the search words "itext character font contains glyph not displayed". /Klas 1T3XT BVBA skrev 2011-03-21 16:55: Op 21/03/2011 16:24, Fabrice MAUPIN schreef: I've no problem when i show these charact

Re: [iText-questions] NullpointerException on document.close()

2010-11-03 Thread Klas Lindbäck
If you use lower level constructs like directcontent it is possible to get strange errors if you write stuff out of order or if you have unclosed sections or sections with the wrong kind of content. So I think your idea to comment out all rendering code is a good one. I don't know which tool you

Re: [iText-questions] how would you do.....

2010-09-30 Thread Klas Lindbäck
Ok, but apparently you know the position when you create each individual pdf, so you could add a database field to store the position. But it might require less refactoring if you can place an invisible marker in the pdf. /Klas Jason Berk skrev 20:59: >I assume that you know where to place

Re: [iText-questions] how would you do.....

2010-09-30 Thread Klas Lindbäck
I'm not sure that I understand your problem. You have the individual PDFs. I assume that you know where to place the disclaimer page when you concatenate the pages. You are using iText to perform the concatenation? Then it should be a breeze to insert extra pages with the disclaimer at the app

Re: [iText-questions] Strange ASCII character replacement pattern - Character Mapping Table ?

2010-09-07 Thread Klas Lindbäck
I think you are being too general in your reply. Of course it is possible to interpret embedded fonts that use custom mappings. If he creates a mapping for each font that maps the characters to the ascii character that corresponds to the letter drawn by each glyph. It's a simple substitution cyph

Re: [iText-questions] problem in serving pdf to browser

2010-08-16 Thread Klas Lindbäck
See comments in the code below. /Klas Venkata Pachawa skrev 20:59: Hello, I am using JFreeChart and iText. I am creating a chart and saving it as pdf in my file system. When I open it, it works (pdf with content is displayed). When I tried to serve the pdf to browser as attachment, I get err

Re: [iText-questions] help

2010-08-12 Thread Klas Lindbäck
Are you sure that the text is part of the image? It may be ordinary text that is printed on top of the image. /Klas Mostafa Shaeri skrev 20:59: -- hi -- From: *Mostafa Shaeri* @gmail.com > Date: Sun, Aug 8, 2010 at 10:33 AM Subject:

[iText-questions] OT: Re: Re: Why ClassNotFoundException on BadElementException?

2010-08-12 Thread Klas Lindbäck
Erik Tronstad skrev 20:59: > Thanks a lot! :) :) :) > > Though must be a small error in your quote: Class path entries must be > separated by a SEMIcolon, not colon, as far as I can understand. Path separators are operating system dependent. The man page is for Unix/Linux-based systems. The pat

Re: [iText-questions] Why ClassNotFoundException on BadElementException?

2010-08-12 Thread Klas Lindbäck
some parameters for the program. Erik At 17:35 11.08.2010, Klas Lindbäck wrote: Since you can compile it, the java compiler can successfully find and read iText-5.0.3.jar. How do you run the program afterwards? Are you sure that you have the same CLASSPATH? If you have a start script it is

Re: [iText-questions] Why ClassNotFoundException on BadElementException?

2010-08-11 Thread Klas Lindbäck
Since you can compile it, the java compiler can successfully find and read iText-5.0.3.jar. How do you run the program afterwards? Are you sure that you have the same CLASSPATH? If you have a start script it is possible that it doesn't include the iText jar... (Been there, done that) /Klas E

Re: [iText-questions] iText 1.3.1

2010-08-10 Thread Klas Lindbäck
I have seen this several times. Let me guess: You are using an HP printer driver? The problem is in the printer driver. I don't know why they don't fix it, cause it's really annoying. It's been around for a couple of years now. The workaround is to print the pdf again. You don't even have to re-

Re: [iText-questions] iText Perfomance Issue on WebLogic 9.2

2010-06-04 Thread Klas Lindbäck
One obvious thing to look at is physical memory and paging. I have a hunch that WLS is more memory-consuming than Tomcat leaving less for iText which may cause paging to occur. Also, profiling was suggested, and I agree that it is a very good idea to help pinpoint the source of the problem. /Kl

Re: [iText-questions] Open an existing PDF instead of creating blank

2010-05-27 Thread Klas Lindbäck
As pointed out by Paolo, doing it from a jsp page is a bad idea. You should convert it to a servlet. The rest of this post is off-topic for this list. If you have an existing PDF you want to send you just need to obtain the bytes. 1. Open the pdf file (just as you would open any binary file). 2

Re: [iText-questions] Splitting a PDF on the basis of file size

2010-05-25 Thread Klas Lindbäck
There are several approaches to this. It is difficult to get a precise cut-off point, but I assume that an approximate cutoff size is sufficient. I give you three possible ways below. I am assuming that the pdf consists of records. Each record consists of information that need to be kept in the

Re: [iText-questions] help

2010-05-20 Thread Klas Lindbäck
Look up how to add page numbering. You should be able to add section numbers in a similar way. Use onEndPage and add the section number at an absolute position as is done in the examples: http://itextdocs.lowagie.com/tutorial/directcontent/pageevents/index.html#examples /Klas EXI-D'Souza, Aman

Re: [iText-questions] Where can I find the character maps for the embedded fonts (Helvetica...)?

2010-05-11 Thread Klas Lindbäck
I just searched for "helvetica font map" in Google and clicked the top link (I got lucky!). From there I clicked the supplied link to the Full Character Map (http://www.myfonts.com/fonts/linotype/helvetica/helvetica/charmap.html). I found the characters on the 1252 codepage. /Klas Fred Janon sk

Re: [iText-questions] Where can I find the character maps for the embedded fonts (Helvetica...)?

2010-05-10 Thread Klas Lindbäck
Have you tried Unicode 2022 (bullet) and 2013 or 2014 (dash)? /Klas Fred Janon skrev 20:59: > I need to insert a big black bullet and a fat horizontal dash in the > middle of some text in Helvetica 10pt to put a legend next to > ajFreeChart chart. I need the Unicode for these 2 characters and > c

Re: [iText-questions] Ploblem with superscript and subscript

2010-05-05 Thread Klas Lindbäck
I found your thread on http://forums.sun.com/thread.jspa?threadID=5436285. If you are still following the track outlined in that thread I suggest the following: Creating a derived Font using a suitable AffineTransform object to modify the vertical position should work. /Klas dorairaj skrev 20:

Re: [iText-questions] Ploblem with superscript and subscript

2010-05-05 Thread Klas Lindbäck
I asked google using the search phrase: itext superscript I then chose the top link from the real result and got the following suggestion: setTextRise: public Chunk */setTextRise/*(float rise)is used to sets the text displacement relative to the baseline. Positive values rise the text, nega

Re: [iText-questions] Guidance Requested - Generating multipage output with header/footer and pg 1 layout

2010-04-28 Thread Klas Lindbäck
I use page events and the decorator pattern for templates and page numbering. I use template pdf:s for templates. A template pdf contains one or two pages with the template (depending on if I have the same or different tempaltes for page one and for subsequent pages). If I have a separate templa

Re: [iText-questions] After rotation, images are getting displced in iText PDF

2010-02-23 Thread Klas Lindbäck
Images are not rotated around their center. The coordinate of the rotation pivot is (0, 0). If you rotate something, you have to watch out that it is not rotated 'off' your page. you may have to perform a translation to keep the object on the page. /Klas rhul_rk skrev 20:59: Hi, It's very

Re: [iText-questions] Writing to ServletOutputStream

2010-02-22 Thread Klas Lindbäck
I am doing in a similar way. The only notable difference is the response header. I use the following, which works in both IE and Firefox: response.setHeader("Content-Disposition", "*inline*; filename=form.pdf"); /Klas ---

Re: [iText-questions] Umlaut problem with PdfGraphics2D on SnowLeopard

2009-12-18 Thread Klas Lindbäck
> > > Ämne: > Re: [iText-questions] Umlaut problem with PdfGraphics2D on SnowLeopard > Från: > "Christoph Wagner" > Datum: > Fri, 18 Dec 2009 01:06:23 +0100 > Till: > "'Post all your questions about iText here'" > > > Till:

Re: [iText-questions] iText-questions Digest, Vol 40, Issue 84

2009-09-29 Thread Klas Lindbäck
I would separate the form into a template consisting of two pages. The first page has the stuff that goes above the table. Then I would import the first page to my pdf, add the table and then import the second page. I've never used form fields, but if I understand correctly there may be some a

Re: [iText-questions] (no subject)

2009-09-14 Thread Klas Lindbäck
> 2. Furthermore, When "growing" a table all items below that (except footer) > have to be moved. I couldn't figure out how to achieve this Seperate the template into multiple pages, placing the stuff before and after the table on different pages in the template. Then import pages from the temp

Re: [iText-questions] How is the baseline for a columnText determined ?

2009-09-07 Thread Klas Lindbäck
Seems like you are going through an awful lot of trouble to position text. ColumnText is for when you want iText to do the positioning for you. Maybe you should switch to using direct content. That way you get complete control of where the text appears. See:  http://1t3xt.info/examples/brow

Re: [iText-questions] Bad result with merging PDF

2009-08-20 Thread Klas Lindbäck
The problem occurs on page 4, the second time the image pdf is added, so the problem is probably related to that. The construction of pageImage from reader_blancAvecImage was not included in your code snippets. Was it also created using getImportedPage? /Klas > - Original Message - From

Re: [iText-questions] out of Kernel memory

2009-08-12 Thread Klas Lindbäck
Maybe it's related to the indexing sevice. Anyway, I think the notion that there is some feature that scans the files is a good one. Now you have three suggestions: Virus checker SVN (or some other similar tool) The windows indexing service (not sure about the name, but I mean the service th

Re: [iText-questions] Illegal operation 'Tm' outside a text object using DirectUnderContent

2009-08-07 Thread Klas Lindbäck
I noticed that you use == for String comparison. Using == to compare Strings is generally not recommended. The == operator compares the String object identities, not the String contents. String one = "test"; String two = new String("test"); String three = OtherClass.makeString("t","e","s","t"); /

Re: [iText-questions] How to calculate text-height when using PDFContentByte?

2009-06-29 Thread Klas Lindbäck
Uppercase letters are normally as high as the font size. Lowercase letters can jut down a bit. I normally use font size * 1.4 between each row when using manual text positioning. /Klas Ämne: Re: [iText-questions] How to calculate text-height when using PDFCon

[iText-questions] Ämne:,Re: IE Problem wi th opening PDF from remote host

2009-06-18 Thread Klas Lindbäck
On some windows clients, IE also looks at the URL. Try changing the URL to xxx.pdf. Ämne: Re: [iText-questions] IE Problem with opening PDF from remote host Från: "Matthew Devine" Datum: Wed, 17 Jun 2009 15:11:32 -0400

Re: [iText-questions] out of memory error while creating document

2009-06-05 Thread Klas Lindbäck
Have you looked at the java heap (memory allocation) to find the source of your problem? I havent done it myself, but http://www.javapassion.com/javase/javaMemoryProfiling.pdf seems to give some good hints. Page 16 gives tips on how to get a heap dump on out of memory error: -XX:+HeapDumpOnOu

Re: [iText-questions] Vector Graphics not using EPS

2009-05-15 Thread Klas Lindbäck
We have the same situation where I work. We get logos (in EPS) which we save as SVG from Adobe Illustrator. We then convert the SVG to PDF using Batik (as suggested in the book iText in Action). The resulting PDF is stored in the system. I think you can also save as (or print as) PDF directly f

Re: [iText-questions] Exception in PdfReader (Was: iText-questions Digest, Vol 36, Issue 34)

2009-05-07 Thread Klas Lindbäck
Neena, Hard to say with the limited information you provided. The most obvious  possible cause is that the file that you have opened for reading is not a valid PDF file. Klas Ämne: Re: [iText-questions] iText-questions Digest, Vol 36, Issue 27

[iText-questions] Imported pages are too slow (Kruzic, Alex x55204)

2009-05-04 Thread Klas Lindbäck
You can try caching the imported page in memory. If the number of templates is small the memory overhead will be managable. Is the template large? In that case you can also try to re-create the template. When I create PDF:s using a simple template combined with data from the database I have crea

Re: [iText-questions] Scale text to fit document width

2009-04-20 Thread Klas Lindbäck
I use BaseFont.getWidthPoint(String text, float fontSize) to get the width of a text string. If the result is too wide, I reduce the font size and check again. /Klas Ämne: Re: [iText-questions] Scale text to fit document width

Re: [iText-questions] Pushbutton submit fails to open in a browser

2009-04-07 Thread Klas Lindbäck
In your servlet, set the response type to PDF with the following code: response.setContentType("application/pdf"); Ämne: [iText-questions] Pushbutton submit fails to open in a browser. Från: shri2010

Re: [iText-questions] OutOfMemory error

2009-03-04 Thread Klas Lindbäck
|| > On Wed, Mar 4, 2009 at 3:26 AM, Massimiliano Ziccardi > > wrote: > > The only object I take in memory is the PDF reader, that, of > course get closed and recreated (with a new instance) after each > signature. > > That should clean the

Re: [iText-questions] Convert an existing PDF to PDF/A, and sign it

2009-01-21 Thread Klas Lindbäck
Sounds like it will be easier, if you have that option, to create PDF/A-complient PDF:s from get go instead of converting them afterwards. -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to t

Re: [iText-questions] Reason for damaged PDF production?

2009-01-16 Thread Klas Lindbäck
Sounds like a font issue. My guess is that the document uses fonts that you have on the dev machine but not on the production machine and that you try to embed the fonts in the document. A solution would be to change the font in the source document or to install the missing fonts on the productio

Re: [iText-questions] Controling Automatic Page Breaking

2009-01-13 Thread Klas Lindbäck
What page breaking algorithm do you want to use? Do you want to keep entire sections on the same page or do you want to avoid orphans and/or widows? A simple way to find the height of an entire section is to preview the output: 1. Create a scrap document with the same pagesize, borders etc and re

Re: [iText-questions] Concatinating PDFs

2008-12-08 Thread Klas Lindbäck
It is possible, but it requires that you know something about the source PDFs. If you know that the lower half of both source PDF:s is always blank then you can import them and put them on the same page using a vertical offset of half a page for the second one. See the example using PdfImported

[iText-questions] How do I convert a PDF to grayscale - followup

2008-11-25 Thread Klas Lindbäck
There has been no reply to my question 5 days ago on converting a PDF containing an image with RGB color to grayscale. Am I correct to assume that there is no easy way to do this using iText? Cheers, Klas - This SF.Net ema

[iText-questions] How do I convert a PDF to grayscale

2008-11-20 Thread Klas Lindbäck
I have a pdf template containing a grayscale image. The pdf is supplied from an external source and is typically created by exporting as PDF from Adobe Illustrator, inDesign or similar tool. I use iText to import the image and then add text to create a PDF which is later sent to a printing press

Re: [iText-questions] Deleting an empty page in the PDf docuement

2008-11-14 Thread Klas Lindbäck
Using iText to create a document is like writing a file. Once you have written something it isn't easily undone. If you feel the need to undo the newpage() you should probably revise your program logic so that newpage isn't called when it isn't needed. Example: Let's say that each chapter of a do

Re: [iText-questions] iText-questions Digest, Vol 28, Issue 79

2008-09-29 Thread Klas Lindbäck
I got similar problems for Rectangle when upgrading from iText-1 to iText-2. Some getter methods have been renamed. Change your code to call com.lowagie.text.Image.getPlainWidth() and it should work. Cheers, Klas > Ämne: > [iText-questions] Error - java.lang.NoSuchMethodError: > com.lowagie.t