[iText-questions] How do I concatenate Document objects using ITEXT
dlima has sent you a Secure E-Mail Message. The e-mail you have received may include confidential information. Please click on the link below to read your secure e-mail message. If you have trouble accessing your secure e-mail, see the instructions at the bottom of this message. https://securemail.massmutual.com/ime?x=4-22909031-12645623-JX4M1LBJ The secure e-mail will expire on Saturday August 14, 2010 .. Need help picking up your package? * If the Web address above is highlighted, click on it to open a browser window. You will automatically be taken to the package. * If the Web address above is not highlighted, follow these steps: - Open a Web browser window. - Copy and paste the entire Web address into the location or address bar of the browser. - Press enter. --- Delivered with IME(TM) http://www.tumbleweed.com IME is a trademark of Tumbleweed Communications Corp. -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Fonts supported by iText
Well, we're creating a PDF that will be sent through a web service to a third party, and they (for some reason) have a limited number of fonts that they're willing to use. I believe Arial is the most common one. -- Message: 3 Date: Tue, 15 Jun 2010 14:39:02 +0200 From: 1T3XT info i...@1t3xt.info Subject: Re: [iText-questions] What fonts are supported by iText? To: Post all your questions about iText here itext-questions@lists.sourceforge.net Message-ID: 4c177466.6020...@1t3xt.info Content-Type: text/plain; charset=windows-1252; format=flowed Robert Franzese wrote: Hello, I'm wondering if there's a place I can go to so I can find a list of fonts supported by iText. There are three different ways to answer this question. These three different ways corresponds with three different tables in chapter 11 of the 2nd edition of iText in Action: Table 11.1: Font files and their extension Type 1 Font files (.afm, .pfm, .pfb) A Type 1 font is composed of two files: one containing the metrics (.afm or .pfm), and one containing the mathematical descriptions for each character (.pfb). True Type Font files (.ttf) A font based on a specification developed by Apple to compete with Adobe's Type 1 fonts. Open Type Font files (.otf, .ttf, .ttc) Cross-platform font file format based on Unicode. Open Type font files containing Type 1 outlines have an .otf extension. Filenames of Open Type fonts containing True Type data have a .ttf or .ttc extension. The .ttc extension is used for True Type Collections. Answer 1: font files with these extensions are supported in iText. Table 11.2: Subtype values for fonts /Type1 A font that defines glyph shapes using Type 1 font technology. /Type3 A font that defines glyphs with streams of PDF graphics operators. /TrueType A font based on the True Type font format. /Type0 A composite font?a font composed of glyphs from a descendant CIDFont. /CIDFontType0 A CIDFont whose glyph descriptions are based on the Compact Font Format. Answer 2: font files of the above subtypes (see ISO 32000 for the meaning of these subtypes) are supported in iText. Table 11.3 lists the different font classes in iText that are at play, and how they relate to each other. Answer 3: read the book to find out how fonts work in iText. As a follow-up question, is there a way to be able to use additional fonts? What additional type of fonts are you thinking about? iText even allows you to create your own font (Type 3), I guess I don't understand the question. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- Message: 4 Date: Tue, 15 Jun 2010 05:47:38 -0700 From: Leonard Rosenthol lrose...@adobe.com Subject: Re: [iText-questions] Finding colorspaces used in a pdf To: Post all your questions about iText here itext-questions@lists.sourceforge.net Message-ID: d23d6b9e57d654429a9ab6918caceaa97d21026...@nambx02.corp.adobe.com Content-Type: text/plain; charset=iso-8859-1 You want the new content parser in iText 5. Also, don't forget that you'll need special handling for images, patterns, smooth shadings, Form XObjects and Type 3 fonts. Leonard From: Dala Himself [mailto:dalahims...@hotmail.com] Sent: Tuesday, June 15, 2010 2:10 PM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] Finding colorspaces used in a pdf I want to make a program which analyzes a pdf to find which colorspaces are used in the document. My program goes through every page in the pages tree and for every page I want to check the page's contenstream(s) for the operators CS, SCN, G, RG and K (which are all used to set the current colorspace). So, my question is, if I have an object of type 'PdfStream', is it possible to retrieve the CS, SCN, G, RG and K operators from the stream along with the operator parameters? Hope my question is clear and that somebody can give me an answer :) Thanks in advance for any help!! Geir Windows 7: Se direkte-TV fra den b?rbare PCen. Finn ut mer.http://windows.microsoft.com/windows-7 -- next part -- An HTML attachment was scrubbed... -- Message: 5 Date: Tue, 15 Jun 2010 09:49:13 -0400 From: Michelle Zhang michelleyzh...@gmail.com Subject: [iText-questions] Total Page Number Always shows as actual total page number + 1 To: iText-questions@lists.sourceforge.net Message-ID: aanlktilfbvvxsyx15y_u2juhlj9p0tk460ujok7pd...@mail.gmail.com Content-Type: text/plain; charset=iso-8859-1 I'm using total = writer.DirectContent.CreateTemplate(10, 15); in the OnOpenDocument. When I call it in the onEndPage to show the total page number, if the actual total page number is 5, it shows as 6. if the actual total page number is 10, it shows as 11. etc. Anyone knows why is that? -- --- Michelle Zhang -- next part
Re: [iText-questions] Fonts supported by iText
Robert Franzese wrote: Well, we're creating a PDF that will be sent through a web service to a third party, and they (for some reason) have a limited number of fonts that they're willing to use. Seems reasonable. That's not really a problem for iText. I believe Arial is the most common one. Ask them if they can provide (licenses for) the fonts they allow. Give them the option to provide an .otf, .ttf, .ttc or .afm+.pfb. If they impose restrictions on particular fonts, they should have (licenses for) those font files. Your counter-question will sound very reasonable. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] How do I concatenate Document objects using ITEXT
dlima wrote: dlima has sent you a Secure E-Mail Message. The e-mail you have received may include confidential information. If your mail contains confidential information, then why are you sending it to about 2000 subscribers of a public mailing list? As the posts to the mailing list are archived on different sites, the whole world can read the confidential information. Moreover: the people who support iText for free aren't interested in confidential information (only paid customers can send us confidential PDFs privately). I for one, won't click on the link that was provided in the mail. Therefore, I'll only answer the question in the subject-line. Concatenating documents can be done in different ways depending on the specific requirement. Most of the times PdfCopy will do, but in special cases PdfSmartCopy or PdfCopyFields are required. This is all explained in chapter 6 of the second edition of iText in Action: http://itextpdf.com/book/ -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] [off-topic] iText in California
Hello, a short personal message to iText developers in California: Next month, I'll probably visiting California with my wife and kids. I don't have an exact timing yet (end of July is the most accurate estimate for now). Are there people, places, things I should visit? It's probably best to answer this question off-list. Please take into account that I'll have a busy schedule (business) and that I'll have two kids with me (almost 13 and almost 14). If the trip is a success, I consider coming to the US more often, for instance to attend to conferences and to talk with developers (I'll have a book to promote soon). best regards, Bruno -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] Image resize problem when migrating from 1.4.7 to 5.0.2
Hi, I recently switched from 1.4.7 to 5.0.2 and noticed, that one image in a table does not render correctly. I did some research and changed the code to: URL url = getClass().getResource(images/logo.gif); logo = Image.getInstance(url); Image logo; cell = new PdfPCell(logo, false); so that no fitting to the cell is performed. That did not work. I tried scaleAbsolute to a defined size (the size of the image on disk): logo.scaleAbsolute(48, 38); but that did not change the size in the pdf. When I used a smaller size, the image was rendered smaller. I tried some different values and at about 75% of the original size, the image in my new pdf had the same size as the image in my old (correct) pdf. (Both pdf are scaled at 100%) The cell is rendered correctly in size, the image overlays the text of the next cell. When I add the image directly to the document, I face the same problem. I am migrating several projects that use reporting and adjusting every image and finding its right scale value is impossible. So why is the image resizing? What can I do to prevent that scaling? Thanks for you help, Jan -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] embed the BaseFont Helvetica
Hello , I tried to embed the BaseFont Helvetica but Acrobat says that=20 it isn't embedded. this is may Code based on itext 2.0.7: String text0 =3D This is the quite popular built in font ' + = BaseFont.HELVETICA + '.; Paragraph p =3D new Paragraph(THIS IS TEST, = FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, = BaseFont.EMBEDDED)); document.add(p); Thanks for your help. br, Markus -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] embed the BaseFont Helvetica
pri...@samea.de wrote: Hello , I tried to embed the BaseFont Helvetica but Acrobat says that=20 it isn't embedded. This is explained in the documentation. See chapter 11 of the second edition of iText in Action. this is may Code based on itext 2.0.7: String text0 =3D This is the quite popular built in font ' + = BaseFont.HELVETICA + '.; Paragraph p =3D new Paragraph(THIS IS TEST, = FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, = BaseFont.EMBEDDED)); The parameter embedded is ignored in some cases. For instance: - the standard type 1 fonts such as Helvetica are never embedded, - CJK fonts are never embedded, - if encodiing Identity-H or -V is used, the font is always embedded, no matter which value you pass for the embedded parameter. document.add(p); Thanks for your help. If you want to embed Helvetica, you need to buy the .pfb file. iText only ships with the (free) .afm file. Or even better: search the web to find where you can buy a .ttf or .otf file containing the Helvetica font program. (Note that we don't sell fonts, you'll have to use Google to find where you can buy Helvetica.) -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Cell spliting over page break
Thanks for your help, It works perfectly ! -Original Message- From: 1T3XT info [mailto:i...@1t3xt.info] Sent: lundi 14 juin 2010 18:02 To: Post all your questions about iText here Subject: Re: [iText-questions] Cell spliting over page break François Miermont wrote: Hi, Im using iTextSharp v4.1.2. I create a PDF which is a big listing in a table. My problem is that some cells are really big (lots of line in it) and split over many pages. Im trying, when splitting occurs, to add a text at the top left of the cell as a reminder. Problem is I dont have any idea if it is possible ? I'd use a Cell event to do this. Add a boolean member variable to your implementation of PdfPCellEvent, for instance cellIsAdded = false; Check this variable in the layout() method. If it's false, set it to true; if it's truee, add the reminder. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] NPE while Extracting text
I will add to Mark's (excellent) stream of consciousness analysis: The next step is to see what the name of the font resource is that is causing the problem. Then, load RUPS and dig into the page dictionary and find the entry for that font resource - given what Mark is showing in the source, most likely the font resource isn't defined. There's always a question with this sort of thing about 'why does Acrobat show the file OK' - the answer is that Acrobat is very permissive - there are all sorts of problems like this that it may silently ignore. Older versions of Acrobat often show problems that newer versions ignore. And then, of course, there's always the possibility that there's a problem with iText, and the strategy for looking up font resources isn't quite in sync with the PDF spec. I don't *think* that is the case here, but it's always possible. If you do wind up providing the PDF so we can take a look, be sure to also provide font file that think may be involved. - K -- View this message in context: http://itext-general.2136553.n4.nabble.com/NPE-while-Extracting-text-tp2256512p2257485.html Sent from the iText - General mailing list archive at Nabble.com. -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] [off-topic] iText in California
northern or southern? Dan On Jun 16, 2010, at 12:56 AM, Bruno Lowagie br...@lowagie.com wrote: Hello, a short personal message to iText developers in California: Next month, I'll probably visiting California with my wife and kids. I don't have an exact timing yet (end of July is the most accurate estimate for now). Are there people, places, things I should visit? It's probably best to answer this question off-list. Please take into account that I'll have a busy schedule (business) and that I'll have two kids with me (almost 13 and almost 14). If the trip is a success, I consider coming to the US more often, for instance to attend to conferences and to talk with developers (I'll have a book to promote soon). best regards, Bruno -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] External Dependencies
Hello list! I would like to know if any of the iText versions needs native libraries or if it's 100% pure. As far as my limited Java knowledge allowed me to read and understand the sources, I would assume there aren't any external dependencies, but I need to make sure. Sorry for bothering the list, but I am a bit pressed for time. Thanks in advance, Markus -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] Compare font size with Word
Hi, Guys, Business gives me a Word template, I am supposed to produce a similar PDF document using iText. The font size used in the Word is 12. If I similarly use font 12 in iText, the font size in the generated PDF looks slightly smaller than the font size in Word document. It matches better if I use font size 13 in iText. Anyone has any clue? Many thanks in advance! Regards, Tao -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Compare font size with Word
There's a really simple solution here. Render your word document as a PDF and use PdfStamper to Add Stuff. To address your question directly, lets first ass-u-me that you're using 100% zoom. 1) In PDF, we always use 72 DPI (dots per inch). 2) In windows, you can have a variety of DPIs, though 96 seems pretty standard. As such, I'd expect a point difference of 25% to match (15 point, not 13). So this might not be the issue at all. --Mark Storer Senior Software Engineer Cardiff.com import legalese.Disclaimer; DisclaimerCardiff DisCard = null; From: Lu, Tao (MOH) [mailto:tao...@ontario.ca] Sent: Wednesday, June 16, 2010 11:59 AM To: itext-questions@lists.sourceforge.net Subject: [iText-questions] Compare font size with Word Hi, Guys, Business gives me a Word template, I am supposed to produce a similar PDF document using iText. The font size used in the Word is 12. If I similarly use font 12 in iText, the font size in the generated PDF looks slightly smaller than the font size in Word document. It matches better if I use font size 13 in iText. Anyone has any clue? Many thanks in advance! Regards, Tao No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.829 / Virus Database: 271.1.1/2937 - Release Date: 06/15/10 23:35:00 -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Spam: Spam: External Dependencies
iText is pure java, yes. However, it relies on some other .jar files... from bouncy castle, which I thought were included in the distribution. There are also a couple different itext*.jar files you might be missing. Asian fonts take up lots of space and aren't part of the main distribution. I believe there's some hyphenation logic that is also separate. iTextAsian.jar iTextAsianCmaps.jar. Is the hyphenation stuff still its own jar? --Mark Storer Senior Software Engineer Cardiff.com import legalese.Disclaimer; DisclaimerCardiff DisCard = null; -Original Message- From: Markus Mahlberg [mailto:mahlb...@dominic.de] Sent: Wednesday, June 16, 2010 11:29 AM To: itext-questions@lists.sourceforge.net Subject: Spam: Spam: [iText-questions] External Dependencies Hello list! I would like to know if any of the iText versions needs native libraries or if it's 100% pure. As far as my limited Java knowledge allowed me to read and understand the sources, I would assume there aren't any external dependencies, but I need to make sure. Sorry for bothering the list, but I am a bit pressed for time. Thanks in advance, Markus -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.829 / Virus Database: 271.1.1/2937 - Release Date: 06/15/10 23:35:00 -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] NPE while Extracting text
On Mark's advice I downloaded the source code from the 5.0.2 branch and dug a little deeper... The NPE is thrown on the following line of the DocumentFont constructor. fontName = PdfName.decodeName(font.getAsName(PdfName.BASEFONT).toString()); It turns out that font.getAsName(PdfName.BASEFONT) returns null. font, which is a PdfDictionary, has the following values in its hash map... {/FontBBox=[-2, -9, 38, 40], /LastChar=121, /FontMatrix=[0.24, 0, 0, 0.24, 0, 0], /Type=/Font, /Resources=Dictionary, /CharProcs=134 0 R, /Encoding=72 0 R, /Subtype=/Type3, /Name=/C0HN2000T1X005000, /Widths=135 0 R, /FirstChar=32} You'll notice that there is no key for /BaseFont. I'm not sure I can post the whole pdf to a public news group... I will see if I can cut it down to a page or so of none sensitive data first. Ben On 16 June 2010 16:31, Kevin Day ke...@trumpetinc.com wrote: I will add to Mark's (excellent) stream of consciousness analysis: The next step is to see what the name of the font resource is that is causing the problem. Then, load RUPS and dig into the page dictionary and find the entry for that font resource - given what Mark is showing in the source, most likely the font resource isn't defined. There's always a question with this sort of thing about 'why does Acrobat show the file OK' - the answer is that Acrobat is very permissive - there are all sorts of problems like this that it may silently ignore. Older versions of Acrobat often show problems that newer versions ignore. And then, of course, there's always the possibility that there's a problem with iText, and the strategy for looking up font resources isn't quite in sync with the PDF spec. I don't *think* that is the case here, but it's always possible. If you do wind up providing the PDF so we can take a look, be sure to also provide font file that think may be involved. - K -- View this message in context: http://itext-general.2136553.n4.nabble.com/NPE-while-Extracting-text-tp2256512p2257485.html Sent from the iText - General mailing list archive at Nabble.com. -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] NPE while Extracting text
According to the PDF Reference (ISO 32000), BaseFont is a required field. So where did this PDF come from? It's possible that the font's FondeDescriptor has a /FontName entry (also required, and required to match BaseName). I suspect Adobe has bullet-proofed their applications to the point where either will suffice. Heck, they could even query the font program directly if it was available. So while I wouldn't go so far as to call it a bug in iText, we certainly could be more durable in the face of malformed PDFs. At the very least, we could throw something more meaningful than an NPE. Ben? Do you have Acrobat 9 Pro? It has a PDF syntax check that would (hopefully) help you reach this sort of conclusion much faster, and wouldn't require you to fold/spindle/mutilate your PDF for public consumption. --Mark Storer Senior Software Engineer Cardiff.com import legalese.Disclaimer; DisclaimerCardiff DisCard = null; -Original Message- From: Ben Short [mailto:b...@benshort.co.uk] Sent: Wednesday, June 16, 2010 3:12 PM To: Post all your questions about iText here Subject: Re: [iText-questions] NPE while Extracting text On Mark's advice I downloaded the source code from the 5.0.2 branch and dug a little deeper... The NPE is thrown on the following line of the DocumentFont constructor. fontName = PdfName.decodeName(font.getAsName(PdfName.BASEFONT).toString()); It turns out that font.getAsName(PdfName.BASEFONT) returns null. font, which is a PdfDictionary, has the following values in its hash map... {/FontBBox=[-2, -9, 38, 40], /LastChar=121, /FontMatrix=[0.24, 0, 0, 0.24, 0, 0], /Type=/Font, /Resources=Dictionary, /CharProcs=134 0 R, /Encoding=72 0 R, /Subtype=/Type3, /Name=/C0HN2000T1X005000, /Widths=135 0 R, /FirstChar=32} You'll notice that there is no key for /BaseFont. I'm not sure I can post the whole pdf to a public news group... I will see if I can cut it down to a page or so of none sensitive data first. Ben -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] NPE while Extracting text
ok - I ran into this issue myself a month or so ago. It's been fixed in the 5.0.3 codebase (which is the current HEAD in SVN). /** Creates a new instance of DocumentFont */ DocumentFont(PRIndirectReference refFont) { encoding = ; fontSpecific = false; this.refFont = refFont; fontType = FONT_TYPE_DOCUMENT; font = (PdfDictionary)PdfReader.getPdfObject(refFont); PdfName baseFont = font.getAsName(PdfName.BASEFONT); fontName = baseFont != null ? PdfName.decodeName(baseFont.toString()) : Unspecified Font Name; // * this is the line with the fix PdfName subType = font.getAsName(PdfName.SUBTYPE); the bolded text above is the fix. - K -- View this message in context: http://itext-general.2136553.n4.nabble.com/NPE-while-Extracting-text-tp2256512p2258059.html Sent from the iText - General mailing list archive at Nabble.com. -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] NPE while Extracting text
Mark - FYI, basefont isn't required for Type3 fonts (or TrueType for that matter). I had the same reaction when I first ran into this issue, but the spec never lies, right? It just injects ambiguity and confusion. -- View this message in context: http://itext-general.2136553.n4.nabble.com/NPE-while-Extracting-text-tp2256512p2258064.html Sent from the iText - General mailing list archive at Nabble.com. -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.itextpdf.com/book/ Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/