Re: [iText-questions] Encryption - links gone
Quoting Ralf Terdic [EMAIL PROTECTED]: Hi, I'm trying to encrypt a file generated by pdflib which contains some links. The encryption works well with the Encrypt.java example, but then the links are gone. How can I avoid this? You can't: for the moment this is not supported. Leonard Rosenthol is working on an iText version that will support this. Bruno --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] Adding a List object to a ColumnText object (loss of formatting)
ColumnText only knows about text and its own formatting. You'll have to make the list by hand if you want to use ColumnText. Best Regards, Paulo Soares -Original Message- From: Andrew Murphy [SMTP:[EMAIL PROTECTED]] Sent: Saturday, September 21, 2002 12:06 To: [EMAIL PROTECTED] Subject: [iText-questions] Adding a List object to a ColumnText object (loss of formatting) Hi folks I need to create a page containing two columns (similar to example Chap1007 in the sample code) which contains terms and conditions you would commonly find on the reverse of a delivery note or order. These terms need to be ordered i.e. list items which are numbered for ease of reference. The sample code below illustrates what I am trying to achieve and shows that when you add a Phrase to the ColumnText object all List formatting is lost. Please help. Thanks, Andrew pre import java.io.FileOutputStream; import java.io.IOException; import com.lowagie.text.*; import com.lowagie.text.pdf.*; public class ListsAndColumns { public static void main(String[] args) { String localFilepath = E:\\TMP\\Examples\\iTextPDFexamples\\WEB-INF\\Classes\\; Document document = new Document(PageSize.A4); try { PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(localFilepath + ListsAndColumns.pdf)); document.open(); document.add(new Phrase(Example of adding a List to a Document object)); Phrase pList = new Phrase(); pList.add(getMyList()); document.add(pList); document.newPage(); document.add(new Phrase(Example of adding a List to a ColumnText object - all formatting lost!)); ColumnText colText = new ColumnText(writer.getDirectContent()); colText.setSimpleColumn(document.left(), 0, document.right(), document.top()-25, 15, Element.ALIGN_JUSTIFIED); colText.addText(pList); colText.go(); } catch(DocumentException de) { System.err.println(de.getMessage()); } catch(IOException ioe) { System.err.println(ioe.getMessage()); } finally { document.close(); } } static List getMyList() { List outerList = new List(true, false, 15); outerList.add(new ListItem(Outer list item 1)); List innerList = new List(false, true, 15); innerList.add(new ListItem(Inner list item 1)); innerList.add(new ListItem(Inner list item 2)); outerList.add(innerList); outerList.add(new ListItem(Outer list item 2)); return outerList; } } /pre --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] RE: JavaScript Improvement
Could you please check your HtmlWriter.java with the version in the cvs? You have: switch(element.type()) { case Element.HEADER: try { Header h = (Header) element; if (MarkupTags.STYLESHEET.equals(h.name())) { writeLink(h); } else if (HtmlTags.JAVASCRIPT.equals(h.name())) { writeJavaScript(h); } else { writeHeader(h); } } And in the cvs: case Element.HEADER: try { Header h = (Header) element; if (!MarkupTags.STYLESHEET.equals(h.name())) { writeHeader(h); } else { writeLink(h); } } writeLink() and writeHeader() are reversed. It works with your version but I dont't know if it will break something else. Maybe Bruno has some idea. Best Regards, Paulo Soares -Original Message- From: Eyrich, Joachim [SMTP:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 19:02 To: 'Paulo Soares' Subject: RE: JavaScript Improvement Hello, It seems you did not take the new HtmlWriter I sent you or the HtmlTags are old and don't include the variable JAVASCRIPT. Please find attached what the HTML output should like. If you still have problems, please don't hesitate to contact me. Good luck, Joachim -Original Message- From: Paulo Soares [mailto:[EMAIL PROTECTED]] Sent: 20 September 2002 17:16 To: Eyrich, Joachim Subject: RE: JavaScript Improvement I tried your program but the resulting html didn't work in IE 5.5. Could you check if what I generated is correct? Best Regards, Paulo Soares Test_JavaScript.zip -Original Message- From: Eyrich, Joachim [SMTP:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 15:25 To: 'Paulo Soares' Subject:RE: JavaScript Improvement Hello Paulo, Sorry for the delay but a lot of work wanted to be done. I added another feature, assigning a HTML style class to the BODY tag. Therefore I added the variable htmlStyleClass to document.java, including getter and setter. Furthermore I added 2 lines in HtmlWriter.java, where the BODY tag is written. Then I changed another two lines (422, 423) in HtmlWriter.java, regarding the JavaScript import. This solves problems with old Netscape Navigators, they insist on script .../script instead of script ... /. You find all files that I changed in the attached ZIP file. I included also a short example for the JavaScript function (Test_JavaScript.java). I hope that was not too confusing and you'll find the time to implement the changes. If you prefer other names/locations/programmings, please feel free to change whatever you want. I can update my code accordingly. By the way, I couldn't find out the difference between HtmlTags.java and MarkupTags.java. Both contain general and HTML-specific tags. Best Regards, Joachim -Original Message- From: Paulo Soares [mailto:[EMAIL PROTECTED]] Sent: 11 September 2002 13:29 To: Eyrich, Joachim; '[EMAIL PROTECTED]' Subject: RE: JavaScript Improvement I'll try to put it in the next release. Can you provide a small working example? Best Regards, Palo Soares -Original Message- From: Eyrich, Joachim [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 17:05 To: '[EMAIL PROTECTED]' Subject: JavaScript Improvement Hello Bruno, Hello Paulo, In my project I need HTML sites with some JavaScript in the header. I've seen that iText currently does not support that. Please find attached some iText files that I adapted to enable JavaScript, as well as a MS-Word document that shows all changes and includes a short example. I tried my best to integrate the new features into the iText architecture, but maybe it could be done better. I hope you find the time to look at it and maybe add it to the iText SourceForge project. Kind Regards, Joachim iText_JavaScript.zip iText_Anpassungen_JavaScript.doc File: iText_JavaScript.zipFile: iText_Anpassungen_JavaScript.doc File: iText_JavaScript.zip File: iText_JavaScript_Output.zip --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Encryption - links gone
This solution encrypts the document verbatim. If you are creating the document with pdflib why not placing the watermark there? Thats why I want to use iText: AFAIK, pdflib can't generate watermarks at all, only text with rendering parameters... Place the watermark with PdfWriter.getDirectContentUnder(). This layer is below all the others. I tried this too, but then the watermark wasn't transparent, either. Maybe I should try it with other images. Regards, Ralf If the objective is to encrypt the whole document it can be done with the class PdfEncryptor and all the links and fields are kept. Example usage: import com.lowagie.text.*; import com.lowagie.text.pdf.*; import java.io.*; public class encrypt_pdf { public static void main (String args[]) { System.out.println(PDF document encryptor); if (args.length 2) { System.out.println(usage: input_file output_file); return; } try { System.out.println(Reading + args[0]); PdfReader reader = new PdfReader(args[0]); System.out.println(Writing + args[1]); PdfEncryptor.encrypt(reader, new FileOutputStream(args[1]), null, null, 0, false); System.out.println(Done.); } catch (Exception e) { e.printStackTrace(); } } } Best Regards, Paulo Soares -Original Message- From: Bruno [SMTP:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 7:42 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject:Re: [iText-questions] Encryption - links gone Quoting Ralf Terdic [EMAIL PROTECTED]: Hi, I'm trying to encrypt a file generated by pdflib which contains some links. The encryption works well with the Encrypt.java example, but then the links are gone. How can I avoid this? You can't: for the moment this is not supported. Leonard Rosenthol is working on an iText version that will support this. Bruno --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Encryption - links gone
This solution encrypts the document verbatim. If you are creating the document with pdflib why not placing the watermark there? Thats why I want to use iText: AFAIK, pdflib can't generate watermarks at all, only text with rendering parameters... Place the watermark with PdfWriter.getDirectContentUnder(). This layer is below all the others. I tried this too, but then the watermark wasn't transparent, either. Maybe I should try it with other images. Regards, Ralf If the objective is to encrypt the whole document it can be done with the class PdfEncryptor and all the links and fields are kept. Example usage: import com.lowagie.text.*; import com.lowagie.text.pdf.*; import java.io.*; public class encrypt_pdf { public static void main (String args[]) { System.out.println(PDF document encryptor); if (args.length 2) { System.out.println(usage: input_file output_file); return; } try { System.out.println(Reading + args[0]); PdfReader reader = new PdfReader(args[0]); System.out.println(Writing + args[1]); PdfEncryptor.encrypt(reader, new FileOutputStream(args[1]), null, null, 0, false); System.out.println(Done.); } catch (Exception e) { e.printStackTrace(); } } } Best Regards, Paulo Soares -Original Message- From: Bruno [SMTP:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 7:42 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject:Re: [iText-questions] Encryption - links gone Quoting Ralf Terdic [EMAIL PROTECTED]: Hi, I'm trying to encrypt a file generated by pdflib which contains some links. The encryption works well with the Encrypt.java example, but then the links are gone. How can I avoid this? You can't: for the moment this is not supported. Leonard Rosenthol is working on an iText version that will support this. Bruno --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] Encryption - links gone
-Original Message- From: Ralf Terdic [SMTP:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 10:21 To: [EMAIL PROTECTED] Subject: Re: [iText-questions] Encryption - links gone This solution encrypts the document verbatim. If you are creating the document with pdflib why not placing the watermark there? Thats why I want to use iText: AFAIK, pdflib can't generate watermarks at all, only text with rendering parameters... Of course it can. Place the watermark with PdfWriter.getDirectContentUnder(). This layer is below all the others. I tried this too, but then the watermark wasn't transparent, either. Maybe I should try it with other images. What kind of effect are you trying to achieve? Best Regards, Paulo Soares Regards, Ralf If the objective is to encrypt the whole document it can be done with the class PdfEncryptor and all the links and fields are kept. Example usage: import com.lowagie.text.*; import com.lowagie.text.pdf.*; import java.io.*; public class encrypt_pdf { public static void main (String args[]) { System.out.println(PDF document encryptor); if (args.length 2) { System.out.println(usage: input_file output_file); return; } try { System.out.println(Reading + args[0]); PdfReader reader = new PdfReader(args[0]); System.out.println(Writing + args[1]); PdfEncryptor.encrypt(reader, new FileOutputStream(args[1]), null, null, 0, false); System.out.println(Done.); } catch (Exception e) { e.printStackTrace(); } } } Best Regards, Paulo Soares -Original Message- From: Bruno [SMTP:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 7:42 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject:Re: [iText-questions] Encryption - links gone Quoting Ralf Terdic [EMAIL PROTECTED]: Hi, I'm trying to encrypt a file generated by pdflib which contains some links. The encryption works well with the Encrypt.java example, but then the links are gone. How can I avoid this? You can't: for the moment this is not supported. Leonard Rosenthol is working on an iText version that will support this. Bruno --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Encryption - links gone
Thats why I want to use iText: AFAIK, pdflib can't generate watermarks at all, only text with rendering parameters... Of course it can. I haven't found anything in the documentation. Maybe you give me a hint? What kind of effect are you trying to achieve? I try to get something like Demo version on the page, but it should be transparent, i.e. I want to be able to see text and graphics through it. Thanks a lot Best Regards, Ralf --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Encryption - links gone
I try to get something like Demo version on the page, but it should be transparent, i.e. I want to be able to see text and graphics through it. I still dont understand what you want. Can you direct me to an example? I want a watermark on the page - the purpose of this watermark would be to make obvious that this is just a demo version of the document. The full version doesn't have this watermark. But the watermark shouldn't cover things in the document, it should be transparent. My tests showed that it can't be done with images, the watermark either covers the images (non-transparently) or is covered by them. Maybe I'm wrong.. TIA, Ralf --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] Encryption - links gone
What I don't understand is what should be transparent. Do you want black text opaque letters over the page? Best Regards, Paulo Soares -Original Message- From: Ralf Terdic [SMTP:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 10:43 To: Paulo Soares; [EMAIL PROTECTED] Subject: Re: [iText-questions] Encryption - links gone I try to get something like Demo version on the page, but it should be transparent, i.e. I want to be able to see text and graphics through it. I still dont understand what you want. Can you direct me to an example? I want a watermark on the page - the purpose of this watermark would be to make obvious that this is just a demo version of the document. The full version doesn't have this watermark. But the watermark shouldn't cover things in the document, it should be transparent. My tests showed that it can't be done with images, the watermark either covers the images (non-transparently) or is covered by them. Maybe I'm wrong.. TIA, Ralf --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] New release itext-paulo-103
Changes in itext-paulo-103 (2002-09-23) - added bidirectional support in ColumnText and PdfPTable for arabic and hebrew. Even with plain text the line splitting is improved. Hyphenation and CID addressed CJK fonts support were temporarily removed. - added support for ICC color profiles in images. Contribution by Phillip Pan. - added javascript support for html. Contribution by Joachim Eyrich. - fixed a bug in Graphic.drawBorder(). - imported pdf documents are closed even if an exception is thrown. - fixed a bug in CCITTG4Encoder. Some bit sequences threw an exception. - cjkfonts.properties and cjkencodings.properties are now together with the afm. - added transition support for pdf. Contribution by Josselin PUJO. - fixed the missing bookmarks in jdk 1.2. - improved suport for WMF. All this at: http://www.geocities.com/itextpdf Best Regards, Paulo Soares --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Encryption - links gone
At 11:20 AM +0200 9/23/02, Ralf Terdic wrote: Thats why I want to use iText: AFAIK, pdflib can't generate watermarks at all, only text with rendering parameters... That is NOT true. Check the pdflib documentation again... Place the watermark with PdfWriter.getDirectContentUnder(). This layer is below all the others. I tried this too, but then the watermark wasn't transparent, either. Maybe I should try it with other images. Or perhaps you misunderstand what you are thinking about with transparency vs. clipping masking. Can you post a sample? Leonard -- --- Leonard Rosentholmailto:[EMAIL PROTECTED] Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-629-3700 (voice) 215-629-0789 (fax) --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions