php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32905 Bookmark in PDF links to wrong page
Submitted: 2005-05-01 17:25 UTC Modified: 2005-08-30 12:31 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: sergej dot kurakin at delfi dot lt Assigned: steinm (profile)
Status: Not a bug Package: ClibPDF related
PHP Version: 4.3.11 OS: WinXP SP1 / Win2K SP4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sergej dot kurakin at delfi dot lt
New email:
PHP Version: OS:

 

 [2005-05-01 17:25 UTC] sergej dot kurakin at delfi dot lt
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-18 18:31 UTC] tony2001@php.net
Assigned to the maintainer.
 [2005-05-18 20:17 UTC] steinm@php.net
I couldn't reproduce this bug on a linux system. Would it be possible for the initial poster to send me the pdf file.
 [2005-05-19 08:47 UTC] sergej dot kurakin at delfi dot lt
I'v send a code and pdf, generated on my sistem.
 [2005-06-06 10:26 UTC] steinm@php.net
This bug seems to be pdf viewer depended. It can be reproduced on:
Windows in Adobe Acrobat Reader 5 and 6, Foxit PDF Reader

I cannot be reproduced on:
Windows in Adobe Acrobat Reader 7
MAC OS X in Adobe Acrobat Reader 6 and 7
Linux
 [2005-08-30 12:31 UTC] sniper@php.net
Viewer bugs are not PHP bugs..
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC