RE: [iText-questions] Need to strip all XMP metadata when using PdfCopy
This should work. Use PdfStamper to get the result out. import java.io.*; import java.awt.Color; import com.lowagie.text.*; import com.lowagie.text.pdf.*; import java.util.*; public class metadata { public static void main(String[] args) { try { PdfReader reader = new PdfReader(C:\\downloads\\XMP_for_CreativePros2004.pdf); removeMetadata(reader); } catch(Exception de) { de.printStackTrace(); } } public static void removeMetadata(PdfReader reader) { boolean hits[] = new boolean[reader.getXrefSize()]; removeMetadataNode(reader.getTrailer(), hits); hits = null; reader.removeUnusedObjects(); } private static void removeMetadataNode(PdfObject obj, boolean hits[]) { if (obj == null) return; switch (obj.type()) { case PdfObject.DICTIONARY: case PdfObject.STREAM: { PdfDictionary dic = (PdfDictionary)obj; for (Iterator it = dic.getKeys().iterator(); it.hasNext();) { PdfName key = (PdfName)it.next(); if (key.equals(PdfName.METADATA)) { System.out.println(Metadata found); it.remove(); continue; } PdfObject v = dic.get(key); removeMetadataNode(v, hits); } break; } case PdfObject.ARRAY: { ArrayList list = ((PdfArray)obj).getArrayList(); for (int k = 0; k list.size(); ++k) { PdfObject v = (PdfObject)list.get(k); removeMetadataNode(v, hits); } break; } case PdfObject.INDIRECT: { PRIndirectReference ref = (PRIndirectReference)obj; int num = ref.getNumber(); if (!hits[num]) { hits[num] = true; removeMetadataNode(PdfReader.getPdfObject(ref), hits); } } } } } -Original Message- From: Greg Sabatino [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 10:06 PM To: Paulo Soares Subject: Re: [iText-questions] Need to strip all XMP metadata when using PdfCopy Thanks for that reply Paulo. I know that you are busy and I appreciate your answering me. I am a novice when it comes to pdf processing and have found iText to be terrific so far. You and Bruno have done some excellent work! I am hoping that I can ask you to take one more look at this. I looked at PdfReader.removeUnusedObjects() and came up with the code below. It doesn't seem to find any streams or Metadata embedded in an example pdf file found at http://www.adobe.com/products/xmp/pdfs/XMP_for_CreativePros2004.pdf What did I miss? Thanks again, Greg Sabatino public void removeMetadata(PdfReader reader) { removeMetadataNode(reader.getTrailer()); reader.removeUnusedObjects(); } private void removeMetadataNode(PdfObject obj) { if (obj == null) return; System.out.println(*Looking at obj + obj); if(obj.isDictionary() || obj.isStream()){ System.out.println(*Looking for metadata.* + obj); PdfDictionary dic = (PdfDictionary)obj; if(dic.contains(PdfName.METADATA)) System.out.println(*Found metadata.*); dic.remove(PdfName.METADATA); for (Iterator it = dic.getKeys().iterator(); it.hasNext();) { PdfName key = (PdfName)it.next(); System.out.println(Key + key); PdfObject v = dic.get(key); removeMetadataNode(v); } } } On Apr 12, 2005, at 11:50 AM, Paulo Soares wrote: That's quite easy. Look at the source of PdfReader.removeUnsusedObjects() and get what you need to reach all the pdf objects. If the PdfObject is a dictionary or a prstream use remove(PdfName.METADATA). Finally to clean up what was removed call PdfReader.removeUnsusedObjects(). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Sabatino Sent: Tuesday, April 12, 2005 4:27 PM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] Need to strip all XMP metadata when using PdfCopy Hello, I am using PdfCopy to copy existing pdf's but need a way to positively remove any XMP metadata. As a first attempt I am using reader.getCatalog().remove(PdfName.METADATA) prior to creating a new Document using the reader. This seems to work just fine but I see in the PDF spec that XMP metadata can be contained in any components that are represented as a stream or dictionary. Does anyone know if there as a way to find and remove all
Re: [iText-questions] Help for the Newbie
wrote: Hi, There! Hi, there! Im a just beginner in iText. Id like to read and write the metadata in pdf files. But Im afraid I cannot do this. I dont know how to do and begin. PdfReader/PdfStamper I have read the tutorial and test it. But it has some problems. It's under construction. Can anyone give some general source for it? And when do I see the Part V : Reading, encrypting, Manipulating PDF files? Writing a tutorial takes a lot of time. Please be patient. This is a very old page: http://www.lowagie.com/iText/tutorial/ch13.html It won't tell you all you need, but it's a start. Another option is to go to the API docs. For instance: http://itext.sourceforge.net/docs/com/lowagie/text/pdf/PdfEncryptor.html br, Bruno --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Question about language
Hi all, I'm signing a PDF document with iText libraries. After signing it, I can read the information in the PDF document itself because the sign is visible. The question is if I can choose the language in which that information isstored in PDF document when you sign itbecause if I sign through Adobe Acrobat I can see it in Spanish but if I do it with iText it is shown in English. Thanks in advance, Cristina
RE: [iText-questions] Help for the Newbie
http://article.gmane.org/gmane.comp.java.lib.itext.general/9891 It's also possible to do it in PdfStamper for existing PDFs. To read the metadata: PdfReader reader = ...; PdfDictionary catalog = reader.getCatalog(); PRStream metadata = (PRStream)PdfReader.getPdfObject(catalog.get(PdfName.METADATA)); if (metadata != null) { byte metabytes[] = PdfReader.getStreamBytes(metadata); } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ??? Sent: Wednesday, April 13, 2005 10:27 AM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] Help for the Newbie Hi, There! Hi, there! Im a just beginner in iText. Id like to read and write the metadata in pdf files. But Im afraid I cannot do this. I dont know how to do and begin. I have read the tutorial and test it. But it has some problems. Can anyone give some general source for it? And when do I see the Part V : Reading, encrypting, Manipulating PDF files? Thanks, hlk http://www.dreamwiz.com/ http://www.dreamwiz.com/ http://i.dreamwiz.com/img/n.gif http://i.dreamwiz.com/dw/ko/n.gif http://i.dreamwiz.com/img/ct/nws/1.gif [PC] - !! GO~ http://ebiz.dreamwiz.com/BIN/pl.cgi?page=mailcontentsave=100 http://tool.dreamwiz.com/pcmain http://i.dreamwiz.com/dw/ko/n.gif http://i.dreamwiz.com/img/wd/disk2123.gif [] 128M ! http://www.dreamwiz.com/dm/disk/dm_disk.htm http://mailchk.dreamwiz.com/cgi-bin/receive_check.cgi?sender= [EMAIL PROTECTED][EMAIL PROTECTED] il21.dreamwiz.com%3E[EMAIL PROTECTED] e.netkey=71a0d9f7bbbff0cb70eb66dbff687f20 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=ick ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] PDF Searching
The answer still applies. To seach the doc you need to extract first the text. - Original Message - From: John Kendall [EMAIL PROTECTED] To: itext-questions@lists.sourceforge.net Sent: Tuesday, April 12, 2005 6:23 PM Subject: RE: [iText-questions] PDF Searching From: Paulo Soares varioni at yahoo.com Subject: Re: PDF Searching iText can't help you there. There are some free tools that can extract text from pdfs like xpdf. Paolo Thanks for the reply, but I'm not sure if you understood what I wanted. I already have the document scanned into PDF format (I can supply a small part of it if you want) and although it is images it is text searchable (at least with acrobat). I do not need to extract text as such, just search the document and publish the single page where a match is found. Does your answer still apply? Many thanks John --- John Kendall john.kendall at eurostep.com wrote: I am considering using itext but I am not sure it can do what I want it to. I represent a voluntary historical society which publishes transcriptions of archives online (search.fibis.org). We want to publish digitised documents which the public can search as well. We currently have been donated some C19th directories which nave been scanned as a mono PDF - fully searchable. What I want to do is put that onto the site and allow people to search it with the relevant page being returned to user's browser - rather like what is done at www.historicaldirectories.org. Is this going to be possible with itext. Any advice gratefully received. Thanks John John Kendall http://www.jkaywebdesign.com http://www.kendall-family.org http://www.indian-cemeteries.org Preserving information for future access --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=ick ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Need to strip all XMP metadata when using PdfCopy
At 11:27 AM 4/12/2005, Greg Sabatino wrote: Hello, I am using PdfCopy to copy existing pdf's but need a way to positively remove any XMP metadata. Why? Are you also clearing the DocInfo fields as well? This seems to work just fine but I see in the PDF spec that XMP metadata can be contained in any components that are represented as a stream or dictionary. Correct. However, AFAIK, the only common location for it is on image dictionaries. Does anyone know if there as a way to find and remove all those metadata streams if they exist anywhere in the document? Thanks, Greg You can do it with our PDF Enhancer product (http://www.pdfenhancer.com). It is possible using iText - but it requires walking the object tree and looking for the XMP key... But again - why would you want to do this?!?! Leonard --- Leonard Rosentholmailto:[EMAIL PROTECTED] Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-938-7080 (voice) 215-938-0880 (fax) --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] PDF Searching
Paulo Thanks for the confirmation. I thought it was going to be so easy, it looks so simple when you use Acrobat! I assume that Adobe's PDF Library will have the right functionality, but I suspect it is too expensive for a small volunteer effort such as us. Signing off now. Best regards John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paulo Soares Sent: 12 April 2005 20:55 To: [EMAIL PROTECTED]; itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] PDF Searching The answer still applies. To seach the doc you need to extract first the text. - Original Message - From: John Kendall [EMAIL PROTECTED] To: itext-questions@lists.sourceforge.net Sent: Tuesday, April 12, 2005 6:23 PM Subject: RE: [iText-questions] PDF Searching From: Paulo Soares varioni at yahoo.com Subject: Re: PDF Searching iText can't help you there. There are some free tools that can extract text from pdfs like xpdf. Paolo Thanks for the reply, but I'm not sure if you understood what I wanted. I already have the document scanned into PDF format (I can supply a small part of it if you want) and although it is images it is text searchable (at least with acrobat). I do not need to extract text as such, just search the document and publish the single page where a match is found. Does your answer still apply? Many thanks John --- John Kendall john.kendall at eurostep.com wrote: I am considering using itext but I am not sure it can do what I want it to. I represent a voluntary historical society which publishes transcriptions of archives online (search.fibis.org). We want to publish digitised documents which the public can search as well. We currently have been donated some C19th directories which nave been scanned as a mono PDF - fully searchable. What I want to do is put that onto the site and allow people to search it with the relevant page being returned to user's browser - rather like what is done at www.historicaldirectories.org. Is this going to be possible with itext. Any advice gratefully received. Thanks John John Kendall http://www.jkaywebdesign.com http://www.kendall-family.org http://www.indian-cemeteries.org Preserving information for future access --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: RE: RE: [iText-questions] Bug with List/Paragraph/ColumnText ?
Sorry, but you just told me that ColumnText doesn't support lists inside paragraphs. My paragraphs contain text, images and text with background-images, because I need setKeepTogether(). You helped me a lot to align the background-image vertically with the text [setGenericTag, getDirectContentUnder().addImage()]. Now I need to find out how to move the text horizontally to any position I want. I need to move the text, not the image. Using ct.setFollowingIndent() is no option. I just want to label images at exact, configurable positions. Is there a recommended way to achieve this? Best regards, Andreas Meyer You can have the same result with a list and a chunk with image as the symbol. -Original Message- From: Andreas Meyer [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 4:45 AM To: Paulo Soares Cc: itext-questions@lists.sourceforge.net Subject: Re: RE: [iText-questions] Bug with List/Paragraph/ColumnText ? Hmmm, bad luck. Is there another way to get a substitution for new Chunk(String content, Font font, float offsetX) ? Please have a look at my posting named Re: Re: Question/Problem with mailing list? from 2005-04-09 17:52:49 GMT to see what I want to achieve. Best regards, Andreas Meyer That's by design. ColumnText doesn't support lists or tables inside paragraphs. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas Meyer Sent: Monday, April 11, 2005 1:43 AM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] Bug with List/Paragraph/ColumnText ? Hi, I have tried to get something that works like new Chunk(String content, Font font, float offsetX) using a list, containing a single line of text. But if I add the list to a paragraph and the paragraph to columntext, the output is broken. try { PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(List_test.pdf)); document.open(); PdfContentByte cb = writer.getDirectContent(); ColumnText ct = new ColumnText(cb); ct.setSimpleColumn(50, 50, 800, 800); Paragraph p1 = new Paragraph(); List list = new List(true, 20); list.add(new ListItem(First line)); list.add(new ListItem(The second)); list.add(new ListItem(Third line)); p1.add(list); ct.addElement(p1); ct.go(); } Looks like a bug ? --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Text box with iText
Hi all I'm quite new to iText, but I'm impressed by its speed and rich set of features. (Thanks Bruno and Paulo) I need to place text boxes within a PDF file like this: - | Here some text... | - These text boxes might have a border (top, bottom, right and left part of the border might have a different width), a border color, a text color, a background color and of course can be placed at an absolute position. What would be the best way to draw such text boxes? By using a table with only one cell? Or by painting 4 lines, a spotcolor (for the background) and some text above it? The problem is that the text should not become larger than the box. Thanks in advance for any hint on that. Christian --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Image spacing (alignment?) issue
I've got a paragraph that I'm adding to a PdfPCell. The image I'm adding is displaying over the text before it. This happens with or without the image alignment set. I've checked the tutorials and docs, but I'm still stuck. How can I get a Chunk with an image to honor its place in a paragraph? Image checkboxOpenImage = Image.getInstance(checkbox-open.jpg); checkboxOpenImage.scalePercent(18); checkboxOpenImage.setAlignment(Image.LEFT|Image.TEXTWRAP); Paragraph quest1 = new Paragraph(1., FontFactory.getFont(FontFactory.HELVETICA, 10, Font.NORMAL, Color.black)); quest1.add(new Phrase(b. )); quest1.add(new Chunk(checkboxOpenImage, 0, 0)); quest1.add(new Phrase( Requested ...)); --- Confidentiality Notice This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential or proprietary information which is legally privileged. Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, please promptly contact the sender by reply e-mail and destroy all copies of the original message. --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Text box with iText
Christian Hauser wrote: I need to place text boxes within a PDF file like this: - | Here some text... | - These text boxes might have a border (top, bottom, right and left part of the border might have a different width), a border color, a text color, a background color and of course can be placed at an absolute position. What would be the best way to draw such text boxes? By using a table with only one cell? Or by painting 4 lines, a spotcolor (for the background) and some text above it? The problem is that the text should not become larger than the box. What is more important to you, the width of the box or the width of the text? With PdfPTable, you will define the width of the table and add text to a cell. The text will be wrapped and the height of your box will increase. If you don't want the text to wrap (but everything on a single line), you will have to measure the text and draw a rectangle based on the results. ( http://itext.sourceforge.net/tutorial/fonts/styles/index.html#measuring and http://itext.sourceforge.net/tutorial/directcontent/graphics/index.html#paths ) Using a Chunk with a generic page event would be easiest way to achieve this (http://itext.sourceforge.net/tutorial/objects/chunk/index.html#generic), but I don't recall a method that allows you to add a Chunk at absolute positions (Or you would have to use ColumnText, but then again you need to define the width of the column in advance). br, Bruno --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
RE: [iText-questions] Need to strip all XMP metadata when using PdfCopy
That's quite easy. Look at the source of PdfReader.removeUnsusedObjects() and get what you need to reach all the pdf objects. If the PdfObject is a dictionary or a prstream use remove(PdfName.METADATA). Finally to clean up what was removed call PdfReader.removeUnsusedObjects(). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Sabatino Sent: Tuesday, April 12, 2005 4:27 PM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] Need to strip all XMP metadata when using PdfCopy Hello, I am using PdfCopy to copy existing pdf's but need a way to positively remove any XMP metadata. As a first attempt I am using reader.getCatalog().remove(PdfName.METADATA) prior to creating a new Document using the reader. This seems to work just fine but I see in the PDF spec that XMP metadata can be contained in any components that are represented as a stream or dictionary. Does anyone know if there as a way to find and remove all those metadata streams if they exist anywhere in the document? Thanks, Greg --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] tiff2pdf and pdf2tiff
Hi, we need to do both of these things. The tiff2pdf works for the most part... just grabbed some sample code of the web site: public void testTiff2PdfTest() { //String tiffFile = rootDir+crl2688.tif; String tiffFile = rootDir+400dpiCCITTGroup4.tif; String pdfFile = rootDir+pdfer.pdf; Document document = new Document(); try { PdfWriter.getInstance(document, new FileOutputStream(pdfFile)); document.setMargins( 0f, 0f, 0f, 0f); document.open(); Image tiff = Image.getInstance(tiffFile); tiff.scalePercent(18); document.add(tiff); } catch(DocumentException de) { System.err.println(de.getMessage()); } catch(IOException ioe) { System.err.println(ioe.getMessage()); } document.close(); } The only problem is that it only grabs the first page of the tiff. Does anyone know how I can grab the second page of the tiff? Also, it seems it would be easy to go from pdf2tiff, but I can't seem to grasp it. Is this possible with itext? If not, can someone refer me to a good open source library that does? Thanks, Ben --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] tiff2pdf and pdf2tiff
actually I tried using the Tiff2Pdf tool: public void testTiff2PdfTest() { String tiffFile = rootDir+400dpiCCITTGroup4.tif; String pdfFile = rootDir+pdfer.pdf; Tiff2Pdf.main(new String[] {tiffFile, pdfFile}); } This works, but the top margin is way too big and the filename is being put at the top of the page (which makes is not acceptable for us). Is there any way to control these things? I'll grab the source and see how it's done. Thanks, Ben On 4/13/05, bruno [EMAIL PROTECTED] wrote: Ben Anderson wrote: The only problem is that it only grabs the first page of the tiff. Does anyone know how I can grab the second page of the tiff? Try the Tiff2Pdf tool in this JWS app: www.lowagie.com/iText/itext.jnlp The code can be found in package com.lowagie.tools.plugins Also, it seems it would be easy to go from pdf2tiff, but I can't seem to grasp it. Is this possible with itext? No, iText doesn't generate TIFF. br, Bruno --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] tiff2pdf and pdf2tiff
Ben Anderson wrote: The only problem is that it only grabs the first page of the tiff. Does anyone know how I can grab the second page of the tiff? Try the Tiff2Pdf tool in this JWS app: www.lowagie.com/iText/itext.jnlp The code can be found in package com.lowagie.tools.plugins Also, it seems it would be easy to go from pdf2tiff, but I can't seem to grasp it. Is this possible with itext? No, iText doesn't generate TIFF. br, Bruno --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] tiff2pdf and pdf2tiff
Ben Anderson wrote: actually I tried using the Tiff2Pdf tool: public void testTiff2PdfTest() { String tiffFile = rootDir+400dpiCCITTGroup4.tif; String pdfFile = rootDir+pdfer.pdf; Tiff2Pdf.main(new String[] {tiffFile, pdfFile}); } This works, but the top margin is way too big and the filename is being put at the top of the page (which makes is not acceptable for us). Is there any way to control these things? Yes, there is. If you choose 'original' as pagesize in the JWS app, the PDF pages have the same size as the TIFF pages. Remark that you are probably looking at the 1.3 code. For the JWS app, I am already using new code (you'll find the complete javafile in the CVS repository): for (int c = 0; c comps; ++c) { Image img = TiffImage.getTiffImage(ra, c + 1); if (img != null) { if (adjustSize) { document.setPageSize(new Rectangle(img.scaledWidth(), img.scaledHeight())); document.newPage(); img.setAbsolutePosition(0, 0); } else { if (img.scaledWidth() 500 || img.scaledHeight() 700) { img.scaleToFit(500, 700); } img.setAbsolutePosition(20, 20); document.newPage(); document.add(new Paragraph(tiff_file + - page + (c + 1))); } cb.addImage(img); System.out.println(Finished page + (c + 1)); } } Create your Document with the size of the first page in the tiff. Then change the pageSize for every new page BEFORE you trigger a newPage(). br, Bruno --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Need to strip all XMP metadata when using PdfCopy
At 12:30 PM 4/12/2005, Greg Sabatino wrote: Thanks for the quick response. I need to suppress this information because we handle peer-reviewed documents. The evaluators must remain anonymous and sometimes there is need to send their evaluations back to a submitting author. Ah... So you also deal with removing the commenter's name from all the included annotations as well? On occasion the evaluator's name will appear in XMP data that has been included unwittingly so we need to remove this data before it gets forwarded. It won't appear in object metadata...That's for stuff like image data (IPTC, EXIF, etc.) The original author's name might - but you don't seem to care about that. I have to tell you that I am fairly new to processing pdf docs as well as the proper use of iText so I am not quite sure of how to walk the object tree and search for XMP streams in a comprehensive way. Is there an example of this someplace? No samples that I know of - sorry. Leonard --- Leonard Rosentholmailto:[EMAIL PROTECTED] Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-938-7080 (voice) 215-938-0880 (fax) --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] Need to strip all XMP metadata when using PdfCopy
Leonard, Thanks for the quick response. I need to suppress this information because we handle peer-reviewed documents. The evaluators must remain anonymous and sometimes there is need to send their evaluations back to a submitting author. On occasion the evaluator's name will appear in XMP data that has been included unwittingly so we need to remove this data before it gets forwarded. I am resetting the metadata in the DocInfo fields as shown in the iText examples so this isn't a problem - but I thank you for bringing it up! I have to tell you that I am fairly new to processing pdf docs as well as the proper use of iText so I am not quite sure of how to walk the object tree and search for XMP streams in a comprehensive way. Is there an example of this someplace? Thanks, Greg On Apr 12, 2005, at 5:48 PM, Leonard Rosenthol wrote: At 11:27 AM 4/12/2005, Greg Sabatino wrote: Hello, I am using PdfCopy to copy existing pdf's but need a way to positively remove any XMP metadata. Why? Are you also clearing the DocInfo fields as well? This seems to work just fine but I see in the PDF spec that XMP metadata can be contained in any components that are represented as a stream or dictionary. Correct. However, AFAIK, the only common location for it is on image dictionaries. Does anyone know if there as a way to find and remove all those metadata streams if they exist anywhere in the document? Thanks, Greg You can do it with our PDF Enhancer product (http://www.pdfenhancer.com). It is possible using iText - but it requires walking the object tree and looking for the XMP key... But again - why would you want to do this?!?! Leonard --- Leonard Rosenthol mailto:[EMAIL PROTECTED] Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-938-7080 (voice) 215-938-0880 (fax) --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Question about language
Hi all, I'm signing a PDF document with iText libraries. After signing it, I can read the information in the PDF document itself because the sign is visible. The question is if I can choose the language in which that information isstored in PDF document when you sign itbecause if I sign through Adobe Acrobat I can see it in Spanish but if I do it with iText it is shown in English. Thanks in advance, Cristina
Re: [iText-questions] tiff2pdf and pdf2tiff
At 09:04 AM 4/13/2005, Ben Anderson wrote: Also, it seems it would be easy to go from pdf2tiff, but I can't seem to grasp it. Is this possible with itext? No, it is not. If not, can someone refer me to a good open source library that does? JPEDAL - http://www.jpedal.org Leonard --- Leonard Rosentholmailto:[EMAIL PROTECTED] Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-938-7080 (voice) 215-938-0880 (fax) --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Help for the Newbie
Hi, There! Hi, there! Im a just beginner in iText. Id like to read and write the metadata in pdf files. But Im afraid I cannot do this. I dont know how to do and begin. I have read the tutorial and test it. But it has some problems. Can anyone give some general source for it? And when do I see the Part V : Reading, encrypting, Manipulating PDF files? Thanks, hlk http://www.dreamwiz.com/ [PC] - !! GO~ [] 128M! --- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95_id396=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] How to fit an image in a table cell for an .rtf document
I am creating an rtf document with iText, it contains a table with a mixture of text and picture cells, I am having two problems: 1) I cannot seem to get an image in a cell using a byte array. See commented call to getPicture() below. 2) if I load a picture in via a url it doesn't size to fit the cell I am adding it to, is there a way to do this? This is an example of the type of table I am trying to write to an rtf document: (Embedded image moved to file: pic05436.pcx) I want the image to size to fit the number of cells it is given to span across. Table table = null; // get cell from the jtable Object contents = jtable.getValueAt(r, c); if (contents != null) { // get record the span info spanDetails = tableModel.getCellAttribute().getSpan(r, c); spanHeight = spanDetails[0]; spanWidth = spanDetails[1]; // ... else if (contents instanceof PictureCell) { Image image = null; try { // load an image via a url (this loads but it's too big) image = Image.getInstance(C:\\Documents and Settings\\VBrown\\My Documents\\My Pictures\\cloud.jpg); // load an image via a byte array (doesn't work) //image = Image.getInstance(getPicture((PictureCell)contents)); } cell = new Cell(image); } table.addCell(cell); } } } doc.add(table); private byte[] getPicture(PictureCell cell) { PictureHolder objPicHolder = (PictureHolder) cell.getContent(); java.awt.Image objContentAsImage = objPicHolder.getImage(); BufferedImage bufferedImage = new BufferedImage(objContentAsImage.getWidth(null), objContentAsImage.getHeight(null),BufferedImage.TYPE_INT_RGB); Graphics graphics = bufferedImage.createGraphics(); ByteArrayOutputStream stream = new ByteArrayOutputStream(); graphics.drawImage(objContentAsImage, 0, 0, objContentAsImage.getWidth(null), objContentAsImage.getHeight(null), null); try { ImageIO.write(bufferedImage, png, stream); } catch (Throwable e) { e.printStackTrace(); } byte[] abytImage = stream.toByteArray(); return abytImage; } Any help would be greatly appreciated. Victoria Brown [EMAIL PROTECTED] Join IDBS' webinars for the latest information on our new software for drug discovery. Don't miss this opportunity for convenient, bite-sized views of how we can help you be more effective and efficient in your research. http://www.idbs.com/webinar * The information contained in this email may contain confidential or legally privileged information. If you are not the intended recipient any disclosure, copying, distribution or taking any action on the contents of this information may be unlawful. If you have received this email in error, please delete it from your system and notify us immediately. Any views expressed in this message are those of the individual sender, except where the message states otherwise. IDBS takes no responsibility for any computer virus which might be transferred by way of this email and recommends that you subject any incoming E-mail to your own virus checking procedures. We may monitor all E-mail communication through our networks. If you contact us by E-mail, we may store your name and address to facilitate communication. * pic05436.pcx Description: Binary data
RE: [iText-questions] Question about language
You can sign it in any language as long as you provide the text. See PdfSignatureAppearance.setLayer2Text() and PdfSignatureAppearance.setLayer4Text(). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Barrantes Snchez, Cristina Sent: Wednesday, April 13, 2005 11:14 AM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] Question about language Hi all, I'm signing a PDF document with iText libraries. After signing it, I can read the information in the PDF document itself because the sign is visible. The question is if I can choose the language in which that information is stored in PDF document when you sign it because if I sign through Adobe Acrobat I can see it in Spanish but if I do it with iText it is shown in English. Thanks in advance, Cristina --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Pdf generation using IText..
Hi , i am working on current project and i am able to generating PDF 's on tomcat perfectly and when i am deploying on Orcale 9I AS server the pdf report is not coming i have to deleivery i apperciate any help regarding this .. ramaraju, [EMAIL PROTECTED]No banners. No pop-ups. No kidding.Make My Way your home on the Web - http://www.myway.com
RE: [iText-questions] Pdf generation using IText..
If it's not a classpath problem you'll have to recompile iText with your java version. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of j v ramaraju Sent: Wednesday, April 13, 2005 4:20 PM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] Pdf generation using IText.. Hi , i am working on current project and i am able to generating PDF 's on tomcat perfectly and when i am deploying on Orcale 9I AS server the pdf report is not coming i have to deleivery i apperciate any help regarding this .. ramaraju, [EMAIL PROTECTED] No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] EPS as output format
Hi all As far as I see from the documentation, it's not only possible to produce pdf-output with itext but there are also writers for rtf- and html-output. Are there plans (or are there already drivers) to support other outputformats too? I'm especially interested in eps-output. Is there someting like PDFGraphics2D for other formats? (RTFGraphics2D, EPSGraphics2D, ...) Kind Regards Matthias Dillier This message is for information purposes only. It may not be secure or error-free. The Swiss National Bank does not accept legal responsibility for any consequences resulting from e-mail use. --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] RtfWriter2 Update
Hi Bugfix for the RtfWriter2: * Fixed an IndexOutOfBoundsException in the row handling code. Greetings, Mark -- Computers don't actually think. You just think they think. (We think.) My GPG public key is available at: http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc pgpvUIGlONiiI.pgp Description: PGP signature
Re: [iText-questions] EPS as output format
At 11:37 AM 4/13/2005, [EMAIL PROTECTED] wrote: Are there plans (or are there already drivers) to support other outputformats too? Nothing at this time... I'm especially interested in eps-output. Why not create the PDF and then convert it to EPS? Leonard --- Leonard Rosentholmailto:[EMAIL PROTECTED] Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-938-7080 (voice) 215-938-0880 (fax) --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] EPS as output format
How hard do you think it'd be to convert something pdf2ps (from the ghostscript package) to dump out the generated PDF as PS? Leonard Rosenthol wrote: At 11:37 AM 4/13/2005, [EMAIL PROTECTED] wrote: Are there plans (or are there already drivers) to support other outputformats too? Nothing at this time... I'm especially interested in eps-output. Why not create the PDF and then convert it to EPS? Leonard --- Leonard Rosentholmailto:[EMAIL PROTECTED] Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-938-7080 (voice) 215-938-0880 (fax) --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions -- cheeser You can find my blog at http://cheeser.blog-city.com and on AIM as evan chooly --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
Re: [iText-questions] EPS as output format
At 07:16 AM 4/13/2005, Justin Lee wrote: How hard do you think it'd be to convert something pdf2ps (from the ghostscript package) to dump out the generated PDF as PS? Well, the obvious issue is that GS can only be called from the command line and with files - but assuming those are acceptable limitations AND that you meet the licensing requirements for GS - it should be fine. LDR --- Leonard Rosentholmailto:[EMAIL PROTECTED] Chief Technical Officer http://www.pdfsages.com PDF Sages, Inc. 215-938-7080 (voice) 215-938-0880 (fax) --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions
[iText-questions] Laoding DGN Drawings File onto PDF
Hi, We are loading images into pdf using Image class if itext API reading image as byte array from table and is working great for JPG,GIF,TIF. Image pdfImage = Image.getInstance(imgbytes); Now we want to load DGN files onto PDF. The above code is not recognizing the format of DGN Drawings File. Is there any other way of loading DGN files onto PDF using ITEXT Java API. Any help on this is appreciated. Thanks, Ravi.k. -Original Message- From: Paulo Soares [mailto:[EMAIL PROTECTED] Sent: Saturday, April 09, 2005 6:42 PM To: Kandula, Ravi Subject: Re: Water mark Chopping the borders of a table Table doesn't work with Watermark. Use a PdfPTable or put the image in an onStartPage() event in PdfWriter.getDirectContentUnder(). - Original Message - From: Kandula, Ravi [EMAIL PROTECTED] To: Paulo Soares [EMAIL PROTECTED] Sent: Tuesday, April 05, 2005 7:43 PM Subject: Water mark Chopping the borders of a table Hi Paulo, I am using itext as a api for generating pdf reports from java application. We had tables with borders on the report. These are working fine up until now. We added a water mark onto the document and it is chopping off the borders of the tables where ever it is drawn on the page. Is there any thing I had to do inorder to overcome this problem. If so please let me know, as this is so important that we are waiting only for this to move application into production. Here is the code I am using to add water mark and table to document. Document document = new Document(); Watermark w = new Watermark(Image.getInstance(/img/dot_seal_bw.jpg), 150, 280); document.add(w); document.open(); Table atable = new Table(3); atable.setBorderWidth(1); atable.setPadding(2); atable.setBorderColor(new Color(0,0,255)); atable.setWidth(100.f); atable.addCell(new Phrase([X] MUTCD 6-TYPICAL APPLICATION PLAN, fontfac3)) atable.addCell(new Phrase([X] DETAILED TRAFFIC CONTROL PLAN (ATTACHED), fontfac3)); atable.addCell(new Phrase([ ] COMBINATION TYPICAL APPLICATION DETAIL TRAFFIC CONTROL PLAN (ATTACHED), fontfac3)); document.add(atable); document.close(); Thanks, Ravi..k -Original Message- From: Paulo Soares [mailto:[EMAIL PROTECTED] Sent: Thursday, February 17, 2005 4:55 AM To: Kandula, Ravi Subject: RE: [iText-questions] Inserting text into pdf and create new one PdfStamper.addAnnotation() -Original Message- From: Kandula, Ravi [mailto:[EMAIL PROTECTED] Sent: Thursday, February 17, 2005 5:15 AM To: Paulo Soares Subject: RE: [iText-questions] Inserting text into pdf and create new one How can i add fields into a pdf template, could you please reply with any sample or atleast a way to do this. Thanks, Ravi From: Paulo Soares [mailto:[EMAIL PROTECTED] Sent: Fri 2/11/2005 5:47 PM To: Kandula, Ravi; itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] Inserting text into pdf and create new one For that to work you must have a pdf with a field named ENCROACHMENT. Do you? - Original Message - From: Kandula, Ravi [EMAIL PROTECTED] To: itext-questions@lists.sourceforge.net Sent: Friday, February 11, 2005 7:05 PM Subject: [iText-questions] Inserting text into pdf and create new one Hi, I am trying to read a template PDF file and replace the some tags with actual data and create a new pdf file using itext. I am using Acroform and acrofields for this. Below is the program I had written for accomplishing this. When I tried to the no of fields it gave me 0 and it is not changing value of tag. Is this the correct way of reading a template pdf using acroform. If so am I doing wrong any where. Any help on this would be appreciated. import java.io.FileOutputStream; import java.io.IOException; import com.lowagie.text.*; import com.lowagie.text.pdf.*; Import java.util.*; public class EncroachTemplate { public static void main(String[] args) { System.out.println(Starting to read pdf template and build new pdf); try { PdfReader reader = new PdfReader(c:/pdfwriter/General_Encroachment_Test.pdf ); PdfStamper stamp = new PdfStamper(reader, new FileOutputStream(Test.pdf)); AcroFields form = stamp.getAcroFields(); HashMap formfields = form.getFields(); System.out.println( No of fields +formfields.size() ); if(formfields.size0) //set the field values in the pdf form form.setField(ENCROACHMENT,TEST); stamp.setFormFlattening(true); stamp.close(); }catch(Exception e){System.out.println(Error: + e); } } } Thanks --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95alloc_id396op=ick ___ iText-questions