note 11776 deleted from ref.cpdf by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 22:25:26 +0000 |
| Subject: | note 11776 deleted from ref.cpdf by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22302@lists.php.net to get a copy of this message | ||
Here's a patch to enable cpdf_set_viewer_preferences(int pdf document, int pagemode);
The basic stuff was there, I am no programmer but I needed this function so I hacked around till I
made it work.
If this is the wrong place to post it, please let me know. Anyways, this lets you add the pagemode
as described in the ClibPDF manual.
0 = default, no outline or thumbnails
1 = outlines, open with outlines visible
2 = thumbs, open with thumbnails visible
3 = fullscreen, open in fullscreen mode
No responsibilities accepted for this one, as I said - I am no programmer but
it works for me.
-----Patch start ----
--- php-4.0.4pl1/ext/cpdf/cpdf.c Wed Oct 25 19:43:49 2000
+++ php-4.0.4pl1/ext/cpdf/cpdf.c Tue Mar 6 19:51:41 2001
@@ -338,6 +339,7 @@
/* {{{ proto void cpdf_set_viewer_preferences(int pdfdoc, int pagemode)
How to show the document by the viewer */
PHP_FUNCTION(cpdf_set_viewer_preferences) {
+ CPDFviewerPrefs vP = { 0, 0, 0, 0, 0, 0, 0, 0 };
pval *argv[6];
int id, type, pagemode;
int argc;
@@ -361,6 +363,9 @@
}
/* cpdf_setViewerPreferences(pdf, pagemode, 0, 0, 0, 0, 0, 0, pagemode); */
+ vP.pageMode=pagemode;
+ vP.nonFSPageMode=pagemode;
+ cpdf_setViewerPreferences(pdf, &vP);
RETURN_TRUE;
}
-------Patch end--------