PDF/A conformance check: Widths in embedded font are inconsistent with /Widths entry in the font dictionary

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

PDF/A conformance check: Widths in embedded font are inconsistent with /Widths entry in the font dictionary

Agnes Juhasz
Hi Paulo,

Thanks for the fast answer on my previous question.
Now I use PDF/AManager trial from PDFTRON to do conformance check against my PDF document.
After making up my PDF with color profile, it gives only one error:
Widths in embedded font are inconsistent with /Widths entry in the font dictionary

I use DejaVu fonts in my code by copying it into a directory, register this directory with FontFactory, then use as embedded font like:
Font textfont = FontFactory.getFont("DejaVuSerifCondensed", BaseFont.IDENTITY_H, true, 11f, Font.NORMAL);

I don't know how to resolve inconsistent font width error.
Thanks in advance for any hint,
Agnes




Reply | Threaded
Open this post in threaded view
|

Re: PDF/A conformance check: Widths in embedded font are inconsistent with /Widths entry in the font dictionary

Leonard Rosenthol-3
Have you validated that those fonts are valid and correct fonts?  I suspect there may be an issue with the font data.

Leonard

-----Original Message-----
From: Agnes Juhasz [mailto:[hidden email]]
Sent: Tuesday, January 19, 2010 1:25 PM
To: [hidden email]
Subject: [iText-questions] PDF/A conformance check: Widths in embedded font are inconsistent with /Widths entry in the font dictionary


Hi Paulo,

Thanks for the fast answer on my previous question.
Now I use PDF/AManager trial from PDFTRON to do conformance check against my
PDF document.
After making up my PDF with color profile, it gives only one error:
Widths in embedded font are inconsistent with /Widths entry in the font
dictionary

I use DejaVu fonts in my code by copying it into a directory, register this
directory with FontFactory, then use as embedded font like:
Font textfont = FontFactory.getFont("DejaVuSerifCondensed",
BaseFont.IDENTITY_H, true, 11f, Font.NORMAL);

I don't know how to resolve inconsistent font width error.
Thanks in advance for any hint,
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-tp27224996p27224996.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-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/

------------------------------------------------------------------------------
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-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/
Reply | Threaded
Open this post in threaded view
|

Re: PDF/A conformance check: Widths in embedded font are inconsistent with /Widths entry in the font dictionary

Paulo Soares-3
In reply to this post by Agnes Juhasz
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.

Paulo

> -----Original Message-----
> From: Agnes Juhasz [mailto:[hidden email]]
> Sent: Tuesday, January 19, 2010 12:25 PM
> To: [hidden email]
> Subject: [iText-questions] PDF/A conformance check: Widths in
> embedded font are inconsistent with /Widths entry in the font
> dictionary
>
>
> Hi Paulo,
>
> Thanks for the fast answer on my previous question.
> Now I use PDF/AManager trial from PDFTRON to do conformance
> check against my
> PDF document.
> After making up my PDF with color profile, it gives only one error:
> Widths in embedded font are inconsistent with /Widths entry
> in the font
> dictionary
>
> I use DejaVu fonts in my code by copying it into a directory,
> register this
> directory with FontFactory, then use as embedded font like:
> Font textfont = FontFactory.getFont("DejaVuSerifCondensed",
> BaseFont.IDENTITY_H, true, 11f, Font.NORMAL);
>
> I don't know how to resolve inconsistent font width error.
> Thanks in advance for any hint,
> Agnes

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.



------------------------------------------------------------------------------
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-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/
Reply | Threaded
Open this post in threaded view
|

Re: PDF/A conformance check: Widths in embedded font are inconsistent with /Widths entry in the font dictionary

Agnes Juhasz
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 HU_TL.pdf.

BR,
Agnes
Reply | Threaded
Open this post in threaded view
|

Re: PDF/A conformance check: Widths in embedded font are inconsistent with /Widths entry in the font dictionary

Leonard Rosenthol-3
Acrobat 9.3's PDF/A validator says that the file is fine and passes validation.

-----Original Message-----
From: Agnes Juhasz [mailto:[hidden email]]
Sent: Tuesday, January 19, 2010 7:44 PM
To: [hidden email]
Subject: 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-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/

------------------------------------------------------------------------------
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-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/
Reply | Threaded
Open this post in threaded view
|

Re: Spam: Re: PDF/A conformance check: Widths in embedded font are inconsistent with /Widths entry in the font dictionary

Mark Storer-2
In reply to this post by Agnes Juhasz
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-emb
edded-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-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/


------------------------------------------------------------------------------
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-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/
Reply | Threaded
Open this post in threaded view
|

Re: Spam: Re: PDF/A conformance check: Widths in embedded font are inconsistent with /Widths entry in the font dictionary

Leonard Rosenthol-3
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-emb
edded-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-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/


------------------------------------------------------------------------------
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-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/

------------------------------------------------------------------------------
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-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/