Re: [iText-questions] BaseFonts.getDocumentFonts crashes

2010-03-20 Thread Paulo Soares
Finally fixed.

Paulo
  - Original Message - 
  From: Paulo Soares 
  To: itext-questions@lists.sourceforge.net 
  Sent: Saturday, March 20, 2010 1:36 PM
  Subject: Re: [iText-questions] BaseFonts.getDocumentFonts crashes


  The pdf you sent me (r50.pdf) lists 9 fonts as it should. I've no idea what's 
inside the 3469.pdf.

  Paulo
- Original Message - 
From: Juan Antonio de la Puente 
To: itext-questions@lists.sourceforge.net 
Cc: Paulo Soares 
Sent: Saturday, March 20, 2010 11:13 AM
Subject: Re: [iText-questions] BaseFonts.getDocumentFonts crashes


Thanks, Paulo. Now it behaves like my modified version, i.e,. it lists only 
some of the fonts:

  $ listfonts 3469.pdf 
  QTRGMG+Arial-BoldMT
  IAJVTI+ArialMT

Where the full list should be much longer:

>  QTRGMG+Arial-BoldMT   
>   GFNNIT+CMTT8  
>   JEFAMC+CMTI8  
>   MPZVKG+CMR6   
>   FNBQTC+CMTI10 
>   RPBMZT+CMBX10 
>   XQSMYX+CMMI8  
>   VLZLUJ+CMMI12 
>   RJYCLB+CMR10  
>   VBWGVW+CMBX12 
>   VPWRDP+CMR7   
>   SDVCAT+CMSY7  
>   LBQTEY+CMR8   
>   IAJVTI+ArialMT
>   GFAWRG+CMSY10 
>   AZDNJY+CMSS10 
>   RSOCLK+CMSSI8 
>   OJXOVL+CMSSBX10   
>   TMCDBM+CMSY8  
>   NQQKKG+CMSS8  
>   DQLGMD+Helvetica-Oblique  
>   FDVTQC+Helvetica-Bold 
>   ZLWAXE+Helvetica  
>   VBMYEH+Helvetica  
>   XIWTIM+CMTT10  
> 

The same happens with other files, 

Best wishes,
-- Juan


> Fixed in the SVN.
> 
> Paulo
>   - Original Message - 
>   From: Juan Antonio de la Puente 
>   To: itext-questions@lists.sourceforge.net 
    >   Cc: Paulo Soares 
    >   Sent: Friday, March 19, 2010 11:43 AM
>   Subject: Re: [iText-questions] BaseFonts.getDocumentFonts crashes
> 
> 
>   Hi,
> 
>   The attached file fails with both the itext version of 
> BaseFont.getDocumentFonts and the modified version by me (include in the 
test 
> program, also attached). With the itext version the only result I get is 
> 
>   listfonts 3469.pdf 
>   null
> 
>   and with the modified version I get
> 
>   $ listfonts 3469.pdf 
>   QTRGMG+Arial-BoldMT
>   IAJVTI+ArialMT
> 
>   which only includes the TrueType fonts in the file. The full list, 
obtained 
> with a program based on a previous version of getDocumentFonts, should be:
> 
>   QTRGMG+Arial-BoldMT   
>   GFNNIT+CMTT8  
>   JEFAMC+CMTI8  
>   MPZVKG+CMR6   
>   FNBQTC+CMTI10 
>   RPBMZT+CMBX10 
>   XQSMYX+CMMI8  
>   VLZLUJ+CMMI12 
>   RJYCLB+CMR10  
>   VBWGVW+CMBX12 
>   VPWRDP+CMR7   
>   SDVCAT+CMSY7  
>   LBQTEY+CMR8   
>   IAJVTI+ArialMT
>   GFAWRG+CMSY10 
>   AZDNJY+CMSS10 
>   RSOCLK+CMSSI8 
>   OJXOVL+CMSSBX10   
>   TMCDBM+CMSY8  
>   NQQKKG+CMSS8  
>   DQLGMD+Helvetica-Oblique  
>   FDVTQC+Helvetica-Bold 
>   ZLWAXE+Helvetica  
>   VBMYEH+Helvetica  
>   XIWTIM+CMTT10  
> 
>   It looks like the font dictionaries are not properly read. Any ideas?
> 
>   -- Juan
> 
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
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
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] BaseFonts.getDocumentFonts crashes

