Mark asked me to write up a little something...
Font formats (TrueType, Type 1 and OpenType) each have their own way of specifying font width information. These values are in EM's (the theoretically width of an 'M') and vary between the formats - but there are standard conversions between em's and "user units".
The Font dictionary in PDF has a Widths entry which is an array of the widths of the each glyph (in a specific type of 'em' - 1:1000). While not required, these values are always integer.
As Mark points out - with all this conversion math going on, there is ALWAYS a chance for rounding errors and the like which can impact the PDF/A requirement of "match". That is why in PDF/A-2 and the second corrigenda for PDF/A-1, we've made it clear how to handle the "floating"...
Leonard
-----Original Message-----
From: Mark Storer [mailto:
[hidden email]]
Sent: Tuesday, January 19, 2010 11:18 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Spam: Re: PDF/A conformance check: Widths in embedded font are inconsistent with /Widths entry in the font dictionary
I just ran your file through Acrobat Pro's PDF/A-1b check (updated to 9.2.0, which I believe is the latest-n-greatest). No Problems Found.
The PDF/A spec states that this is indeed a requirement (section 6.3.6 if you happen to own a copy of the spec).
I wouldn't be surprised to find out that Paulo is correct. The width information in the font itself may be in 2000ths of an 'EM' (or 5000ths? My font-fu is a little rusty). The width information in the PDF itself however is an integer value in 1000ths of an 'EM'. If one program is truncating to 1000ths, and the other rounding, you might see this error. If the verifier you're using is expecting a precise value, (850.5 or what have you), it's doomed to disappointment. The PDF Specification requires that width information be integ....
OH NO IT DOESN'T. I looked through the PDF spec and can't find anything requiring an integer width value (just that it match the embedded font values). Having said that, I have Never seen a width value that wasn't a whole number (CosInteger), and your file is no exception.
section 9.6.2.1, Type 1 fonts: General
"
Widths
array
(Required except for the standard 14 fonts; indirect reference preferred) An array of (LastChar ? FirstChar + 1) widths, each element being the glyph width for the character code that equals FirstChar plus the array index. For character codes outside the range FirstChar to LastChar, the value of MissingWidth from the FontDescriptor entry for this font shall be used. The glyph widths shall be measured in units in which 1000 units correspond to 1 unit in text space. These widths shall be consistent with the actual widths given in the font program. For more information on glyph widths and other glyph metrics, see 9.2.4, "Glyph Positioning and Metrics".
Beginning with PDF 1.5, the special treatment given to the standard 14 fonts is deprecated. Conforming writers should represent all fonts using a complete font descriptor. For backwards capability, conforming readers shall still provide the special treatment identified for the standard 14 fonts.
"
Section 9.2.4 on "Glyph Positioning and Metrics" says basically the same thing, without mention of "whole numbers" anywhere.
PS:
EM: The width of the upper case M. Kinda goofy, but that's fonts for you. Also known as "1 unit in text space". I also don't recall seeing any "width of the letter M" that was exactly 1000 either. *shrug*
PPS:
Acrobat's API calls to get font widths (PDFontGetWidths, PDEFontGetWidths) take ASInt16's, though I haven't checked out the latest API reference since... well... the most recent one I have is 7.0.5. It's been a while. Leonard would probably know if that's changed or could look it up rather easily.
--Mark Storer
Senior Software Engineer
Cardiff.com
#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;
> -----Original Message-----
> From: Agnes Juhasz [mailto:
[hidden email]]
> Sent: Tuesday, January 19, 2010 10:44 AM
> To:
[hidden email]
> Subject: Spam: Re: [iText-questions] PDF/A conformance check:
> Widths in
> embedded font are inconsistent with /Widths entry in the font
> dictionary
>
>
>
>
> Paulo Soares-3 wrote:
> >
> > What does the Acrobat validator say? The only reason for
> that to happen
> > was with fonts with fractional widths considering that
> iText only stores
> > integer widths but that would be splitting hairs as the
> error can't be
> > more than 1/1000.
> >
>
> I have no Acrobat validator. I use PDF/AManager to validate
> which says:
> VLD-[FAIL]: HU_TL.pdf
> - e_PDFA361: Widths in embedded font are
> inconsistent with /Widths
> entry in the font dictionary
> Obj Refs:1, 9, 10
> I attach for you the PDF document
>
http://old.nabble.com/file/p27230563/HU_TL.pdf HU_TL.pdf .
>
> BR,
> Agnes
> --
> View this message in context:
>
http://old.nabble.com/PDF-A-conformance-check%3A-Widths-in-embedded-font-are-inconsistent-with--Widths-entry-in-the-font-dictionary-tp27224996p27230563.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questionsBuy the iText book:
http://www.1t3xt.com/docs/book.phpCheck 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/------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questionsBuy the iText book:
http://www.1t3xt.com/docs/book.phpCheck 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/------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questionsBuy the iText book:
http://www.1t3xt.com/docs/book.phpCheck 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/