php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14377 incorrect font id with pdf_get_value ('ascender',$fontid)
Submitted: 2001-12-07 08:24 UTC Modified: 2001-12-07 10:07 UTC
From: ivan dot lamouret at novitek dot fr Assigned:
Status: Closed Package: PDF related
PHP Version: 4.0.6 OS: linux suse
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ivan dot lamouret at novitek dot fr
New email:
PHP Version: OS:

 

 [2001-12-07 08:24 UTC] ivan dot lamouret at novitek dot fr
pdf_get_value for font metrics keys, with font descriptor modifier does not handle the descriptor correctly:

example code :

$pdf = pdf_new();
pdf_open_file($pdf, "");
pdf_begin_page($pdf, 595, 842);
$font = pdf_findfont($pdf, "Times-Roman", "winansi",0); 
pdf_get_value($pdf,'ascender',$font);
pdf_end_page($pdf);
pdf_close($pdf);

output:
Fatal error: PDFlib error: Bad font descriptor 1 in PDF_get_value/descender 

fix: 
pdf_get_value($pdf,'descender',$font-1);

When several fonts are (pre-)loaded, only query to the last one fails. The returned value for the others are probably mixed up. 
PDFlib GmbH Version 4.0.1 
Revision $Revision: 1.79.2.1 $ 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-07 10:07 UTC] rjs@php.net
This is allready fixed in the current CVS Version. Also the next minor Release of PDFlib (V4.0.2) will contain the bugfix in the companion wrapper code.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 00:01:33 2024 UTC