Re: [iText-questions] getPageNumber() always returns zero
Quoting Matt Benson [EMAIL PROTECTED]: What is the reason for this? I assume there must be one. I honestly don't remember. I have to update several parts of the site, but I don't have the time rightnow (maybe in february). I'll keep your mail as a reminder. Bruno --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Indenting a Header!
Quoting John L. Lowenthal [EMAIL PROTECTED]: Sorry for the double send on the previous email... The posted solution only fixes half my problem. It aligns fine now, but I still have the problem that I can't indent the header. Is there anything I can do about this? Thanks. -John You can't indent the header because the text is stored as a Phrase in the HeaderFooter object. HeaderFooter extends Rectangle, maybe you can do something with the Rectangle methods, but I am not sure of this (I should check this). You could avoid lots of these problems by using a PageEvent in combination with ColumnText... Bruno --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Add content to copied pdf
One other question related to PdfCopy. Is it possible to extract only form field from PDF file and place it to currently generating PDF? With regards KuMi It's possible with a lot of work. You'd have to deal directly with stream contents and dictionaries as all the changes would be in-place. Best Regards, Paulo Soares -Original Message- From:KuMi [SMTP:[EMAIL PROTECTED]] Sent:Friday, January 10, 2003 7:13 To:[EMAIL PROTECTED] Subject:[iText-questions] Add content to copied pdf Hello all, It seems to me that additional content cannot be added to copied pdf with PdfCopy.java. Is it possible? KuMi --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Can i write an encrypted pdf directly to response OutputStream?
Hi. Can i write an encrypted pdf directly to response.OutputStream?Below is the fragment of code which i m implementing.Is it legal without performance bottleneck. PdfEncryptor.getInstance().writePrintOnlyCopy(pdfReader,httpServletResponse.getOutputStream() ) ; protected void writePrintOnlyCopy(PdfReader pdfReader,OutputStream outputStream) throws DocumentException, IOException { com.lowagie.text.pdf.PdfEncryptor.encrypt(pdfReader, outputStream, IPdfEncryptConstants.Pdf_Owner, null, IPdfEncryptConstants.ALLOW_PRINTING, false); }
RE: [iText-questions] Can i write an encrypted pdf directly to response OutputStream?
You can do it but you may (you will) run into troubles with IE if the content length is not sent. Best Regards, Paulo Soares -Original Message- From: Pritam Dewan [SMTP:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 11:55 To: [EMAIL PROTECTED] Subject: [iText-questions] Can i write an encrypted pdf directly to response OutputStream? Hi. Can i write an encrypted pdf directly to response.OutputStream?Below is the fragment of code which i m implementing.Is it legal without performance bottleneck. PdfEncryptor.getInstance().writePrintOnlyCopy(pdfReader,httpServletRespons e.getOutputStream() ) ; protected void writePrintOnlyCopy(PdfReader pdfReader,OutputStream outputStream) throws DocumentException, IOException { com.lowagie.text.pdf.PdfEncryptor.encrypt(pdfReader, outputStream, IPdfEncryptConstants.Pdf_Owner, null, IPdfEncryptConstants.ALLOW_PRINTING, false); } --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] Add content to copied pdf
Yes and no. You can get all the field information and build another field. Unfortunately you'll also have to duplicate the appearance stream or in other words be an annotation handler. Best Regards, Paulo Soares -Original Message- From: Kumata Mitsugu [SMTP:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 11:39 To: Paulo Soares; [EMAIL PROTECTED] Subject: Re: [iText-questions] Add content to copied pdf One other question related to PdfCopy. Is it possible to extract only form field from PDF file and place it to currently generating PDF? With regards KuMi It's possible with a lot of work. You'd have to deal directly with stream contents and dictionaries as all the changes would be in-place. Best Regards, Paulo Soares -Original Message- From:KuMi [SMTP:[EMAIL PROTECTED]] Sent:Friday, January 10, 2003 7:13 To:[EMAIL PROTECTED] Subject:[iText-questions] Add content to copied pdf Hello all, It seems to me that additional content cannot be added to copied pdf with PdfCopy.java. Is it possible? KuMi --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Displaying exceptions from a PDF generating servlet
I'm just beginning to author a servlet which generates a PDF document (for the browser) from data in a database. I'm having problems with it where, when I have certain lines of code in the servlet, I get an empty browser (not even an empty PDF doc). I must be throwing exceptions that I'm not seeing. What I want to know is if anyone knows how to display the exceptions in a browser window if the PDF doc doesn't get created. The following lines don't seem to work for me. catch (Exception e) { System.err.println(e.getMessage()); } Any ideas? Thanks, Kenny --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] BaseFont.getWidth(Unknown source) error
I have a servlet that creates a PDF using iText. I'm grabbing a date from the database (as a string) and trying to display it with the following line of code: cb.showTextAligned(PdfContentByte.ALIGN_CENTER, asOfDate, pageWidth / 2, pageHeight - 70, 0); When I use this, I get the following error (truncated for brevity): java.lang.NullPointerException at com.lowagie.text.pdf.BaseFont.getWidth(Unknown source) at com.lowagie.text.pdf.BaseFont.getWidthPoint(Unknown source) at com.lowagie.text.pdf.PdfContentByte.showTextAligned(Unknown source) ... If I change the string variable (asOfDate) to a constant test, then the servlet generates the PDF (when I get the error, I just get a blank browser). Any ideas? Thanks, Kenny --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] BaseFont.getWidth(Unknown source) error
Probably the variable asOfDate is null. Best Regards, Paulo Soares -Original Message- From: Kenny G. Dubuisson, Jr. [SMTP:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 16:13 To: [EMAIL PROTECTED] Subject: [iText-questions] BaseFont.getWidth(Unknown source) error I have a servlet that creates a PDF using iText. I'm grabbing a date from the database (as a string) and trying to display it with the following line of code: cb.showTextAligned(PdfContentByte.ALIGN_CENTER, asOfDate, pageWidth / 2, pageHeight - 70, 0); When I use this, I get the following error (truncated for brevity): java.lang.NullPointerException at com.lowagie.text.pdf.BaseFont.getWidth(Unknown source) at com.lowagie.text.pdf.BaseFont.getWidthPoint(Unknown source) at com.lowagie.text.pdf.PdfContentByte.showTextAligned(Unknown source) ... If I change the string variable (asOfDate) to a constant test, then the servlet generates the PDF (when I get the error, I just get a blank browser). Any ideas? Thanks, Kenny --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] serious problem concatenating pdfs together
Paulo, Thanks for your prompt reply. I am now trying to write a general purpose pdf appender using PdfCopy.java which will will allow an abitrary number of pdf appends. However I'm having trouble with 'PdfCopy.getImportedPage'. It doesn't seem to work after the first reader. I'm looking at the source now and trying to figure it out. Do I need to reset or increment something inbetween readers? Anyone have any insight into this? Thanks! Sean Langford Paulo Soares wrote: It may be a problem of too many nested templates. Each time a concat is made each page is inserted as a template. If you have two concats than you'll have a template inside a template and so on. Did you try with CopyPdf.java? Here the pages are copied without using templates and you get the links and fields as a bonus. Best Regards, Paulo Soares -Original Message- From: Sean Langford [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 19:57 To: [EMAIL PROTECTED] Subject: [iText-questions] serious problem concatenating pdfs together Hello! I'm having some problems printing various pdfs which have had several other pdfs concatenated to it. This can be reproduced using itext's Concat example/utility as so: java Concat a.pdf src1.pdf src2.pdf; java Concat b.pdf a.pdf src3.pdf; java Concat c.pdf b.pdf src4.pdf; java Concat d.pdf c.pdf src5.pdf; java Concat e.pdf d.pdf src6.pdf; java Concat f.pdf e.pdf src7.pdf; java Concat g.pdf f.pdf src8.pdf; java Concat h.pdf g.pdf src9.pdf; java Concat i.pdf h.pdf src10.pdf; java Concat j.pdf i.pdf src11.pdf; java Concat k.pdf j.pdf src12.pdf; java Concat l.pdf k.pdf src13.pdf; java Concat m.pdf l.pdf src14.pdf; java Concat n.pdf m.pdf src15.pdf; java Concat o.pdf n.pdf src16.pdf; java Concat final1.pdf o.pdf src17.pdf; Using itext to concatenate pdfs in this way sometimes results in a pdf which can be viewed, but cannot be printed. Each source file individually is a valid pdf which is viewable and printable. The number of documents appended seems to matter; if any of the source files are omitted, the resulting pdf file will print normally. Also: opening this file in Acrobat 4 and making a trivial change and then saving seems to 'fix' the file making it printable. This behavior is repeatable in acrobat 4, 5, 5.1 and gv on windows and linux using several different printers. Strangely there is no error from the OS, the printer or the pdf viewer when trying to print. However, if I take these pdfs and Concat them like so: java Concat final2.pdf src1.pdf src2.pdf src3.pdf src4.pdf src5.pdf \ src6.pdf src7.pdf src8.pdf src9.pdf src10.pdf src11.pdf src12.pdf \ src13.pdf src14.pdf src15.pdf src16.pdf src17.pdf the resultant 'final2.pdf' is *smaller*, views identically, and prints normally. I've posted the set of files which causes this failure on my website: http://seanlangford.com/PdfConcatBlues.zip Anyone have any experience or insight on what might be causing this? Is this a pdf limitation, or a bug in itext? Thanks! Sean Langford --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] How to set PdfPCell width
I'm trying to set the width of my cells in a PdfPTable that uses PdfPCells. I've tried the setLeft method to no avail. Could someone tell me how to control a PdfPCell's width. Thanks in advance, Kenny --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] How to set PdfPCell width
I figured it out. For future reader's of this post, you set the widths via PdfPTable.setWidths. For me to set one column to 30% of the total width and all other 7 columns to 10%, I used the line: int[] widths = {30, 10, 10, 10, 10, 10, 10, 10}; table.setWidths(widths); Kenny - Original Message - From: Kenny G. Dubuisson, Jr. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 10, 2003 3:48 PM Subject: [iText-questions] How to set PdfPCell width I'm trying to set the width of my cells in a PdfPTable that uses PdfPCells. I've tried the setLeft method to no avail. Could someone tell me how to control a PdfPCell's width. Thanks in advance, Kenny --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] moveTo, lineTo - what are the coordinates?
Hi; I may not have explained this very well. First, I have to write my various lines at different times and get them to join up seamlessly. To make it all one path would require some very painful coding. Plus the line width dashes change from segment to segment. So lets say I am drawing a horizontal line (all coordinates in pixels) from 12,24 to 50,24. And I am drawing a vertical line from 12,24 to 12, 60. And I want a nice square corner. And both lines are 3 pixels wide. Then if I do moveTo(11,24) / lineTo (51,24) I should get 3 lines (in pixels) 11,23-51,23; 11,24-51,24; 11,25-51,25. Then if I do moveTo(12,23) / lineTo (12,61) I should get 3 lines (in pixels) 11,23-11,61; 12,23-12,61; 13,23-13,61. And in this case the upper left pixel of the corner should be 11,23 and it should coem out square. But it doesn't. thanks - help - dave - Original Message - From: David Thielen To: itext Sent: Friday, January 10, 2003 9:03 PM Subject: [iText-questions] moveTo, lineTo - what are the coordinates? Hi; When I do a moveTo/lineTo - the coordinates are to what part of the end-point. I am having a problem getting two lines to join properly if I draw them seperately. I am assuming that the endpoints are in the center of the width of the line - is that true? thanks - dave
RE: [iText-questions] Underlined font
BaseFont can't be underlined unless is part of a Chunk. Best Regards, Paulo Soares -Original Message- From: Kenny G. Dubuisson, Jr. [SMTP:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 21:47 To: [EMAIL PROTECTED] Subject: [iText-questions] Underlined font How do I get a BaseFont that is underlined? I looked all through the Java docs and didn't see it mentioned. What I want is TIMES_ROMAN underlined. Thanks, Kenny --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions