Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfNumber.intValue()


     * A content operator implementation (Tr).
     */
    private static class SetTextRenderMode implements ContentOperator{
        public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList<PdfObject> operands) {
            PdfNumber render = (PdfNumber)operands.get(0);
            processor.gs().renderMode = render.intValue();
        }
    }

    /**
     * A content operator implementation (Ts).
View Full Code Here


    public int getMcid(){
        PdfNumber id = dictionary.getAsNumber(PdfName.MCID);
        if (id == null)
            throw new IllegalStateException("MarkedContentInfo does not contain MCID");
       
        return id.intValue();
    }
   
}
View Full Code Here

        PdfNumber wObj = imageDictionary.getAsNumber(PdfName.WIDTH);
        PdfNumber bpcObj = imageDictionary.getAsNumber(PdfName.BITSPERCOMPONENT);
        int cpp = getComponentsPerPixel(imageDictionary.getAsName(PdfName.COLORSPACE), colorSpaceDic);
       
        int w = wObj.intValue();
        int bpc = bpcObj != null ? bpcObj.intValue() : 1;
       
       
        int bytesPerRow = (w * bpc * cpp + 7) / 8;
       
        return bytesPerRow;
View Full Code Here

        if (imageDictionary.contains(PdfName.FILTER))
            throw new IllegalArgumentException("Dictionary contains filters");
       
        PdfNumber h = imageDictionary.getAsNumber(PdfName.HEIGHT);

        int bytesToRead = computeBytesPerRow(imageDictionary, colorSpaceDic) * h.intValue();
        byte[] bytes = new byte[bytesToRead];
        PRTokeniser tokeniser = ps.getTokeniser();
       
        int shouldBeWhiteSpace = tokeniser.read(); // skip next character (which better be a whitespace character - I suppose we could check for this)
        // from the PDF spec:  Unless the image uses ASCIIHexDecode or ASCII85Decode as one of its filters, the ID operator shall be followed by a single white-space character, and the next character shall be interpreted as the first byte of image data.
View Full Code Here

      PdfNumber structParent = dict.getAsNumber(PdfName.STRUCTPARENT);
      LOGGER.info(String.format("Encountered StructParent %s in content", structParent));
      if (structParent == null)
        return;
      StructureItem item = items.get(0);
      if (item.checkStructParent(pageref.getNumber(), structParent.intValue()) == 1)
        items.remove(0);
    }
   
    /**
     * When an MCID is encountered, the parser will check the list
View Full Code Here

      if (description == null)
        description = dict.getAsString(PdfName.T);
      if (PdfName.BTN.equals(dict.get(PdfName.FT))) {
        PdfNumber fflags = dict.getAsNumber(PdfName.FF);
        if (fflags != null) {
          int ff = fflags.intValue();
                if ((ff & PdfFormField.FF_PUSHBUTTON) != 0)
                    attribute.put(PdfName.ROLE, PdfName.PB);
                // I don't think the condition below will ever be true
                if ((ff & PdfFormField.FF_RADIO) != 0)
                    attribute.put(PdfName.ROLE, PdfName.rb);
View Full Code Here

     * A content operator implementation (Tr).
     */
    private static class SetTextRenderMode implements ContentOperator{
        public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList<PdfObject> operands) {
            PdfNumber render = (PdfNumber)operands.get(0);
            processor.gs().renderMode = render.intValue();
        }
    }

    /**
     * A content operator implementation (Ts).
View Full Code Here

  public void parseTag(String tag, PdfObject object, PdfDictionary page)
      throws IOException {
    // if the identifier is a number, we can extract the content right away
    if (object instanceof PdfNumber) {
      PdfNumber mcid = (PdfNumber) object;
      RenderFilter filter = new MarkedContentRenderFilter(mcid.intValue());
      TextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
      FilteredTextRenderListener listener = new FilteredTextRenderListener(
          strategy, filter);
      PdfContentStreamProcessor processor = new PdfContentStreamProcessor(
          listener);
View Full Code Here

    public int getMcid(){
        PdfNumber id = dictionary.getAsNumber(PdfName.MCID);
        if (id == null)
            throw new IllegalStateException("MarkedContentInfo does not contain MCID");
       
        return id.intValue();
    }
   
}
View Full Code Here

        PdfNumber wObj = imageDictionary.getAsNumber(PdfName.WIDTH);
        PdfNumber bpcObj = imageDictionary.getAsNumber(PdfName.BITSPERCOMPONENT);
        int cpp = getComponentsPerPixel(imageDictionary.getAsName(PdfName.COLORSPACE), colorSpaceDic);
       
        int w = wObj.intValue();
        int bpc = bpcObj != null ? bpcObj.intValue() : 1;
       
       
        int bytesPerRow = (w * bpc * cpp + 7) / 8;
       
        return bytesPerRow;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.