Tabnine Logo
PDInlineImage
Code IndexAdd Tabnine to your IDE (free)

How to use
PDInlineImage
in
org.apache.pdfbox.pdmodel.graphics.image

Best Java code snippets using org.apache.pdfbox.pdmodel.graphics.image.PDInlineImage (Showing top 20 results out of 315)

origin: apache/pdfbox

@Override
public void process(Operator operator, List<COSBase> operands) throws IOException
{
  if (operator.getImageData() == null || operator.getImageData().length == 0)
  {
    return;
  }
  PDImage image = new PDInlineImage(operator.getImageParameters(),
                   operator.getImageData(),
                   context.getResources());
  context.drawImage(image);
}
origin: apache/pdfbox

@Override
public InputStream createInputStream(List<String> stopFilters) throws IOException
{
  List<String> filters = getFilters();
  ByteArrayInputStream in = new ByteArrayInputStream(rawData);
  ByteArrayOutputStream out = new ByteArrayOutputStream(rawData.length);
  for (int i = 0; filters != null && i < filters.size(); i++)
  {
    // TODO handling of abbreviated names belongs here, rather than in other classes
    out.reset();
    if (stopFilters.contains(filters.get(i)))
    {
      break;
    }
    else
    {
      Filter filter = FilterFactory.INSTANCE.getFilter(filters.get(i));
      filter.decode(in, out, parameters, i);
      in = new ByteArrayInputStream(out.toByteArray());
    }
  }
  return new ByteArrayInputStream(out.toByteArray());
}
origin: apache/pdfbox

@Override
public PDColorSpace getColorSpace() throws IOException
{
  COSBase cs = parameters.getDictionaryObject(COSName.CS, COSName.COLORSPACE);
  if (cs != null)
  {
    return createColorSpace(cs);
  }
  else if (isStencil())
  {
    // stencil mask color space must be gray, it is often missing
    return PDDeviceGray.INSTANCE;
  }
  else
  {
    // an image without a color space is always broken
    throw new IOException("could not determine inline image color space");
  }
}
 
origin: apache/pdfbox

/**
 * Draw an inline image at the x,y coordinates, with the default size of the image.
 *
 * @param inlineImage The inline image to draw.
 * @param x The x-coordinate to draw the inline image.
 * @param y The y-coordinate to draw the inline image.
 *
 * @throws IOException If there is an error writing to the stream.
 */
public void drawImage(PDInlineImage inlineImage, float x, float y) throws IOException
{
  drawImage(inlineImage, x, y, inlineImage.getWidth(), inlineImage.getHeight());
}
origin: apache/pdfbox

sb.append(inlineImage.getWidth());
sb.append(inlineImage.getHeight());
sb.append(inlineImage.getColorSpace().getName());
if (inlineImage.getDecode() != null && inlineImage.getDecode().size() > 0)
  for (COSBase base : inlineImage.getDecode())
if (inlineImage.isStencil())
sb.append(inlineImage.getBitsPerComponent());
writeBytes(inlineImage.getData());
writeLine();
writeOperator("EI");
origin: apache/pdfbox

/**
 * This will parse a type3 stream and create an image from it.
 * 
 * @return The image that was created.
 * 
 * @throws IOException
 *             If there is an error processing the stream.
 */
public Image createImage() throws IOException
{
  showType3Character(charProc);
  return image.getImage();
}
origin: com.github.lafa.pdfbox/pdfbox

sb.append(inlineImage.getWidth());
sb.append(inlineImage.getHeight());
sb.append(inlineImage.getColorSpace().getName());
if (inlineImage.getDecode() != null && inlineImage.getDecode().size() > 0)
  for (COSBase base : inlineImage.getDecode())
if (inlineImage.isStencil())
sb.append(inlineImage.getBitsPerComponent());
writeBytes(inlineImage.getData());
writeLine();
writeOperator("EI");
origin: apache/pdfbox

/**
 * Draw an inline image at the x,y coordinates, with the default size of the image.
 *
 * @param inlineImage The inline image to draw.
 * @param x The x-coordinate to draw the inline image.
 * @param y The y-coordinate to draw the inline image.
 *
 * @throws IOException If there is an error writing to the stream.
 * @deprecated Use {@link #drawImage(PDInlineImage, float, float)} instead.
 */
@Deprecated
public void drawInlineImage(PDInlineImage inlineImage, float x, float y) throws IOException
{
  drawImage(inlineImage, x, y, inlineImage.getWidth(), inlineImage.getHeight());
}
origin: org.apache.pdfbox/preflight

/**
 * This will parse a type3 stream and create an image from it.
 * 
 * @return The image that was created.
 * 
 * @throws IOException
 *             If there is an error processing the stream.
 */
public Image createImage() throws IOException
{
  showType3Character(charProc);
  return image.getImage();
}
origin: org.apache.pdfbox/pdfbox

sb.append(inlineImage.getWidth());
sb.append(inlineImage.getHeight());
sb.append(inlineImage.getColorSpace().getName());
if (inlineImage.getDecode() != null && inlineImage.getDecode().size() > 0)
  for (COSBase base : inlineImage.getDecode())
