Attach (recommended) or Link to PDF file here:

Configuration:
- Web browser and its version: Chrome 91.0.4472.124
- Operating system and its version: Win 10
- PDF.js version: 2.8.335
- Is a browser extension: Nope.

I'm trying to list and extract data form each element of a form created in a PDF file.
I have some image elements detected as Btn (button) and without any indice about the image.

`const items = await pdfPage.getAnnotations();

for (const item of items) {

    // With 'TestImage' as the name of one on my image elements
    if (item.fieldName === 'TestImage') {
        console.log('TestImage', item);
    }
}`

Gives:

TestImage 
{annotationFlags: 4, borderStyle: {…}, color: Uint8ClampedArray(3), contents: "", hasAppearance: true, …}
actions: {Action: Array(1)}
alternativeText: ""
annotationFlags: 4
annotationType: 20
borderStyle:
    dashArray: [3]
    horizontalCornerRadius: 0
    style: 1
    verticalCornerRadius: 0
    width: 0
checkBox: false
color: 
Uint8ClampedArray(3) 
[0, 0, 0]
contents: ""
defaultAppearanceData:
    fontColor: Uint8ClampedArray(3) [0, 0, 0]
    fontName: "HeBo"
    fontSize: 12
defaultFieldValue: null
fieldFlags: 65536
**fieldName: "TestImage"**
**fieldType: "Btn"**
fieldValue: null
hasAppearance: true
hidden: false
id: "57R"
isTooltipOnly: false
modificationDate: null
pushButton: true
radioButton: false
readOnly: false
rect: (4) [383.563, 623.486, 527.808, 744.176]
subtype: "Widget"

Any idea?

In front of that, I'm able to get images from regular image fields (out of Forms) without any context (the  location and the size used in the PDF):


```
// Potential image types
const imagesObjectsTypes = [
    pdfjsLib.OPS.paintImageMaskXObject,
    pdfjsLib.OPS.paintImageMaskXObjectGroup,
    pdfjsLib.OPS.paintImageXObject, // <- 85
    pdfjsLib.OPS.paintInlineImageXObject,
    pdfjsLib.OPS.paintInlineImageXObjectGroup,
    pdfjsLib.OPS.paintImageXObjectRepeat,
    pdfjsLib.OPS.paintImageMaskXObjectRepeat,   
];

const operatorsList = await pdfPage.getOperatorList();

for (let i = 0; i < operatorsList.fnArray.length; i++) {

    const type = operatorsList.fnArray[i];

    if (imagesObjectsTypes.indexOf(type) >= 0) {

        const image = pdfPage.objs.get(operatorsList.argsArray[i][0]);

        console.log('Image detected:')
        console.log(image);
        console.log(operatorsList.argsArray[i]);
    }
}

```
Gives

Image detected:
width: 1067,
height: 600,
kind: 2, data: Uint8ClampedArray(1920600)} data: Uint8ClampedArray(1920600) [ …],
height: 600,
kind: 2,
width: 1067,

0: "img_p0_3"
1: 1067
2: 600

Thank you :)





* Page render parameters.
 *
 * @typedef {Object} RenderParameters
 * @property {Object} canvasContext - A 2D context of a DOM Canvas object.
 * @property {PageViewport} viewport - Rendering viewport obtained by calling
 *   the `PDFPageProxy.getViewport` method.
 * @property {string} [intent] - Rendering intent, can be 'display' or 'print'.
 *   The default value is 'display'.
 * @property {boolean} [renderInteractiveForms] - Whether or not interactive
 *   form elements are rendered in the display layer. If so, we do not render
 *   them on the canvas as well. The default value is `false`.
 * @property {Array<any>} [transform] - Additional transform, applied just
 *   before viewport transform.
 * @property {Object} [imageLayer] - An object that has `beginLayout`,
 *   `endLayout` and `appendImage` functions.
 * @property {Object} [canvasFactory] - The factory instance that will be used
 *   when creating canvases. The default value is {new DOMCanvasFactory()}.
 * @property {Object | string} [background] - Background to use for the canvas.
 *   Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS
 *   <color> value, a `CanvasGradient` object (a linear or radial gradient) or
 *   a `CanvasPattern` object (a repetitive image). The default value is
 *   'rgb(255,255,255)'.
 * @property {boolean} [includeAnnotationStorage] - Render stored interactive
 *   form element data, from the {@link AnnotationStorage}-instance, onto the
 *   canvas itself; useful e.g. for printing. The default value is `false`.
 * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -
 *   A promise that should resolve with an {@link OptionalContentConfig}
 *   created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,
 *   the configuration will be fetched automatically with the default visibility
 *   states set.