Skip to content

JpegImage ​

Defined in: components/image/jpeg.ts:7

Implements ​

Constructor components/image/jpeg.ts:18 ​

new JpegImage(source, options?): JpegImage

Parameters ​

ParameterType
sourceany
options?ImageOptions

Returns ​

JpegImage

Properties ​

PropertyModifierType
align
jpeg.ts:11
public"left" | "center" | "right"
height?
jpeg.ts:10
publicnumber
source
jpeg.ts:8
publicany
width?
jpeg.ts:9
publicnumber

Methods ​

draw() components/image/jpeg.ts:71 ​

draw(writer, x, y, width, availableHeight, _context): Component | null

Draws the component (or a part of it) on the page.

Parameters ​

ParameterTypeDescription
writerPDFPageWriterThe page writer to issue commands to.
xnumberThe current relative X coordinate from the left margin.
ynumberThe current relative Y coordinate from the bottom margin (top boundary of the element).
widthnumberThe width constraint allocated to this element.
availableHeightnumberThe height constraint representing remaining space on the current page.
_contextLayoutContext-

Returns ​

Component | null

A new Component representing the remainder of this component if it could not finish rendering, or null if it rendered completely.

Implementation of ​

Component.draw

measure() components/image/jpeg.ts:66 ​

measure(_width, _context): object

Returns the width and height required by this component when rendered within a given width constraint.

Parameters ​

ParameterType
_widthnumber
_contextLayoutContext

Returns ​

object

NameType
height
jpeg.ts:66
number
width
jpeg.ts:66
number

Implementation of ​

Component.measure

Released under the MIT License.