Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

poppler_attachment:save method

  • Loading branch information...
commit 87e246f6c7cdae2b1bb8d6cb0594087e5c5c2b0b 1 parent d9b06cb
authored April 27, 2009

Showing 2 changed files with 20 additions and 2 deletions. Show diff stats Hide diff stats

  1. 21  Poppler.xs
  2. 1  typemap
21  Poppler.xs
@@ -26,6 +26,8 @@ typedef struct {
26 26
     PopplerAttachment *handle;
27 27
 } hPopplerAttachment;
28 28
 
  29
+
  30
+
29 31
 typedef struct {
30 32
     double w;
31 33
     double h;
@@ -106,7 +108,7 @@ PPCODE:
106 108
     list = (GList*) poppler_document_get_attachments( THIS->handle );
107 109
     for (i = list; i != NULL; i = i->next) {
108 110
         SV * sv;
109  
-        SV * pv;
  111
+        hPopplerDocument * pv;
110 112
         Newz(0, pv, 1, hPopplerDocument );
111 113
         sv_setref_pv( sv , "Poppler::Attachment" , (void*) pv );
112 114
         XPUSHs ( sv_2mortal( sv ) );
@@ -133,6 +135,8 @@ OUTPUT:
133 135
 
134 136
 
135 137
 
  138
+
  139
+
136 140
 hPopplerPage*
137 141
 hPopplerDocument::get_page( page_num );
138 142
     int page_num;
@@ -256,6 +260,17 @@ OUTPUT:
256 260
 
257 261
 MODULE = Poppler    PACKAGE = Poppler::Attachment
258 262
 
  263
+int
  264
+hPopplerAttachment::save( filename );
  265
+    char * filename;
  266
+PREINIT:
  267
+    GError **error;
  268
+    gboolean ret;
  269
+CODE:
  270
+    ret = poppler_attachment_save( THIS->handle , filename , error );
  271
+    RETVAL = ( ret == TRUE ) ? 1 : 0;
  272
+OUTPUT:
  273
+    RETVAL
259 274
 
260 275
 
261 276
 MODULE = Poppler    PACKAGE = Poppler::Page::Dimension
@@ -274,6 +289,8 @@ CODE:
274 289
 OUTPUT:
275 290
     RETVAL
276 291
 
277  
-    
  292
+
  293
+
  294
+
278 295
 
279 296
 
1  typemap
@@ -4,6 +4,7 @@ TYPEMAP
4 4
 PopplerDocument * T_PTROBJ
5 5
 hPopplerDocument * T_OBJECT
6 6
 hPopplerPage * T_OBJECT
  7
+hPopplerAttachment * T_OBJECT
7 8
 hPageDimension * T_OBJECT
8 9
 
9 10
 PopplerPage * T_PTROBJ

0 notes on commit 87e246f

Please sign in to comment.
Something went wrong with that request. Please try again.