Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfName


  /**
   * Sets the value of the collection item.
   * @param d
   */
  public void addItem(String key, PdfDate d) {
    PdfName fieldname = new PdfName(key);
    PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
    if (field.fieldType == PdfCollectionField.DATE) {
      put(fieldname, d);
    }
  }
View Full Code Here


  /**
   * Sets the value of the collection item.
   * @param n
   */
  public void addItem(String key, PdfNumber n) {
    PdfName fieldname = new PdfName(key);
    PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
    if (field.fieldType == PdfCollectionField.NUMBER) {
      put(fieldname, n);
    }
  }
View Full Code Here

   * Adds a prefix for the Collection item.
   * You can only use this method after you have set the value of the item.
   * @param prefix  a prefix
   */
  public void setPrefix(String key, String prefix) {
    PdfName fieldname = new PdfName(key);
    PdfObject o = get(fieldname);
    if (o == null)
      throw new IllegalArgumentException(MessageLocalization.getComposedMessage("you.must.set.a.value.before.adding.a.prefix"));
    PdfDictionary dict = new PdfDictionary(PdfName.COLLECTIONSUBITEM);
    dict.put(PdfName.D, o);
View Full Code Here

    /**
     * A content operator implementation (gs).
     */
    private static class ProcessGraphicsStateResource implements ContentOperator{
        public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList operands) {
            PdfName dictionaryName = (PdfName)operands.get(0);
            PdfDictionary extGState = processor.resources.getAsDict(PdfName.EXTGSTATE);
            if (extGState == null)
                throw new IllegalArgumentException(MessageLocalization.getComposedMessage("resources.do.not.contain.extgstate.entry.unable.to.process.operator.1", operator));
            PdfDictionary gsDic = extGState.getAsDict(dictionaryName);
            if (gsDic == null)
View Full Code Here

    static public String getDictionaryDetail(PdfDictionary dic, int depth){
        StringBuffer builder = new StringBuffer();
        builder.append('(');
        List subDictionaries = new ArrayList();
        for (Iterator i = dic.getKeys().iterator(); i.hasNext(); ) {
            PdfName key = (PdfName)i.next();
            PdfObject val = dic.getDirectObject(key);
            if (val.isDictionary())
                subDictionaries.add(key);
            builder.append(key);
            builder.append('=');
            builder.append(val);
            builder.append(", ");
        }
        builder.setLength(builder.length()-2);
        builder.append(')');
        PdfName pdfSubDictionaryName;
        for (Iterator it = subDictionaries.iterator(); it.hasNext(); ) {
          pdfSubDictionaryName = (PdfName)it.next();
            builder.append('\n');
            for(int i = 0; i < depth+1; i++){
                builder.append('\t');
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(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

    /**
     * A content operator implementation (Tf).
     */
    private static class SetTextFont implements ContentOperator{
        public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList operands) {
            PdfName fontResourceName = (PdfName)operands.get(0);
            float size = ((PdfNumber)operands.get(1)).floatValue();
           
            PdfDictionary fontsDictionary = processor.resources.getAsDict(PdfName.FONT);
            CMapAwareDocumentFont font = new CMapAwareDocumentFont((PRIndirectReference)fontsDictionary.get(fontResourceName));
           
View Full Code Here

            XRLog.render(Level.FINEST, "titleElement=" + titleElement );
            XRLog.render(Level.FINEST, "titleElement.name=" + titleElement.getTagName() );
            XRLog.render(Level.FINEST, "titleElement.value=" + titleElement.getNodeValue() );
            XRLog.render(Level.FINEST, "titleElement.content=" + titleElement.getTextContent() );
            String titleContent = titleElement.getTextContent();
            PdfName pdfName = PdfName.TITLE;
            PdfString pdfString = new PdfString( titleContent );
            this.pdfInfoValues.put( pdfName, pdfString );
        }
    }
View Full Code Here

            String metaName = thisNode.getAttribute( HTML_META_ATTR_NAME );
            String metaContent = thisNode.getAttribute( HTML_META_ATTR_CONTENT );
            XRLog.render(Level.FINEST, "metaName=" + metaName + ", metaContent=" + metaContent );           
            if (metaName.length() != 0 && metaContent.length() != 0) {

                PdfName pdfName = null;
                PdfString pdfString = null;           
                if ( HTML_META_KEY_TITLE.equalsIgnoreCase( metaName )
                        || HTML_META_KEY_DC_TITLE.equalsIgnoreCase( metaName ) ) {
                    pdfName = PdfName.TITLE;
                    pdfString = new PdfString( metaContent, PdfObject.TEXT_UNICODE );                   
View Full Code Here

TOP

Related Classes of com.lowagie.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.