From: sergej dot kurakin at delfi dot lt
Operating system: WinXP SP1 / Win2K SP4
PHP version: 4.3.11
PHP Bug Type: ClibPDF related
Bug description: Bookmark in PDF links to wrong page
Description:
------------
Some modified code from manual, create 2 pages in PDF file
Reproduce code:
---------------
<?php
$cpdf = cpdf_open(0);
cpdf_page_init($cpdf, 1, 0, 595, 842, 1.0);
$b = cpdf_add_outline($cpdf, 0, 0, 0, 1, "Page 1");
cpdf_begin_text($cpdf);
cpdf_set_font($cpdf, "Times-Roman", 30, "WinAnsiEncoding");
cpdf_set_text_rendering($cpdf, 1);
cpdf_text($cpdf, "Times Roman outlined", 50, 50);
cpdf_end_text($cpdf);
cpdf_moveto($cpdf, 50, 50);
cpdf_lineto($cpdf, 740, 330);
cpdf_stroke($cpdf);
cpdf_finalize_page($cpdf, 1);
cpdf_page_init($cpdf, 2, 0, 595, 842, 1.0);
cpdf_add_outline($cpdf, $b, 0, 0, 2, "Page 2");
cpdf_begin_text($cpdf);
cpdf_set_font($cpdf, "Times-Roman", 30, "WinAnsiEncoding");
cpdf_set_text_rendering($cpdf, 1);
cpdf_text($cpdf, "Times Roman outlined", 50, 50);
cpdf_end_text($cpdf);
cpdf_moveto($cpdf, 50, 50);
cpdf_lineto($cpdf, 740, 330);
cpdf_stroke($cpdf);
cpdf_finalize_page($cpdf, 2);
cpdf_finalize($cpdf);
Header("Content-type: application/pdf");
cpdf_output_buffer($cpdf);
cpdf_close($cpdf);
?>
Expected result:
----------------
2 Pages + 2 Bookmarks, Bookmark "Page 1" refers to first page, "Page 2" to
second page.
Actual result:
--------------
2 Pages + 2 Bookmarks, Bookmark "Page 1" refers to second page, "Page 2"
to second (or not) page.
--
Edit bug report at http://bugs.php.net/?id=32905&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32905&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32905&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32905&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32905&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32905&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32905&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32905&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32905&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32905&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32905&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32905&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32905&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32905&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32905&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32905&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32905&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32905&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32905&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32905&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32905&r=mysqlcfg