Class: Cairo::PDFSurface

Inherits:
Surface show all
Defined in:
ext/cairo/rb_cairo_surface.c

Instance Method Summary collapse

Methods inherited from Surface

#clone, #content, #copy_page, #create_similar, #create_similar_image, #destroy, #device, #device_offset, #device_scale, #dup, #fallback_resolution, #finish, #flush, #font_options, #get_mime_data, gl_supported?, gl_texture_supported?, image_supported?, #map_to_image, #mark_dirty, pdf_supported?, ps_supported?, quartz_image_supported?, quartz_supported?, recording_supported?, script_supported?, #set_device_offset, #set_device_scale, #set_fallback_resolution, #set_mime_data, #show_page, #sub_rectangle_surface, supported?, #supported_mime_type?, svg_supported?, tee_supported?, #unmap_image, win32_printing_supported?, win32_supported?, #write_to_png, xml_supported?

Constructor Details

#initializeObject

Instance Method Details

#add_outlineObject



1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
# File 'ext/cairo/rb_cairo_surface.c', line 1182

static VALUE
cr_pdf_surface_add_outline (VALUE self,
                            VALUE rb_parent_id,
                            VALUE rb_name,
                            VALUE rb_destination,
                            VALUE rb_flags)
{
  cairo_surface_t *surface;
  int parent_id;
  const char *name;
  const char *destination;
  cairo_pdf_outline_flags_t flags;
  int id;

  surface = _SELF;
  if (NIL_P (rb_parent_id))
    parent_id = 0;
  else
    parent_id = NUM2INT (rb_parent_id);
  name = RVAL2CSTR (rb_name);
  destination = RVAL2CSTR (rb_destination);
  if (NIL_P (rb_flags))
    flags = 0;
  else
    flags = RVAL2CRPDFOUTLINEFLAGS (rb_flags);
  id = cairo_pdf_surface_add_outline (surface,
                                      parent_id,
                                      name,
                                      destination,
                                      flags);
  rb_cairo_surface_check_status (surface);

  if (id == 0)
    return Qnil;
  else
    return INT2NUM (id);
}

#restrict_to_versionObject

#set_metadataObject



1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
# File 'ext/cairo/rb_cairo_surface.c', line 1220

static VALUE
cr_pdf_surface_set_metadata (VALUE self,
                             VALUE rb_metadata,
                             VALUE rb_value)
{
  cairo_surface_t *surface;
  cairo_pdf_metadata_t metadata;
  const char *value;

  surface = _SELF;
  metadata = RVAL2CRPDFMETADATA (rb_metadata);
  switch (metadata)
    {
    case CAIRO_PDF_METADATA_CREATE_DATE:
    case CAIRO_PDF_METADATA_MOD_DATE:
      if (rb_cairo__is_kind_of (rb_value, rb_cTime))
        {
          ID id_iso8601;
          CONST_ID(id_iso8601, "iso8601");
          rb_value = rb_funcall (rb_value, id_iso8601, 0);
        }
      break;
    default:
      break;
    }
  value = RVAL2CSTR (rb_value);
  cairo_pdf_surface_set_metadata (surface, metadata, value);
  rb_cairo_surface_check_status (surface);

  return Qnil;
}

#set_page_labelObject



1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
# File 'ext/cairo/rb_cairo_surface.c', line 1252

static VALUE
cr_pdf_surface_set_page_label (VALUE self,
                               VALUE rb_label)
{
  cairo_surface_t *surface;
  const char *label;

  surface = _SELF;
  label = RVAL2CSTR (rb_label);
  cairo_pdf_surface_set_page_label (surface, label);
  rb_cairo_surface_check_status (surface);

  return Qnil;
}

#set_sizeObject

#set_thumbnail_sizeObject



1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
# File 'ext/cairo/rb_cairo_surface.c', line 1267

static VALUE
cr_pdf_surface_set_thumbnail_size (VALUE self,
                                   VALUE rb_width,
                                   VALUE rb_height)
{
  cairo_surface_t *surface;
  int width;
  int height;

  surface = _SELF;
  width = NUM2INT (rb_width);
  height = NUM2INT (rb_height);
  cairo_pdf_surface_set_thumbnail_size (surface, width, height);
  rb_cairo_surface_check_status (surface);

  return Qnil;
}