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

NameTypeAccessDescription
widthintReadReturns the image width in pixels (/Width).
heightintReadReturns the image height in pixels (/Height).
bitsPerComponentintReadReturns the bits per component (/BitsPerComponent).
nameStringReadReturns the resource name of this image (e.g., “Im1”).
colorSpaceColorSpaceBaseReadReturns the color space of this image.
imageMaskbooleanReadReturns whether this is an image mask (1-bit stencil).
decodedDatabyte[]ReadReturns the decoded image data (raw pixel bytes after filter decompression).
encodedDatabyte[]ReadReturns the raw encoded stream data (e.g., raw JPEG bytes for DCTDecode).
pdfStreamPdfStreamReadReturns the underlying PDF stream.

méthodes

SignatureDescription
XImage(stream: PdfStream, name: String, parser: PDFParser)Creates an XImage from an image XObject stream.
getWidth()intReturns the image width in pixels (/Width).
getHeight()intReturns the image height in pixels (/Height).
getBitsPerComponent()intReturns the bits per component (/BitsPerComponent).
getName()StringReturns 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()ColorSpaceBaseReturns the color space of this image.
isImageMask()booleanReturns 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()BufferedImageConverts 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()PdfStreamReturns the underlying PDF stream.

Voir aussi

  • Aspose.PDF pour Java — API d’entreprise
 Français