private float[] extractMatte(PDImageXObject softMask) throws IOException { COSBase base = softMask.getCOSObject().getItem(COSName.MATTE); float[] matte = null; if (base instanceof COSArray) { // PDFBOX-4267: process /Matte // see PDF specification 1.7, 11.6.5.3 Soft-Mask Images matte = ((COSArray) base).toFloatArray(); // convert to RGB matte = getColorSpace().toRGB(matte); } return matte; }
if (image != null) { if ("jpg".equals(suffix)) { String colorSpaceName = pdImage.getColorSpace().getName();
if (pdImageXObject != null) if (pdImageXObject.getColorSpace() == PDDeviceRGB.INSTANCE && pdImageXObject.getBitsPerComponent() < 16 && image.getWidth() * image.getHeight() <= 50 * 50)
if (img.getColorSpace() instanceof PDICCBased) InputStream is = ((PDICCBased) img.getColorSpace()).getPDStream().createInputStream(); FileOutputStream fos = new FileOutputStream(System.currentTimeMillis() + ".icc"); IOUtils.copy(is, fos);
pdProfile = imageXObject.getColorSpace(); if (pdProfile instanceof PDICCBased) { profileMap.put(new ProfileSoftReference(profile),
private float[] extractMatte(PDImageXObject softMask) throws IOException { COSBase base = softMask.getCOSObject().getItem(COSName.MATTE); float[] matte = null; if (base instanceof COSArray) { // PDFBOX-4267: process /Matte // see PDF specification 1.7, 11.6.5.3 Soft-Mask Images matte = ((COSArray) base).toFloatArray(); // convert to RGB matte = getColorSpace().toRGB(matte); } return matte; }
imageContentStream.close(); PDColorSpace patternCS1 = new PDPattern(null, imageXObject.getColorSpace()); COSName tilingPatternName = state.resources.add(pattern); PDColor patternColor = new PDColor(tilingPatternName, patternCS1);
if (image != null) { if ("jpg".equals(suffix)) { String colorSpaceName = pdImage.getColorSpace().getName();
if (image != null) { if ("jpg".equals(suffix)) { String colorSpaceName = pdImage.getColorSpace().getName();
if (image != null) { if ("jpg".equals(suffix)) { String colorSpaceName = pdImage.getColorSpace().getName();
if (pdImageXObject != null) if (pdImageXObject.getColorSpace() == PDDeviceRGB.INSTANCE && pdImageXObject.getBitsPerComponent() < 16 && image.getWidth() * image.getHeight() <= 50 * 50)
PDImageXObject cloneImage = new PDImageXObject(_writer, inputStream, COSName.FLATE_DECODE, xobject.getWidth(), xobject.getHeight(), xobject.getBitsPerComponent(), xobject.getColorSpace()); cloneImage.setInterpolate(false); if (xobject.getSoftMask() != null)
PDImageXObject cloneImage = new PDImageXObject(_writer, inputStream, COSName.FLATE_DECODE, xobject.getWidth(), xobject.getHeight(), xobject.getBitsPerComponent(), xobject.getColorSpace()); cloneImage.setInterpolate(false); if (xobject.getSoftMask() != null)
PDImageXObject cloneImage = new PDImageXObject(_writer, inputStream, COSName.FLATE_DECODE, xobject.getWidth(), xobject.getHeight(), xobject.getBitsPerComponent(), xobject.getColorSpace()); cloneImage.setInterpolate(false); if (xobject.getSoftMask() != null)
PDImageXObject cloneImage = new PDImageXObject(_writer, inputStream, COSName.FLATE_DECODE, xobject.getWidth(), xobject.getHeight(), xobject.getBitsPerComponent(), xobject.getColorSpace()); cloneImage.setInterpolate(false); if (xobject.getSoftMask() != null)