Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfNumber


   * A value greater than one shortens the time it takes to play
   * the animation, or effectively speeds up the animation.
   * @param  speed  a speed value
   */
  public void setSpeed(float speed) {
    put(PdfName.SPEED, new PdfNumber(speed));
  }
View Full Code Here


   * @param  max    the maximum
   * @param  min    the minimum
   */
  private PdfDictionary createDimensionDictionary(float d, float max, float min) {
    PdfDictionary dict = new PdfDictionary();
    dict.put(PdfName.DEFAULT, new PdfNumber(d));
    dict.put(PdfName.MAX_CAMEL_CASE, new PdfNumber(max));
    dict.put(PdfName.MIN_CAMEL_CASE, new PdfNumber(min));
    return dict;
  }
View Full Code Here

   * Sets the time value of the cue point in milliseconds to match against
   * the cue point within Flash content and for display purposes.
   * @param  time  the time value of the cue point
   */
  public void setTime(int time) {
    put(PdfName.TIME, new PdfNumber(time));
  }
View Full Code Here

   * HOffset, when HAlign is Far, offsets the position towards the Near
   * direction.
   * @param  hOffset  an offset
   */
  public void setHOffset(float hOffset) {
    put(PdfName.HOFFSET, new PdfNumber(hOffset));
  }
View Full Code Here

   * VOffset, when VAlign is Far, offsets the position towards the Near
   * direction.
   * @param  vOffset  an offset
   */
  public void setVOffset(float vOffset) {
    put(PdfName.VOFFSET, new PdfNumber(vOffset));
  }
View Full Code Here

     * an MCID entry, returns that value.  Otherwise, a {@link NullPointerException} is thrown.
     * @return the MCID value
     * @throws NullPointerException if there is no MCID (see {@link MarkedContentInfo#hasMcid()})
     */
    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

                        palette[k * 3 + 2] = (byte)(rgb[k + bColor] >>> 8);
                    }
                    PdfArray indexed = new PdfArray();
                    indexed.add(PdfName.INDEXED);
                    indexed.add(PdfName.DEVICERGB);
                    indexed.add(new PdfNumber(gColor - 1));
                    indexed.add(new PdfString(palette));
                    PdfDictionary additional = new PdfDictionary();
                    additional.put(PdfName.COLORSPACE, indexed);
                    img.setAdditional(additional);
                }
View Full Code Here

  public void parseTag(String tag, PdfObject object, PdfDictionary page)
      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

            else if (PLTE.equals(marker)) {
                if (colorType == 3) {
                    PdfArray colorspace = new PdfArray();
                    colorspace.add(PdfName.INDEXED);
                    colorspace.add(getColorspace());
                    colorspace.add(new PdfNumber(len / 3 - 1));
                    ByteBuffer colortable = new ByteBuffer();
                    while ((len--) > 0) {
                        colortable.append_i(is.read());
                    }
                    colorspace.add(new PdfString(colorTable = colortable.toByteArray()));
View Full Code Here

            PdfDictionary dic = new PdfDictionary();
            if ((colorType & 2) == 0) {
                if (gamma == 1f)
                    return PdfName.DEVICEGRAY;
                array.add(PdfName.CALGRAY);
                dic.put(PdfName.GAMMA, new PdfNumber(gamma));
                dic.put(PdfName.WHITEPOINT, new PdfLiteral("[1 1 1]"));
                array.add(dic);
            }
            else {
                PdfObject wp = new PdfLiteral("[1 1 1]");
                array.add(PdfName.CALRGB);
                if (gamma != 1f) {
                    PdfArray gm = new PdfArray();
                    PdfNumber n = new PdfNumber(gamma);
                    gm.add(n);
                    gm.add(n);
                    gm.add(n);
                    dic.put(PdfName.GAMMA, gm);
                }
                if (hasCHRM) {
                    float z = yW*((xG-xB)*yR-(xR-xB)*yG+(xR-xG)*yB);
                    float YA = yR*((xG-xB)*yW-(xW-xB)*yG+(xW-xG)*yB)/z;
                    float XA = YA*xR/yR;
                    float ZA = YA*((1-xR)/yR-1);
                    float YB = -yG*((xR-xB)*yW-(xW-xB)*yR+(xW-xR)*yB)/z;
                    float XB = YB*xG/yG;
                    float ZB = YB*((1-xG)/yG-1);
                    float YC = yB*((xR-xG)*yW-(xW-xG)*yW+(xW-xR)*yG)/z;
                    float XC = YC*xB/yB;
                    float ZC = YC*((1-xB)/yB-1);
                    float XW = XA+XB+XC;
                    float YW = 1;//YA+YB+YC;
                    float ZW = ZA+ZB+ZC;
                    PdfArray wpa = new PdfArray();
                    wpa.add(new PdfNumber(XW));
                    wpa.add(new PdfNumber(YW));
                    wpa.add(new PdfNumber(ZW));
                    wp = wpa;
                    PdfArray matrix = new PdfArray();
                    matrix.add(new PdfNumber(XA));
                    matrix.add(new PdfNumber(YA));
                    matrix.add(new PdfNumber(ZA));
                    matrix.add(new PdfNumber(XB));
                    matrix.add(new PdfNumber(YB));
                    matrix.add(new PdfNumber(ZB));
                    matrix.add(new PdfNumber(XC));
                    matrix.add(new PdfNumber(YC));
                    matrix.add(new PdfNumber(ZC));
                    dic.put(PdfName.MATRIX, matrix);
                }
                dic.put(PdfName.WHITEPOINT, wp);
                array.add(dic);
            }
View Full Code Here

TOP

Related Classes of com.itextpdf.text.pdf.PdfNumber

Copyright © 2018 www.massapicom. 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.