2010-03-20 Thread Paulo Soares
The pdf you sent me (r50.pdf) lists 9 fonts as it should. I've no idea what's 
inside the 3469.pdf.

Paulo
  - Original Message - 
  From: Juan Antonio de la Puente 
  To: itext-questions@lists.sourceforge.net 
  Cc: Paulo Soares 
  Sent: Saturday, March 20, 2010 11:13 AM
  Subject: Re: [iText-questions] BaseFonts.getDocumentFonts crashes


  Thanks, Paulo. Now it behaves like my modified version, i.e,. it lists only 
some of the fonts:

$ listfonts 3469.pdf 
QTRGMG+Arial-BoldMT
IAJVTI+ArialMT

  Where the full list should be much longer:

  >  QTRGMG+Arial-BoldMT   
  >   GFNNIT+CMTT8  
  >   JEFAMC+CMTI8  
  >   MPZVKG+CMR6   
  >   FNBQTC+CMTI10 
  >   RPBMZT+CMBX10 
  >   XQSMYX+CMMI8  
  >   VLZLUJ+CMMI12 
  >   RJYCLB+CMR10  
  >   VBWGVW+CMBX12 
  >   VPWRDP+CMR7   
  >   SDVCAT+CMSY7  
  >   LBQTEY+CMR8   
  >   IAJVTI+ArialMT
  >   GFAWRG+CMSY10 
  >   AZDNJY+CMSS10 
  >   RSOCLK+CMSSI8 
  >   OJXOVL+CMSSBX10   
  >   TMCDBM+CMSY8  
  >   NQQKKG+CMSS8  
  >   DQLGMD+Helvetica-Oblique  
  >   FDVTQC+Helvetica-Bold 
  >   ZLWAXE+Helvetica  
  >   VBMYEH+Helvetica  
  >   XIWTIM+CMTT10  
  > 

  The same happens with other files, 

  Best wishes,
  -- Juan


  > Fixed in the SVN.
  > 
  > Paulo
  >   - Original Message - 
  >   From: Juan Antonio de la Puente 
  >   To: itext-questions@lists.sourceforge.net 
  >   Cc: Paulo Soares 
  >   Sent: Friday, March 19, 2010 11:43 AM
  >   Subject: Re: [iText-questions] BaseFonts.getDocumentFonts crashes
  > 
  > 
  >   Hi,
  > 
  >   The attached file fails with both the itext version of 
  > BaseFont.getDocumentFonts and the modified version by me (include in the 
test 
  > program, also attached). With the itext version the only result I get is 
  > 
  >   listfonts 3469.pdf 
  >   null
  > 
  >   and with the modified version I get
  > 
  >   $ listfonts 3469.pdf 
  >   QTRGMG+Arial-BoldMT
  >   IAJVTI+ArialMT
  > 
  >   which only includes the TrueType fonts in the file. The full list, 
obtained 
  > with a program based on a previous version of getDocumentFonts, should be:
  > 
  >   QTRGMG+Arial-BoldMT   
  >   GFNNIT+CMTT8  
  >   JEFAMC+CMTI8  
  >   MPZVKG+CMR6   
  >   FNBQTC+CMTI10 
  >   RPBMZT+CMBX10 
  >   XQSMYX+CMMI8  
  >   VLZLUJ+CMMI12 
  >   RJYCLB+CMR10  
  >   VBWGVW+CMBX12 
  >   VPWRDP+CMR7   
  >   SDVCAT+CMSY7  
  >   LBQTEY+CMR8   
  >   IAJVTI+ArialMT
  >   GFAWRG+CMSY10 
  >   AZDNJY+CMSS10 
  >   RSOCLK+CMSSI8 
  >   OJXOVL+CMSSBX10   
  >   TMCDBM+CMSY8  
  >   NQQKKG+CMSS8  
  >   DQLGMD+Helvetica-Oblique  
  >   FDVTQC+Helvetica-Bold 
  >   ZLWAXE+Helvetica  
  >   VBMYEH+Helvetica  
  >   XIWTIM+CMTT10  
  > 
  >   It looks like the font dictionaries are not properly read. Any ideas?
  > 
  >   -- Juan
  > 
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
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
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] BaseFonts.getDocumentFonts crashes

