The PDFs are invalid and they should include Widths. -----Original Message----- From: Dominika Tkaczyk [mailto:[email protected]] Sent: Monday, February 14, 2011 2:10 AM To: [email protected] Subject: [iText-questions] Alternative names of standard 14 fonts
Hello, I am trying to use iText to parse PDF files and obtain text chunks along with their position, width and height. In a few files I've noticed a problem with string width: the width I get is oddly small, and font.getWidth(somestring) always returns 0. The fonts used in problematic files are TimesNewRoman, TimesNewRoman,Bold and Arial. It seems that PDFs doesn't include Widths arrays for them, and iText doesn't recognize those fonts as standard 14 fonts (BuiltinFonts14), thus it cannot determine glyphs widths for them (please correct me if I am wrong with anything, I am new to all this). I also checked PDF reference, and according to the reference those font names are alternative names for standard fonts Times-Roman, Times-Bold and Helvetica, respectively. So should those font be treated as standard fonts by iText and their names mapped to standard names? Or perhaps PDF files are simply invalid and they should include Widths arrays? Best regards, Dominika ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
