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?, #reference_count, 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



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
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
# File 'ext/cairo/rb_cairo_surface.c', line 1194

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



1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
# File 'ext/cairo/rb_cairo_surface.c', line 1232

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



1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
# File 'ext/cairo/rb_cairo_surface.c', line 1264

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



1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
# File 'ext/cairo/rb_cairo_surface.c', line 1279

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;
}