2010-03-20 Thread Juan Antonio de la Puente
Thanks, Paulo. Now it behaves like my modified version, i.e,. it lists only 
some of the fonts:

  $ listfonts 3469.pdf 
  QTRGMG+Arial-BoldMT
  IAJVTI+ArialMT

Where the full list should be much longer:

>  QTRGMG+Arial-BoldMT   
>   GFNNIT+CMTT8  
>   JEFAMC+CMTI8  
>   MPZVKG+CMR6   
>   FNBQTC+CMTI10 
>   RPBMZT+CMBX10 
>   XQSMYX+CMMI8  
>   VLZLUJ+CMMI12 
>   RJYCLB+CMR10  
>   VBWGVW+CMBX12 
>   VPWRDP+CMR7   
>   SDVCAT+CMSY7  
>   LBQTEY+CMR8   
>   IAJVTI+ArialMT
>   GFAWRG+CMSY10 
>   AZDNJY+CMSS10 
>   RSOCLK+CMSSI8 
>   OJXOVL+CMSSBX10   
>   TMCDBM+CMSY8  
>   NQQKKG+CMSS8  
>   DQLGMD+Helvetica-Oblique  
>   FDVTQC+Helvetica-Bold 
>   ZLWAXE+Helvetica  
>   VBMYEH+Helvetica  
>   XIWTIM+CMTT10  
> 

The same happens with other files, 

Best wishes,
-- Juan


> Fixed in the SVN.
> 
> Paulo
>   - Original Message - 
>   From: Juan Antonio de la Puente 
>   To: itext-questions@lists.sourceforge.net 
>   Cc: Paulo Soares 
>   Sent: Friday, March 19, 2010 11:43 AM
>   Subject: Re: [iText-questions] BaseFonts.getDocumentFonts crashes
> 
> 
>   Hi,
> 
>   The attached file fails with both the itext version of 
> BaseFont.getDocumentFonts and the modified version by me (include in the test 
> program, also attached). With the itext version the only result I get is 
> 
>   listfonts 3469.pdf 
>   null
> 
>   and with the modified version I get
> 
>   $ listfonts 3469.pdf 
>   QTRGMG+Arial-BoldMT
>   IAJVTI+ArialMT
> 
>   which only includes the TrueType fonts in the file. The full list, obtained 
> with a program based on a previous version of getDocumentFonts, should be:
> 
>   QTRGMG+Arial-BoldMT   
>   GFNNIT+CMTT8  
>   JEFAMC+CMTI8  
>   MPZVKG+CMR6   
>   FNBQTC+CMTI10 
>   RPBMZT+CMBX10 
>   XQSMYX+CMMI8  
>   VLZLUJ+CMMI12 
>   RJYCLB+CMR10  
>   VBWGVW+CMBX12 
>   VPWRDP+CMR7   
>   SDVCAT+CMSY7  
>   LBQTEY+CMR8   
>   IAJVTI+ArialMT
>   GFAWRG+CMSY10 
>   AZDNJY+CMSS10 
>   RSOCLK+CMSSI8 
>   OJXOVL+CMSSBX10   
>   TMCDBM+CMSY8  
>   NQQKKG+CMSS8  
>   DQLGMD+Helvetica-Oblique  
>   FDVTQC+Helvetica-Bold 
>   ZLWAXE+Helvetica  
>   VBMYEH+Helvetica  
>   XIWTIM+CMTT10  
> 
>   It looks like the font dictionaries are not properly read. Any ideas?
> 
>   -- Juan
> 


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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
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] BaseFonts.getDocumentFonts crashes

2010-03-19 Thread Paulo Soares
Fixed in the SVN.

