PDFImageOutput Device

PDFImage

class pyxpdf.xpdf.PDFImage

Represents a PDF Image.

Image Colorspace:
  • gray : DeviceGray, CalGray

  • rgb : DeviceRGB, CalRGB

  • cmyk : DeviceCMYK

  • lab : Lab

  • icc : ICCBased

  • index : Indexed

  • sep : Sepration

  • devn : DeviceN

Image Compression:
  • ccitt : CCITTFax

  • jpeg : DCT

  • jpx : JPX

  • jbig2 : JBIG2

  • flate : Flate

  • lzw : LZW

  • rle : RunLength

bbox

Image’s Boundary Box (BBox)

Type

tuple of float

image

Image data as Pillow Image

Type

Image

page_index

Index of Image’s PDF page

Type

int

interpolate

Whether image is interpolated or not

Type

bool

is_inline

Whether image is inline or not

Type

bool

hDPI

Image’s horizontal DPI

Type

float

vDPI

Image’s vertical DPI

Type

float

colorspace

Image’s color space.

Type

{‘gray’, ‘rgb’, ‘cmyk’, ‘lab’, ‘icc’, ‘index’, ‘sep’, ‘devn’, ‘unknown’}

components

components in the image’s colorspace.

Type

int

bpc

bits per component.

Type

int

compression

Image’s compression

Type

{‘ccitt’, ‘jpeg’, ‘jpx’, ‘jbig2’, ‘flate’, ‘lzw’, ‘rle’, ‘unknown’}

PDFImageOutput

class pyxpdf.xpdf.PDFImageOutput

Extract the images from PDF Document

Extract and decode images inside a PDF and output them as Image object.

Parameters

doc (Document) – PDF Document for this output device

Note

Requires Optional dependency Pillow module

get(self, page_no)list

Get all the images from page_no indexed page.

Parameters

page_no (int) – index of page to render

Returns

All the images in PDF Page

Return type

list of PDFImage