Re: [iText-questions] iText bug on PdfString encoding
The code that can reproduce the bug is attached. -Original Message- From: 1T3XT info [mailto:i...@1t3xt.info] Sent: 2009年2月4日 16:58 To: Post all your questions about iText here Subject: Re: [iText-questions] iText bug on PdfString encoding Yu Chen wrote: > In com.lowagie.text.pdf.PdfString.getBytes( ) method, iText first checks > if the characters in a string are contained in PdfDocEncoding character > set, if so, iText will not use the specified encoding but > TEXT_PDFDOCENCODING. This will cause applying wrong encoding to some > Unicode characters. > > e.g. U+00A0, which is 160 in dec, will be treated as ‘�’, because 160 is > ‘�’ in PdfDocEncoding character set. I don't understand the question, please provide an example that visualizes the alleged bug. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Sample.java Description: Sample.java -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] pdfimportedpages content disappears when using selectpages
I'm currently using a work-around to pdfstamp the document, then re-open it and select the pages. This works but seems unnecessarily inefficient On Wed, Feb 18, 2009 at 10:42 AM, Billy Anachronism wrote: > To give a little more information about what I'm doing: > > I was originally using pdfwriter to create a new pdf the same as the > original but with resized pages and some text underneath. This turned > out not to be the best option for me because I wanted to retain the > rotation of the pdf pages but use one algorithm to add the text. I > couldn't find out a way to re-correct the rotation with writer so I > decided to use stamper and reader so that I could: > > 1) remove the rotation pdfname > 2) resize and add text, then > 3) add a rotation pdfname > > This works fine but i end up with double the ammount of pages because > the original pages remain. > > im sure someone would have had to do this before. does anyone have a solution? > > On Wed, Feb 18, 2009 at 10:24 AM, billy anachronism > wrote: >> >> can anyone help? Sorry if the answer is trivial >> >> -- >> View this message in context: >> http://www.nabble.com/pdfimportedpages-content-disappears-when-using-selectpages-tp22048089p22068356.html >> Sent from the iText - General mailing list archive at Nabble.com. >> >> >> -- >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise >> -Strategies to boost innovation and cut costs with open source participation >> -Receive a $600 discount off the registration fee with the source code: SFAD >> http://p.sf.net/sfu/XcvMzF8H >> ___ >> iText-questions mailing list >> iText-questions@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/itext-questions >> >> Buy the iText book: http://www.1t3xt.com/docs/book.php >> > -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
[iText-questions] Concerning fields on PDF forms
Everyone, Can anyone help me figure out how to place fields on a PDF form in a particular tab order where some of those fields share the same datapoint name? To illustrate where I'm coming from, and perhaps preclude some to-and-fro, I have an extended multipart thought experiment. Consider a postcard with fields for a return address (FromName, FromStreet, FromCity), a destination address (ToName, ToStreet, ToCity), and the sender's name (SignedBy). My desired tab order is: FromName -> FromStreet -> FromCity -> ToName -> ToStreet -> ToCity -> SignedBy whereupon the tabbing repeats. Solving this is simple: Instantiate a TextField for each of these fields and write them to the document. The order you write these fields to the document shall be the tab order. Consider that SignedBy field. It holds the same information as FromName, and its stupid to ask for the same information twice. This is satisfied by two text fields named FromName near the upper left hand corner of the page and near the bottom of the page. This is less simple, but tractible: Instantiate "parent" PdfFormField that we'll name FromName and then instantiate "kid" TextField objects. You can use these kid objects' GetTextField() function to get a kid PdfFormField object to link to the parent via AddKid(). Then with parent and kids linked, we can write the parents to the document. This works except for the tab order: when we tab from the first kid of FromName, we want to jump to FromStreet, and when we tab from the second kid of FromName we'll want to jump to FromName's first kid. This doesn't happen. My experiments show that when I write the parent, FromName, it places both kids into the file at that time, resulting in the following tab order: FromName (top field) -> FromName (bottom field) -> FromStreet -> FromCity -> ToName -> ToStreet -> ToCity. But how can I tell iTextSharp to write FromName's first kid, then hold off on writing its second kid until after the field ToCity is written so as to preserve the desired tab order? Here's one thing I tried that (almost, but) doesn't work: Create all the kids, write them to the document in tab order. Link them to their parents. Write the parents to the document. You get all the fields in the desired tab order. But if you open the document and delve into its internals with the EnFocus low level PDF browser, you'll see there's duplication going on. The kids have been written to the document twice. This is kludgey, but it preserves tab order. I could live with this ugliness until I learned that Adobe Acrobat won't let you delete these fields, or in some versions dying horribly in the attempt. I did some searching and read Paolo's cryptic words that I only partially understood: You can change the tab order by changing the order that the fields appear in the annotation dictionary. Is this pertinent to my question? Can anybody point me to some sample code where this is done? Thanks in advance, I'm much obliged for all your help. smiles and cheers, steve poling grand rapids, MI -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF
Use "Arial Bold" as the font name instead of just "Arial" should do the trick... Leonard From: David Thielen [mailto:da...@windward.net] Sent: Tuesday, February 17, 2009 5:02 PM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF Ok, I know this is a dumb question but how do I do that under iText? Thanks - dave David Thielen 303-499-2544 x1185 720-352-0676 (cell) From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Tuesday, February 17, 2009 1:17 PM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF Don't use Font.BOLD - instead, pick the font manually. Leonard On 2/17/09 2:52 PM, "David Thielen" wrote: Hi; I understand that. The two probelems we are having are: We call FontFactory.getFont("Arial", baseFont.IDENTITY_H, true, 12.0, Font.BOLD); and the BaseFont it returns has a fontName of "Arial-BoldMT". So the first question is how can we set the font to Arial rather than ArialMT and Arial,Bold rather than Arial-BoldMT? Second, when I use the text touch up tool on my system, the same system that did the above conversion to ArialMT - it tells me it cannot find ArialMT and will use Arial instead. Si it's like iText does a name mapping that Acrobat cannot do? Third, when our customer goes to use the text touchup tool, she gets a message saying Acrobat cannot find a substitute font for the bold. It does do ok for the non-bold. ??? - thanks - dave David Thielen 303-499-2544 x1185 720-352-0676 (cell) From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Tuesday, February 17, 2009 4:43 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF Because the font specified in the PDF is "Arial-BoldMT" NOT "Arial Bold" - two different fonts... Leonard From: David Thielen [mailto:da...@windward.net] Sent: Tuesday, February 17, 2009 3:29 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Here you go. Acrobat ver 9 running on XP w/ SP-3. thank you - dave From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Mon 2/16/2009 11:14 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Please provide a sample PDF the demonstrates the problem. Also, what version of Acrobat is being used on what OS platform? Leonard From: David Thielen [mailto:da...@windward.net] Sent: Monday, February 16, 2009 12:00 PM To: itext Subject: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Hi; We're getting this issue from one of our customers. The PDFs we create use unicode for all text so all fonts are embedded. We build the PDF from a Word document. I open new document in Word. Add some text, choose Arial in the fonts dropdown list. Add an other line of text, choose Arial in the fonts dropdown list and select the "bold" button. Save the document as an RTF Create a PDF. Open the PDF in Acrobat Reader. The font types are now Arial-MT and Arial-BoldMT. And it are embedded subsets. When I open the PDF in Adobe Acrobat Professional, I can perfectly add some text to the default Arial text. When I want to add some text to the bold Arial text, I get an error message that the font is a subset and that no compatible system font can be found. Which is strange because I have ARIALBD.TTF in my Fonts folder. Any ideas? thanks - dave -- Leonard Rosenthol PDF Standards Architect Adobe Systems Incorporated -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] pdfimportedpages content disappears when using selectpages
To give a little more information about what I'm doing: I was originally using pdfwriter to create a new pdf the same as the original but with resized pages and some text underneath. This turned out not to be the best option for me because I wanted to retain the rotation of the pdf pages but use one algorithm to add the text. I couldn't find out a way to re-correct the rotation with writer so I decided to use stamper and reader so that I could: 1) remove the rotation pdfname 2) resize and add text, then 3) add a rotation pdfname This works fine but i end up with double the ammount of pages because the original pages remain. im sure someone would have had to do this before. does anyone have a solution? On Wed, Feb 18, 2009 at 10:24 AM, billy anachronism wrote: > > can anyone help? Sorry if the answer is trivial > > -- > View this message in context: > http://www.nabble.com/pdfimportedpages-content-disappears-when-using-selectpages-tp22048089p22068356.html > Sent from the iText - General mailing list archive at Nabble.com. > > > -- > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > ___ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.1t3xt.com/docs/book.php > -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] pdfimportedpages content disappears when using selectpages
can anyone help? Sorry if the answer is trivial -- View this message in context: http://www.nabble.com/pdfimportedpages-content-disappears-when-using-selectpages-tp22048089p22068356.html Sent from the iText - General mailing list archive at Nabble.com. -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF
Ok, I know this is a dumb question but how do I do that under iText? Thanks - dave David Thielen 303-499-2544 x1185 720-352-0676 (cell) From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Tuesday, February 17, 2009 1:17 PM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF Don't use Font.BOLD - instead, pick the font manually. Leonard On 2/17/09 2:52 PM, "David Thielen" wrote: Hi; I understand that. The two probelems we are having are: We call FontFactory.getFont("Arial", baseFont.IDENTITY_H, true, 12.0, Font.BOLD); and the BaseFont it returns has a fontName of "Arial-BoldMT". So the first question is how can we set the font to Arial rather than ArialMT and Arial,Bold rather than Arial-BoldMT? Second, when I use the text touch up tool on my system, the same system that did the above conversion to ArialMT - it tells me it cannot find ArialMT and will use Arial instead. Si it's like iText does a name mapping that Acrobat cannot do? Third, when our customer goes to use the text touchup tool, she gets a message saying Acrobat cannot find a substitute font for the bold. It does do ok for the non-bold. ??? - thanks - dave David Thielen 303-499-2544 x1185 720-352-0676 (cell) From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Tuesday, February 17, 2009 4:43 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF Because the font specified in the PDF is "Arial-BoldMT" NOT "Arial Bold" - two different fonts... Leonard From: David Thielen [mailto:da...@windward.net] Sent: Tuesday, February 17, 2009 3:29 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Here you go. Acrobat ver 9 running on XP w/ SP-3. thank you - dave From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Mon 2/16/2009 11:14 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Please provide a sample PDF the demonstrates the problem. Also, what version of Acrobat is being used on what OS platform? Leonard From: David Thielen [mailto:da...@windward.net] Sent: Monday, February 16, 2009 12:00 PM To: itext Subject: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Hi; We're getting this issue from one of our customers. The PDFs we create use unicode for all text so all fonts are embedded. We build the PDF from a Word document. I open new document in Word. Add some text, choose Arial in the fonts dropdown list. Add an other line of text, choose Arial in the fonts dropdown list and select the "bold" button. Save the document as an RTF Create a PDF. Open the PDF in Acrobat Reader. The font types are now Arial-MT and Arial-BoldMT. And it are embedded subsets. When I open the PDF in Adobe Acrobat Professional, I can perfectly add some text to the default Arial text. When I want to add some text to the bold Arial text, I get an error message that the font is a subset and that no compatible system font can be found. Which is strange because I have ARIALBD.TTF in my Fonts folder. Any ideas? thanks - dave -- Leonard Rosenthol PDF Standards Architect Adobe Systems Incorporated -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF
Don't use Font.BOLD - instead, pick the font manually. Leonard On 2/17/09 2:52 PM, "David Thielen" wrote: Hi; I understand that. The two probelems we are having are: We call FontFactory.getFont("Arial", baseFont.IDENTITY_H, true, 12.0, Font.BOLD); and the BaseFont it returns has a fontName of "Arial-BoldMT". So the first question is how can we set the font to Arial rather than ArialMT and Arial,Bold rather than Arial-BoldMT? Second, when I use the text touch up tool on my system, the same system that did the above conversion to ArialMT - it tells me it cannot find ArialMT and will use Arial instead. Si it's like iText does a name mapping that Acrobat cannot do? Third, when our customer goes to use the text touchup tool, she gets a message saying Acrobat cannot find a substitute font for the bold. It does do ok for the non-bold. ??? - thanks - dave David Thielen 303-499-2544 x1185 720-352-0676 (cell) From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Tuesday, February 17, 2009 4:43 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF Because the font specified in the PDF is "Arial-BoldMT" NOT "Arial Bold" - two different fonts... Leonard From: David Thielen [mailto:da...@windward.net] Sent: Tuesday, February 17, 2009 3:29 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Here you go. Acrobat ver 9 running on XP w/ SP-3. thank you - dave From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Mon 2/16/2009 11:14 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Please provide a sample PDF the demonstrates the problem. Also, what version of Acrobat is being used on what OS platform? Leonard From: David Thielen [mailto:da...@windward.net] Sent: Monday, February 16, 2009 12:00 PM To: itext Subject: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Hi; We're getting this issue from one of our customers. The PDFs we create use unicode for all text so all fonts are embedded. We build the PDF from a Word document. I open new document in Word. Add some text, choose Arial in the fonts dropdown list. Add an other line of text, choose Arial in the fonts dropdown list and select the "bold" button. Save the document as an RTF Create a PDF. Open the PDF in Acrobat Reader. The font types are now Arial-MT and Arial-BoldMT. And it are embedded subsets. When I open the PDF in Adobe Acrobat Professional, I can perfectly add some text to the default Arial text. When I want to add some text to the bold Arial text, I get an error message that the font is a subset and that no compatible system font can be found. Which is strange because I have ARIALBD.TTF in my Fonts folder. Any ideas? thanks - dave -- Leonard Rosenthol PDF Standards Architect Adobe Systems Incorporated -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF
Hi; I understand that. The two probelems we are having are: We call FontFactory.getFont("Arial", baseFont.IDENTITY_H, true, 12.0, Font.BOLD); and the BaseFont it returns has a fontName of "Arial-BoldMT". So the first question is how can we set the font to Arial rather than ArialMT and Arial,Bold rather than Arial-BoldMT? Second, when I use the text touch up tool on my system, the same system that did the above conversion to ArialMT - it tells me it cannot find ArialMT and will use Arial instead. Si it's like iText does a name mapping that Acrobat cannot do? Third, when our customer goes to use the text touchup tool, she gets a message saying Acrobat cannot find a substitute font for the bold. It does do ok for the non-bold. ??? - thanks - dave David Thielen 303-499-2544 x1185 720-352-0676 (cell) From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Tuesday, February 17, 2009 4:43 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobatafter creating PDF Because the font specified in the PDF is "Arial-BoldMT" NOT "Arial Bold" - two different fonts... Leonard From: David Thielen [mailto:da...@windward.net] Sent: Tuesday, February 17, 2009 3:29 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Here you go. Acrobat ver 9 running on XP w/ SP-3. thank you - dave From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Mon 2/16/2009 11:14 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Please provide a sample PDF the demonstrates the problem. Also, what version of Acrobat is being used on what OS platform? Leonard From: David Thielen [mailto:da...@windward.net] Sent: Monday, February 16, 2009 12:00 PM To: itext Subject: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Hi; We're getting this issue from one of our customers. The PDFs we create use unicode for all text so all fonts are embedded. We build the PDF from a Word document. I open new document in Word. Add some text, choose Arial in the fonts dropdown list. Add an other line of text, choose Arial in the fonts dropdown list and select the "bold" button. Save the document as an RTF Create a PDF. Open the PDF in Acrobat Reader. The font types are now Arial-MT and Arial-BoldMT. And it are embedded subsets. When I open the PDF in Adobe Acrobat Professional, I can perfectly add some text to the default Arial text. When I want to add some text to the bold Arial text, I get an error message that the font is a subset and that no compatible system font can be found. Which is strange because I have ARIALBD.TTF in my Fonts folder. Any ideas? thanks - dave -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
[iText-questions] Operation Not Supported
I have a java program that I wrote that utilizes iText 2.1.4. This program works properly on my local windows environment. I am running Sun JDK 1.5.0.17. I then jar my application up and transfer the jar to an iSeries (AS/400), version V5R3. I receive the following error when I attempt to run my program: java.io.IOException: Operation not supported. Map failed at java.lang.Throwable.(Throwable.java:195) at java.lang.Exception.(Exception.java:41) at java.io.IOException.(IOException.java:40) at sun.nio.ch.FileChannelImpl.map0(Native Method) at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:731) at com.lowagie.text.pdf.MappedRandomAccessFile.init(Unknown Source) at com.lowagie.text.pdf.MappedRandomAccessFile.(Unknown Source) at com.lowagie.text.pdf.RandomAccessFileOrArray.(Unknown Source) at com.lowagie.text.pdf.RandomAccessFileOrArray.(Unknown Source) at com.lowagie.text.pdf.PRTokeniser.(Unknown Source) at com.lowagie.text.pdf.PdfReader.(Unknown Source) at com.lowagie.text.pdf.PdfReader.(Unknown Source) On the iSeries, I am running under JDK 1.4.2. Though I did attempt to run it under 1.5 as well with no change in behavior. Any idea what might be causing this? Thanks, Donald R. Kichline Penske Truck Leasing Sr. Software Engineer, Systems Architecture T 610-796-4190 F 610-603-8402 E don.kichl...@penske.com www.GoPenske.com P.O. Box 563 Reading, PA 19603-0563 -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] PdfAnnotation of specified page not working...
Hi All, I just wanted to know, if anyone got a chance to have a look at this thread below? Thank in advance! Mandar On Tue, Feb 17, 2009 at 1:17 AM, mandar.jagtap wrote: > > I tried with as follows > > PdfStamper stamp = new PdfStamper(reader, new FileOutputStream(outputFile)); > > PdfContentByte over = stamp.getOverContent(4); > > Rectangle targetSWFArea = new Rectangle(100,200,300,400); > > PdfFileSpecification fs = > PdfFileSpecification.fileEmbedded(stamp.getWriter(), "scrollbar.swf", > "scrollbar.swf", null); > > stamp.addAnnotation(PdfAnnotation.createScreen(stamp.getWriter(), > targetSWFArea, "scrollbar.swf",fs,"application/x-shockwave-flash",true), 4); > > but still it's not working...when I try with page-number parameter as 1, it > works well...nut not for page-number 4. What could be wrong in that? > > Thanks in advance > Mandar > > > Mark Storer-3 wrote: >> >> mandar.jagtap gmail.com> writes: >> >>> >>> >>> I am trying to add a flash object in the pdf on page-number other than >>> first >>> page. When I try the same for first page, it's working well but some >>> reason >>> it's not working for specified page number. I am trying with this code as >>> follows: >>> >>> Could somebody help with this? >>> >>> PdfReader reader = new PdfReader(inputFile); >>> >>> PdfStamper stamp = new PdfStamper(reader, new >>> FileOutputStream(outputFile)); >>> >>> PdfContentByte over = stamp.getOverContent(4); >>> >>> Rectangle targetSWFArea = new Rectangle(100,200,300,400); >>> >>> PdfFileSpecification fs = >>> PdfFileSpecification.fileEmbedded(stamp.getWriter >>> (), "scrollbar.swf", "scrollbar.swf", null); >>> >>> over.addAnnotation(PdfAnnotation.createScreen(stamp.getWriter(), >>> targetSWFArea, "scrollbar.swf",fs,"application/x-shockwave-flash",true), >>> 4); >> >> You need to use "stamp.addAnnotation( annot, page )" instead. >> >> PdfContentByte's addAnnotation just turns around and calls it >> writer.addAnnotation(), which adds to the "current page". A stamper >> doesn't >> really have a current page, so you get the behavior you've described. >> >> >> --Mark Storer >> >> >> -- >> ___ >> iText-questions mailing list >> iText-questions@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/itext-questions >> >> Buy the iText book: http://www.1t3xt.com/docs/book.php >> >> > > -- > View this message in context: > http://www.nabble.com/PdfAnnotation-of-specified-page-not-working...-tp21981395p22044423.html > Sent from the iText - General mailing list archive at Nabble.com. > > > -- > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > ___ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.1t3xt.com/docs/book.php > -- Thanks & Regards, Mandar -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] alternative to Batik for SVG images
Jeff Glatz wrote: > for those of you who just need to load an SVG image and are a little put > off by Batik's size and bazillion jar dependency graph, i'd thought i > share a lightweight alternative i ran across: Thanks, I made a FAQ entry with the information in your mail: http://1t3xt.info/tutorials/faq.php?branch=faq.xtra&node=svg -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] precision in text/pdf/ByteBuffer
I guess I've spent too much time around getters and setters to look at the "public static" part of the variable. That was embarassing... --sam 2009/2/16 Paulo Soares > ByteBuffer.HIGH_PRECISION = true; > > Paulo > > > -Original Message- > > From: Sam Krasnik [mailto:samkras...@gmail.com] > > Sent: Monday, February 16, 2009 12:12 AM > > To: itext-questions@lists.sourceforge.net > > Subject: [iText-questions] precision in text/pdf/ByteBuffer > > > > I noticed that HIGH_PRECISION in ByteBuffer is set to false; > > this messes up my geo-spatial referencing. Can this be made > > configurable (i.e. in the future)? > > > > thanks, > > > > --sam > > > > > > Aviso Legal: > Esta mensagem é destinada exclusivamente ao destinatário. Pode conter > informação confidencial ou legalmente protegida. A incorrecta transmissão > desta mensagem não significa a perca de confidencialidade. Se esta mensagem > for recebida por engano, por favor envie-a de volta para o remetente e > apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o > destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. > > Disclaimer: > This message is destined exclusively to the intended receiver. It may > contain confidential or legally protected information. The incorrect > transmission of this message does not mean the loss of its confidentiality. > If this message is received by mistake, please send it back to the sender > and delete it from your system immediately. It is forbidden to any person > who is not the intended receiver to use, distribute or copy any part of this > message. > > > > > -- > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > ___ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.1t3xt.com/docs/book.php > -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF
Because the font specified in the PDF is "Arial-BoldMT" NOT "Arial Bold" - two different fonts... Leonard From: David Thielen [mailto:da...@windward.net] Sent: Tuesday, February 17, 2009 3:29 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Here you go. Acrobat ver 9 running on XP w/ SP-3. thank you - dave From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Mon 2/16/2009 11:14 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Please provide a sample PDF the demonstrates the problem. Also, what version of Acrobat is being used on what OS platform? Leonard From: David Thielen [mailto:da...@windward.net] Sent: Monday, February 16, 2009 12:00 PM To: itext Subject: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Hi; We're getting this issue from one of our customers. The PDFs we create use unicode for all text so all fonts are embedded. We build the PDF from a Word document. I open new document in Word. Add some text, choose Arial in the fonts dropdown list. Add an other line of text, choose Arial in the fonts dropdown list and select the "bold" button. Save the document as an RTF Create a PDF. Open the PDF in Acrobat Reader. The font types are now Arial-MT and Arial-BoldMT. And it are embedded subsets. When I open the PDF in Adobe Acrobat Professional, I can perfectly add some text to the default Arial text. When I want to add some text to the bold Arial text, I get an error message that the font is a subset and that no compatible system font can be found. Which is strange because I have ARIALBD.TTF in my Fonts folder. Any ideas? thanks - dave -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] Printing both sides with iText
I should clarify a little bit... Because it is a security risk (as Bruno points out), the file needs to be "trusted" in order for it to execute w/o the UI. A trusted file can either be certified by a trusted certificate (which you can do with iText) _OR_ it can be in a trusted location (folder, web site, etc.) as specified in the Trust Manager of Adobe Acrobat/Reader. Leonard -Original Message- From: 1T3XT info [mailto:i...@1t3xt.info] Sent: Tuesday, February 17, 2009 5:39 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Printing both sides with iText Uma Gudi wrote: > > When I tried to Print Pdf, using below code > > writer.addJavaScript("this.print(false);", > *false*); > > response.setHeader("Expires", "0"); > response.setHeader("Cache-Control", > "must-revalidate, post-check=0, pre-check=0"); > response.setHeader("Pragma", "public"); > > response.setContentType("application/pdf"); > response.setContentLength(baos.size()); > ServletOutputStream out = > response.getOutputStream(); > baos.writeTo(out); > out.flush(); > > It is prompting me to save local and showing the print setting prompt. > My requirement is directly send to Printer without prompting. > > Need Help That will only work with old versions of Adobe Reader. Newer versions of Adobe Reader consider printing without prompting as a security hazard. In other words: what you want to achieve has been made impossible with Adobe Reader. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] add a watermark to a signed PDF without losing the sign? SOLVED
Hi all. Just to say that all is running now, just append a " ,'\0',true ) " at PdfStamper code. PdfStamper stamp = new PdfStamper(reader, new FileOutputStream("c:\\my_dir\\" + file_name+"-watermarked.pdf"), '\0', true); thanks Leonard Rosenthol escribió: Correct - and that is by design...(for anyone that cares ;). Leonard -Original Message- From: Paulo Soares [mailto:psoa...@glintt.com] Sent: Monday, February 16, 2009 6:38 AM To: Post all your questions about iText here Subject: Re: [iText-questions] add a watermark to a signed PDF without losing the sign? Open PdfStamper in append mode. Note that in Acrobat 9 you'll have an indication of signature invalid, that's a change of behavior from Acrobat 8. Paulo -Original Message- From: RGBIT [mailto:rg...@stiva.net] Sent: Sunday, February 15, 2009 8:10 PM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] add a watermark to a signed PDF without losing the sign? Hi all. After a couple of days triyng about, and read many posts, I'm unable to add a watermark to a existing signed PDF without broken it. In Adobe reader the signature appears broken, with error "byte range is invalid". I know that this can be posible, because I have done it manually though Adobe Acrobat Profesional. (Document->Watermark->Add). I have open "pdf_signed.pdf" file, and add a watermark to every page of it, saving the result file to ""pdf_signed_and_watermarked.pdf". I have compared both two files, pdf_signed.pdf and Acrobat resultant "pdf_signed_and_watermarked.pdf", and the latest is identical byte to byte to the original one, but with a added content. As if the added content act as a "revision" or "upgrade" of the original document. My question: How can I make this with iText ?? If iText can't: There are another library that I can use? thanks Aviso Legal: Esta mensagem ? destinada exclusivamente ao destinat?rio. Pode conter informa??o confidencial ou legalmente protegida. A incorrecta transmiss?o desta mensagem n?o significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. ? proibido a qualquer pessoa que n?o o destinat?rio de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] Printing both sides with iText
Uma Gudi wrote: > > When I tried to Print Pdf, using below code > > writer.addJavaScript("this.print(false);", > *false*); > > response.setHeader("Expires", "0"); > response.setHeader("Cache-Control", > "must-revalidate, post-check=0, pre-check=0"); > response.setHeader("Pragma", "public"); > > response.setContentType("application/pdf"); > response.setContentLength(baos.size()); > ServletOutputStream out = > response.getOutputStream(); > baos.writeTo(out); > out.flush(); > > It is prompting me to save local and showing the print setting prompt. > My requirement is directly send to Printer without prompting. > > Need Help That will only work with old versions of Adobe Reader. Newer versions of Adobe Reader consider printing without prompting as a security hazard. In other words: what you want to achieve has been made impossible with Adobe Reader. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] Printing both sides with iText
When I tried to Print Pdf, using below code writer.addJavaScript("this.print(false);", false); response.setHeader("Expires", "0"); response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0"); response.setHeader("Pragma", "public"); response.setContentType("application/pdf"); response.setContentLength(baos.size()); ServletOutputStream out = response.getOutputStream(); baos.writeTo(out); out.flush(); It is prompting me to save local and showing the print setting prompt. My requirement is directly send to Printer without prompting. Need Help Thank you in advance Uma Maheswara Rao Gudi Experience certainty. IT Services Business Solutions Outsourcing 1T3XT info 02/16/2009 10:37 PM Please respond to Post all your questions about iText here To Post all your questions about iText here cc Subject Re: [iText-questions] Printing both sides with iText Uma Gudi wrote: > > How do i print pdf with retro verso(both sides) with iText? iText creates PDF files, it doesn't print them. You can set the viewer preference to DUPLEX using this method: http://1t3xt.info/api/com/lowagie/text/pdf/PdfWriter.html#addViewerPreference(com.lowagie.text.pdf.PdfName,%20com.lowagie.text.pdf.PdfObject) -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php ForwardSourceID:NT0001550E =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] signing pdf with external signature
Your solution is what I was looking for. Great, thank you very much. -- View this message in context: http://www.nabble.com/signing-pdf-with-external-signature-tp21917425p22053892.html Sent from the iText - General mailing list archive at Nabble.com. -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
Re: [iText-questions] signing pdf with external signature
Hi! I don't think that model is too unusual, you are likely to find it whereever you have heterogenous load-balancing signature card farms instead of workstations with individual card terminals, and have to cope with an API that decides just in time which signature card to use, e.g. in medium-volume e-billing contexts. amarianoelaide, the second possibility you mention can not work as data from the certificate is integrated into the signed data. The first possibility only works if each user has one and only one certificate that might be chosen for him; this might not be a realistic assumption in the long run considering scalability issues. You might want to try something like this, at least if the signature creation and manipulation APIs you use allow you to create signatures in PKCS#7 format for a given hash: pdfStamper = PdfStamper.createSignature(pdfReader, null, '\0', targetPdfFile, true); pdfSigApp = pdfStamper.getSignatureAppearance(); pdfSigApp.setVisibleSignature(new Rectangle(area[0], area[1], area[2], area[3]), signaturePage, signatureLabel); pdfSigApp.setImage(Image.getInstance(imageUrl)); pdfSigApp.setLayer2Text(""); PdfSignature sigDic = new PdfSignature(PdfName.ADOBE_PPKMS, PdfName.ADBE_PKCS7_DETACHED); sigDic.put(PdfName.FT, PdfName.SIG); sigDic.setDate(new PdfDate(calendar)); sigDic.setReason(signingReason); sigDic.setLocation(location); sigDic.setContact(signerContactInfo); //sigDic.setName(signerName); pdfSigApp.setCryptoDictionary(sigDic); pdfSigApp.setAcro6Layers(true); HashMap exclusions = new HashMap(); exclusions.put(PdfName.CONTENTS, new Integer(containerPlaceHolderSize*2+2)); pdfSigApp.preClose(exclusions); then hash pdfSigApp.getRangeStream() and create a PKCS#7 signature container in a byte[] signatureContent, then PdfDictionary updates = new PdfDictionary(); byte out[] = new byte[containerPlaceHolderSize]; System.arraycopy(signatureContent, 0, out, 0, signatureContent.length); updates.put(PdfName.CONTENTS, new PdfString(out).setHexWriting(true)); pdfSigApp.close(updates); As you don't know beforehand which certificate will be used for the signature you obviously can't include data about the certificate in signature representation. Simply use an image descriptive enough; details about the certificate are visible in the signature properties. Regards, Michael. -Original Message- From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Monday, February 16, 2009 3:35 PM To: Post all your questions about iText here Subject: Re: [iText-questions] signing pdf with external signature I think the only way you are going to solve your problem cleanly is to modify iText and provide an alternative set of signing APIs that work in your model, which as Paulo points out, is quite unusual. Leonard -Original Message- From: amarianoelaide [mailto:amari...@elaide.com] Sent: Monday, February 16, 2009 5:31 AM To: itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] signing pdf with external signature I'm sorry for the lack of clearness of my thread and also of my english. I'll try at my best to explain again what I need. Obviusly I need to sign a pdf. I am able to do it with this code: //get the certificate used to sign, call it certificate PdfReader reader = new PdfReader("pdf_to_be_signed.pdf"); FileOutputStream fout = new FileOutputStream("signed_pdf.pdf"); PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0'); PdfSignatureAppearance sap = stp.getSignatureAppearance(); sap.setCrypto(null, new Certificate[]{certificate}, null, PdfSignatureAppearance.SELF_SIGNED); sap.setReason("Hello"); sap.setLocation("Italy"); sap.setVisibleSignature(new Rectangle(100, 100, 200, 200), 1, null); sap.setExternalDigest(new byte[128], new byte[20], null); sap.preClose(); MessageDigest messageDigest = MessageDigest.getInstance("SHA1"); byte buf[] = new byte[8192]; int n; InputStream inp = sap.getRangeStream(); while ((n = inp.read(buf)) > 0) { messageDigest.update(buf, 0, n); } byte hash[] = messageDigest.digest(); //sign this hash with an external procedure that gives me signed_hash PdfPKCS7 sig = sap.getSigStandard().getSigner(); sig.setExternalDigest(signed_hash, null, "RSA"); PdfDictionary dic2 = new PdfDictionary(); dic2.put(PdfName.CONTENTS, new PdfString(sig.getEncodedPKCS1()).setHexWriting(true)); sap.close(dic2); Call this piece of code CASE1. So what's the problem? The problem is that to use the CASE1 I need to observe a strict order for the operations: 1-get the certificate to use for the signature operation 2-use a PDFReader to read the pdf to sign 3-use a PDFStamper to modify the pdf creating the signed one 4-use PdfSignatureAppearance to create the "signature field" 5-fill this signature filed with certificate, reason, location etc 6-get the hash to be signed 7-sign it with an external proc 8-add the si
Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF
Here you go. Acrobat ver 9 running on XP w/ SP-3. thank you - dave From: Leonard Rosenthol [mailto:lrose...@adobe.com] Sent: Mon 2/16/2009 11:14 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Please provide a sample PDF the demonstrates the problem. Also, what version of Acrobat is being used on what OS platform? Leonard From: David Thielen [mailto:da...@windward.net] Sent: Monday, February 16, 2009 12:00 PM To: itext Subject: [iText-questions] Can't edit bold arial in Acrobat after creating PDF Hi; We're getting this issue from one of our customers. The PDFs we create use unicode for all text so all fonts are embedded. We build the PDF from a Word document. I open new document in Word. Add some text, choose Arial in the fonts dropdown list. Add an other line of text, choose Arial in the fonts dropdown list and select the "bold" button. Save the document as an RTF Create a PDF. Open the PDF in Acrobat Reader. The font types are now Arial-MT and Arial-BoldMT. And it are embedded subsets. When I open the PDF in Adobe Acrobat Professional, I can perfectly add some text to the default Arial text. When I want to add some text to the bold Arial text, I get an error message that the font is a subset and that no compatible system font can be found. Which is strange because I have ARIALBD.TTF in my Fonts folder. Any ideas? thanks - dave <>-- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php