Vips.Image.pdfload
Description: Reference for Vips.Image.pdfload

### Constructor

# Vips Imagepdfload

#### Declaration [src]

    int
    vips_pdfload (
      const char* filename,
      VipsImage** out,
      ...
    )

#### Description [src]

Render a PDF file into a VIPS image.

The output image is always RGBA — CMYK PDFs will be converted. If you need CMYK bitmaps, you should use `vips_magickload()` instead.

Use `page` to select a page to render, numbering from zero.

Use `n` to select the number of pages to render. The default is 1. Pages are rendered in a vertical column, with each individual page aligned to the left. Set to -1 to mean “until the end of the document”. Use `vips_grid()` to change page layout.

Use `dpi` to set the rendering resolution. The default is 72. Additionally, you can scale by setting `scale`. If you set both, they combine.

Use `background` to set the background RGBA colour. The default is 255 (solid white), use eg. 0 for a transparent background.

Use `password` to supply a decryption password.

When using pdfium, the region of a page to render can be selected with `page_box`, defaulting to the crop box.

The operation fills a number of header fields with metadata, for example “pdf-author”. They may be useful.

This function only reads the image header and does not render any pixel data. Rendering occurs when pixels are accessed.

Optional arguments

- `page`: `gint`, load this page, numbered from zero
- `n`: `gint`, load this many pages
- `dpi`: `gdouble`, render at this DPI
- `scale`: `gdouble`, scale render by this factor
- `background`: `VipsArrayDouble`, background colour
- `page_box`: `VipsForeignPdfPageBox`, use this page box (pdfium only)

See also

`vips_image_new_from_file()`, `vips_magickload()`.

This constructor is not directly available to language bindings.

#### Parameters

`filename`

  Type: `const char*`

  File to load.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`out`

  Type: `VipsImage`

  Output image.

  The argument will be set by the function.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.

`...`

  Type: ``

  `NULL`-terminated list of optional named arguments.

#### Return value

Type: `int`

0 on success, -1 on error.