if (inlineImage.isStencil())
sb.append(inlineImage.getBitsPerComponent());
writeBytes(inlineImage.getData());
writeLine();
writeOperator("EI");
origin: apache/pdfbox

image = new PDInlineImage(operator.getImageParameters(),
             operator.getImageData(),
             getResources());
origin: org.apache.pdfbox/pdfbox

/**
 * Draw an inline image at the x,y coordinates, with the default size of the image.
 *
 * @param inlineImage The inline image to draw.
 * @param x The x-coordinate to draw the inline image.
 * @param y The y-coordinate to draw the inline image.
 *
 * @throws IOException If there is an error writing to the stream.
 */
public void drawImage(PDInlineImage inlineImage, float x, float y) throws IOException
{
  drawImage(inlineImage, x, y, inlineImage.getWidth(), inlineImage.getHeight());
}
origin: apache/pdfbox

List<String> filters = getFilters();
if (filters == null || filters.isEmpty())
origin: org.apache.pdfbox/pdfbox

@Override
public PDColorSpace getColorSpace() throws IOException
{
  COSBase cs = parameters.getDictionaryObject(COSName.CS, COSName.COLORSPACE);
  if (cs != null)
  {
    return createColorSpace(cs);
  }
  else if (isStencil())
  {
    // stencil mask color space must be gray, it is often missing
    return PDDeviceGray.INSTANCE;
  }
  else
  {
    // an image without a color space is always broken
    throw new IOException("could not determine inline image color space");
  }
}
 
origin: com.github.lafa.pdfbox/preflight

/**
 * This will parse a type3 stream and create an image from it.
 * 
 * @return The image that was created.
 * 
 * @throws IOException
 *             If there is an error processing the stream.
 */
public Image createImage() throws IOException
{
  showType3Character(charProc);
  return image.getImage();
}
origin: org.verapdf/pdfbox-validation-model

private List<PDInlineImage> getInlineImage() {
  try {
    COSBase parameters = this.arguments.get(0);
    org.apache.pdfbox.pdmodel.graphics.image.PDInlineImage inlineImage =
        new org.apache.pdfbox.pdmodel.graphics.image.PDInlineImage(
            (COSDictionary) parameters,
            this.imageData,
            this.resources);
    List<PDInlineImage> inlineImages = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS);
    inlineImages.add(new PBoxPDInlineImage(inlineImage, this.document, this.flavour));
    return Collections.unmodifiableList(inlineImages);
  } catch (IOException e) {
    LOGGER.debug(e);
  }
  return Collections.emptyList();
}
origin: com.github.lafa.pdfbox/pdfbox

/**
 * Draw an inline image at the x,y coordinates, with the default size of the image.
 *
 * @param inlineImage The inline image to draw.
 * @param x The x-coordinate to draw the inline image.
 * @param y The y-coordinate to draw the inline image.
 *
 * @throws IOException If there is an error writing to the stream.
 */
public void drawImage(PDInlineImage inlineImage, float x, float y) throws IOException
{
  drawImage(inlineImage, x, y, inlineImage.getWidth(), inlineImage.getHeight());
}
origin: org.verapdf/pdfbox-validation-model

private List<CosIIFilter> getFilters() {
  List<String> filters = ((org.apache.pdfbox.pdmodel.graphics.image.PDInlineImage) this.simplePDObject).getFilters();
  List<CosIIFilter> result = new ArrayList<>();
  if (filters != null) {
    for (String filter : filters) {
      result.add(new PBCosIIFilter(filter));
    }
  }
  return result;
}
origin: com.github.lafa.pdfbox/pdfbox

@Override
public PDColorSpace getColorSpace() throws IOException
{
  COSBase cs = parameters.getDictionaryObject(COSName.CS, COSName.COLORSPACE);
  if (cs != null)
  {
    return createColorSpace(cs);
  }
  else if (isStencil())
  {
    // stencil mask color space must be gray, it is often missing
    return PDDeviceGray.INSTANCE;
  }
  else
  {
    // an image without a color space is always broken
    throw new IOException("could not determine inline image color space");
  }
}

origin: org.apache.pdfbox/pdfbox

@Override
public void process(Operator operator, List<COSBase> operands) throws IOException
{
  if (operator.getImageData() == null || operator.getImageData().length == 0)
  {
    return;
  }
  PDImage image = new PDInlineImage(operator.getImageParameters(),
                   operator.getImageData(),
                   context.getResources());
  context.drawImage(image);
}
org.apache.pdfbox.pdmodel.graphics.imagePDInlineImage

Javadoc

An inline image object which uses a special syntax to express the data for a small image directly within the content stream.

Most used methods

  • <init>
    Creates an inline image from the given parameters and data.
  • getFilters
    Returns a list of filters applied to this stream, or null if there are none.
  • createColorSpace
  • getBitsPerComponent
  • getColorSpace
  • getData
    Returns the inline image data.
  • getDecode
  • getHeight
  • getImage
  • getWidth
  • isStencil
  • toLongName
  • isStencil,
  • toLongName,
  • createInputStream,
  • getColorKeyMask

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now