[gs-cvs] rev 9788 - trunk/gs/base
ken at ghostscript.com
ken at ghostscript.com
Wed Jun 10 06:10:31 PDT 2009
Author: ken
Date: 2009-06-10 06:10:31 -0700 (Wed, 10 Jun 2009)
New Revision: 9788
Modified:
trunk/gs/base/gdevpdfm.c
Log:
Fix (pdfwrite): Bug in pdfmark processing
Details
Bug #690525 "hyperlinks in pdf off by one page since revision 9779"
Revision 9779 fixed a problem when a DOCVIEW pdfmark did not specify a /Page or View to
open the file on. This caused an extra page reference to be created, which caused an
invalid xref to be created.
This was fixed by altering the page count, but this caused real DEST pdfmarks not to
work properly under some conditions.
Restored the page count, and used the presence of either a /Page or /View pdfmark to
generate a page number, if neither is present no page number is created. This fixes
both issues.
Expected Differences
None
Modified: trunk/gs/base/gdevpdfm.c
===================================================================
--- trunk/gs/base/gdevpdfm.c 2009-06-09 21:37:42 UTC (rev 9787)
+++ trunk/gs/base/gdevpdfm.c 2009-06-10 13:10:31 UTC (rev 9788)
@@ -107,8 +107,7 @@
{
int page = pdev->next_page + 1;
- if (pnstr->data == 0)
- page -= 1;
+ if (pnstr->data == 0);
else if (pdf_key_eq(pnstr, "/Next"))
++page;
else if (pdf_key_eq(pnstr, "/Prev"))
@@ -132,10 +131,12 @@
int present =
pdfmark_find_key(Page_key, pairs, count, &page_string) +
pdfmark_find_key(View_key, pairs, count, &view_string);
- int page = pdfmark_page_number(pdev, &page_string);
+ int page=0;
gs_param_string action;
int len;
+ if (present)
+ page = pdfmark_page_number(pdev, &page_string);
if (view_string.size == 0)
param_string_from_string(view_string, "[/XYZ null null null]");
if (page == 0)
More information about the gs-cvs
mailing list