Paulo
  - Original Message - 
  From: Juan Antonio de la Puente 
  To: itext-questions@lists.sourceforge.net 
  Cc: Paulo Soares 
  Sent: Friday, March 19, 2010 11:43 AM
  Subject: Re: [iText-questions] BaseFonts.getDocumentFonts crashes


  Hi,

  The attached file fails with both the itext version of 
BaseFont.getDocumentFonts and the modified version by me (include in the test 
program, also attached). With the itext version the only result I get is 

  listfonts 3469.pdf 
  null

  and with the modified version I get

  $ listfonts 3469.pdf 
  QTRGMG+Arial-BoldMT
  IAJVTI+ArialMT

  which only includes the TrueType fonts in the file. The full list, obtained 
with a program based on a previous version of getDocumentFonts, should be:

  QTRGMG+Arial-BoldMT   
  GFNNIT+CMTT8  
  JEFAMC+CMTI8  
  MPZVKG+CMR6   
  FNBQTC+CMTI10 
  RPBMZT+CMBX10 
  XQSMYX+CMMI8  
  VLZLUJ+CMMI12 
  RJYCLB+CMR10  
  VBWGVW+CMBX12 
  VPWRDP+CMR7   
  SDVCAT+CMSY7  
  LBQTEY+CMR8   
  IAJVTI+ArialMT
  GFAWRG+CMSY10 
  AZDNJY+CMSS10 
  RSOCLK+CMSSI8 
  OJXOVL+CMSSBX10   
  TMCDBM+CMSY8  
  NQQKKG+CMSS8  
  DQLGMD+Helvetica-Oblique  
  FDVTQC+Helvetica-Bold 
  ZLWAXE+Helvetica  
  VBMYEH+Helvetica  
  XIWTIM+CMTT10  

  It looks like the font dictionaries are not properly read. Any ideas?

  -- Juan

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
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
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] BaseFonts.getDocumentFonts crashes

2010-03-18 Thread Paulo Soares
I would like to see a PDF that triggers this problem.

Paulo


From: Juan Antonio de la Puente [jpue...@dit.upm.es]
Sent: Thursday, March 18, 2010 5:36 PM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] BaseFonts.getDocumentFonts crashes

Hi,

I have found that BaseFonts.getDocumentFonts throws a null pointer exception 
with some PDF files. I have traced the exception to the end of the 
recourseFonts method, in particular line 1449 of the BaseFonts source file:

1446   PdfDictionary xobj = resources.getAsDict(PdfName.XOBJECT);
1447if (xobj != null) {
1448for (Object element : xobj.getKeys()) {
1449recourseFonts(xobj.getAsDict((PdfName)element), hits, 
fonts, level);
1450}
1451}

It seems that xobj.getAsDict((PdfName)element returns a null value in some 
cases. I have changed the above code as follows:

PdfDictionary xobj = resources.getAsDict(PdfName.XOBJECT);
if (xobj != null) {
for (Object element : xobj.getKeys()) {
PdfDictionary dict = xobj.getAsDict((PdfName)element);
if (dict != null) recourseFonts(dict, hits, fonts, 
level);
}
}

and it works. Anybody has had the same problem?

-- Juan

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.


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
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
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] BaseFonts.getDocumentFonts crashes

2010-03-18 Thread Juan Antonio de la Puente
Hi,

I have found that BaseFonts.getDocumentFonts throws a null pointer exception 
with some PDF files. I have traced the exception to the end of the 
recourseFonts method, in particular line 1449 of the BaseFonts source file:

1446   PdfDictionary xobj = resources.getAsDict(PdfName.XOBJECT);
1447if (xobj != null) {
1448for (Object element : xobj.getKeys()) {
1449recourseFonts(xobj.getAsDict((PdfName)element), hits, 
fonts, level);
1450}
1451}

It seems that xobj.getAsDict((PdfName)element returns a null value in some 
cases. I have changed the above code as follows:

PdfDictionary xobj = resources.getAsDict(PdfName.XOBJECT);
if (xobj != null) {
for (Object element : xobj.getKeys()) {
PdfDictionary dict = xobj.getAsDict((PdfName)element);
if (dict != null) recourseFonts(dict, hits, fonts, 
level);
}
}

and it works. Anybody has had the same problem? 

-- Juan




--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
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
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/