Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfName


  public byte[] getStreamBytes() {
    return streamBytes;
  }
 
  public BufferedImage getAwtImage() throws IOException {
    PdfName filter = dictionary.getAsName(PdfName.FILTER);
    if (PdfName.DCTDECODE.equals(filter)) {
      return ImageIO.read(new ByteArrayInputStream(streamBytes));
    }
    if (!PdfName.FLATEDECODE.equals(filter)) {
      return null;
View Full Code Here


   *            the child dictionary to inspect
   */
  public void inspectChildDictionary(PdfDictionary k) throws IOException {
    if (k == null)
      return;
    PdfName s = k.getAsName(PdfName.S);
    if (s != null) {
      String tag = s.toString().substring(1);
      out.print("<");
      out.print(tag);
      out.print(">");
      PdfDictionary dict = k.getAsDict(PdfName.PG);
      if (dict != null)
View Full Code Here

        PdfObject newValue;
        if (cs.isName())
            newValue = cs;
        else {
            newValue = value;
            PdfName first = value.getAsName(0);
            if (PdfName.INDEXED.equals(first)) {
                if (value.size() >= 2) {
                    PdfArray second = value.getAsArray(1);
                    if (second != null) {
                        value.set(1, simplifyColorspace(second));
View Full Code Here

   * Gets a PDF Name from an array or returns the object that was passed.
   */
    private PdfObject simplifyColorspace(final PdfArray obj) {
        if (obj == null)
            return obj;
        PdfName first = obj.getAsName(0);
        if (PdfName.CALGRAY.equals(first))
            return PdfName.DEVICEGRAY;
        else if (PdfName.CALRGB.equals(first))
            return PdfName.DEVICERGB;
        else
View Full Code Here

     * Constructs a new <CODE>Section</CODE>.
     */
    protected Section() {
        title = new Paragraph();
        numberDepth = 1;
        title.setRole(new PdfName("H" + numberDepth));
    }
View Full Code Here

     */
    protected Section(final Paragraph title, final int numberDepth) {
        this.numberDepth = numberDepth;
        this.title = title;
        if (title != null)
            title.setRole(new PdfName("H" + numberDepth));
    }
View Full Code Here

     * @throws IOException
     */
    public XmpWriter(OutputStream os, PdfDictionary info) throws IOException {
        this(os);
        if (info != null) {
            PdfName key;
            PdfObject obj;
            String value;
            for (PdfName pdfName : info.getKeys()) {
                key = pdfName;
                obj = info.get(key);
View Full Code Here

        }
    }

    public void addDocInfoProperty(Object key, String value) throws XMPException {
        if (key instanceof String)
            key = new PdfName((String) key);
        if (PdfName.TITLE.equals(key)) {
            xmpMeta.setLocalizedText(XMPConst.NS_DC, DublinCoreProperties.TITLE, XMPConst.X_DEFAULT, XMPConst.X_DEFAULT, value);
        } else if (PdfName.AUTHOR.equals(key)) {
            xmpMeta.appendArrayItem(XMPConst.NS_DC, DublinCoreProperties.CREATOR, new PropertyOptions(PropertyOptions.ARRAY_ORDERED), value, null);
        } else if (PdfName.SUBJECT.equals(key)) {
View Full Code Here

    private void displayXObject(PdfName xobjectName) throws IOException {
        PdfDictionary xobjects = resources.getAsDict(PdfName.XOBJECT);
        PdfObject xobject = xobjects.getDirectObject(xobjectName);
        PdfStream xobjectStream = (PdfStream)xobject;

        PdfName subType = xobjectStream.getAsName(PdfName.SUBTYPE);
        if (xobject.isStream()){
            XObjectDoHandler handler = xobjectDoHandlers.get(subType);
            if (handler == null)
                handler = xobjectDoHandlers.get(PdfName.DEFAULT);
            handler.handleXObject(this, xobjectStream, xobjects.getAsIndirectObject(xobjectName));
View Full Code Here

    /**
     * A content operator implementation (Tf).
     */
    private static class SetTextFont implements ContentOperator{
        public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList<PdfObject> operands) {
            PdfName fontResourceName = (PdfName)operands.get(0);
            float size = ((PdfNumber)operands.get(1)).floatValue();

            PdfDictionary fontsDictionary = processor.resources.getAsDict(PdfName.FONT);
            CMapAwareDocumentFont font;
            PdfObject fontObject = fontsDictionary.get(fontResourceName);
View Full Code Here

TOP

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

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.