Package com.itextpdf.text.pdf

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


          fieldLocks.add(new FieldLock(action, params.getAsArray(PdfName.FIELDS)));
        }
        PdfNumber p = params.getAsNumber(PdfName.P);
        if (p == null)
          continue;
        switch (p.intValue()) {
        default:
          break;
        case 1:
          fillInAllowed &= false;
        case 2:
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

  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

     * 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

          fieldLocks.add(new FieldLock(action, params.getAsArray(PdfName.FIELDS)));
        }
        PdfNumber p = params.getAsNumber(PdfName.P);
        if (p == null)
          continue;
        switch (p.intValue()) {
        default:
          break;
        case 1:
          fillInAllowed &= false;
        case 2:
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 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

      throws IOException {
    PRStream stream = (PRStream) page.getAsStream(PdfName.CONTENTS);
    // 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

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.