Ximage
Vue de l’ensemble
‘XImage’ est une classe dans Aspose.PDF FOSS pour Java.
Représente une image XObject dans un document PDF (ISO 32000-1:2008, §8.9, Table 89).
Cette classe fournit 15 méthodes pour travailler avec des objets XImage dans les programmes Java. Les méthodologies disponibles comprennent: ‘XImages’, ‘delete’, getBitsPerComponent', ‘getColorSpace’, 'getDecodedData', ’getEncodéDate', ‚getHeight, ‘gettName , ' getPdfStream et 3 méthode supplémentaires. Tous les membres publics sont accessibles à toute application Java après l’installation de l’Aspose.PDF FOSS pour le package Java . Propriétés : ‘bits PerCompondent ; 'colorSpACE; ‘decodéeDat’ ; ‘encodéesDats: haute image,Mask` etc.
Propriétés
| Name | Type | Access | Description |
|---|---|---|---|
width | int | Read | Returns the image width in pixels (/Width). |
height | int | Read | Returns the image height in pixels (/Height). |
bitsPerComponent | int | Read | Returns the bits per component (/BitsPerComponent). |
name | String | Read | Returns the resource name of this image (e.g., “Im1”). |
colorSpace | ColorSpaceBase | Read | Returns the color space of this image. |
imageMask | boolean | Read | Returns whether this is an image mask (1-bit stencil). |
decodedData | byte[] | Read | Returns the decoded image data (raw pixel bytes after filter decompression). |
encodedData | byte[] | Read | Returns the raw encoded stream data (e.g., raw JPEG bytes for DCTDecode). |
pdfStream | PdfStream | Read | Returns the underlying PDF stream. |
méthodes
| Signature | Description |
|---|---|
XImage(stream: PdfStream, name: String, parser: PDFParser) | Creates an XImage from an image XObject stream. |
getWidth() → int | Returns the image width in pixels (/Width). |
getHeight() → int | Returns the image height in pixels (/Height). |
getBitsPerComponent() → int | Returns the bits per component (/BitsPerComponent). |
getName() → String | Returns the resource name of this image (e.g., “Im1”). |
setName(newName: String) | Sets the name of this image resource, updating both the Java field |
| and the key in the parent /XObject dictionary (if known). | |
getColorSpace() → ColorSpaceBase | Returns the color space of this image. |
isImageMask() → boolean | Returns whether this is an image mask (1-bit stencil). |
getDecodedData() → byte[] | Returns the decoded image data (raw pixel bytes after filter decompression). |
getEncodedData() → byte[] | Returns the raw encoded stream data (e.g., raw JPEG bytes for DCTDecode). |
save(output: OutputStream) | Saves the image to an output stream. |
toBufferedImage() → BufferedImage | Converts this image to a {@link BufferedImage}. |
delete() | Deletes this image from the parent XObject dictionary. |
replace(newImageStream: InputStream) | Replaces this image with data from an input stream. |
getPdfStream() → PdfStream | Returns the underlying PDF stream. |
Voir aussi
- Aspose.PDF pour Java — API d’entreprise